Fedora Linux Support Community & Resources Center
  #1  
Old 9th February 2011, 09:57 PM
matth45 Offline
Registered User
 
Join Date: Jun 2007
Posts: 160
linuxchrome
objdump: file format not recognized

Can someone tell me what is going on here?

This works fine for most libraries:

Code:
$ objdump -f /usr/lib64/libm.so

/usr/lib64/libm.so:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x0000000000003ea0

$ objdump -f /usr/lib/libm.so

/usr/lib/libm.so:     file format elf32-i386
architecture: i386, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x00003470
However, for some libraries (with debugging info? from glibc-devel?) this fails:

Code:
$ objdump -f /usr/lib64/libc.so 
objdump: /usr/lib64/libc.so: File format not recognized

$ rpm -q --whatprovides /usr/lib64/libc.so
glibc-devel-2.13-1.x86_64

$ objdump -f /usr/lib64/libpthread.so
objdump: /usr/lib64/libpthread.so: File format not recognized

$ rpm -q --whatprovides /usr/lib64/libpthread.so 
glibc-devel-2.13-1.x86_64
But...

Code:
$ objdump -f /lib64/libpthread.so.0 

/lib64/libpthread.so.0:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x0000000000005b80

$ objdump -f /lib64/libc.so.6 

/lib64/libc.so.6:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x000000000001ef70

$ rpm -q --whatprovides /lib64/libc.so.6
glibc-2.13-1.x86_64
It's not just 64-bit libs, the same is true for 32-bit. It's not a corrupted file, or at least, this is the exact binary file that glibc-devel provides.

Is this a bug or an expected result? If I don't hear anything here I'll submit a bug.
Reply With Quote
  #2  
Old 10th February 2011, 09:40 AM
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
linuxfedorafirefox
Re: objdump: file format not recognized

I'd say expected:
Code:
[root@localhost ~]# file /usr/lib/libc.so
/usr/lib/libc.so: ASCII C program text
[root@localhost ~]# cat /usr/lib/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.2 ) )
[root@localhost ~]# objdump -f /lib/libc.so.6

/lib/libc.so.6:     file format elf32-i386
architecture: i386, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x003f6f70
I think it's related to linker scripts
Reply With Quote
  #3  
Old 10th February 2011, 12:54 PM
SiliconSlick Offline
Registered User
 
Join Date: Aug 2009
Location: College Station, TX
Posts: 501
linuxfedorafirefox
Re: objdump: file format not recognized

libc.so.Xis neat/special in that you can execute it to find its version... a feature that would be cool for all libs if there wasn't an impact (which there probably is).
Code:
$ /lib64/libc.so.6 
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.1 20100924 (Red Hat 4.5.1-4).
Compiled on a Linux 2.6.35 system on 2011-01-20.
Available extensions:
	Support for some architectures added on, not maintained in glibc core.
	The C stubs add-on version 2.1.2.
	crypt add-on version 2.1 by Michael Glad and others
	GNU Libidn by Simon Josefsson
	Native POSIX Threads Library by Ulrich Drepper et al
	BIND-8.2.3-T5B
	RT using linux kernel aio
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
Definitely not a bug though... its been that way for ages.

SS
Reply With Quote
  #4  
Old 10th February 2011, 02:11 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: objdump: file format not recognized

objdump is designed to dump object files.

Not shared libraries (*.so files). These are not object files.

Not libraries (such as /usr/lib64/libieee.a), these are not object files either.

Object files are the output of compilers (*.o files), and contain a LOT
of information that is stripped out by linkers when they create shared
libraries or executable binaries.

Libraries are created with ar (*.a files), and are in a tar like file structure
with symbol names in index sections that allow the linker to identify
included *.o modules (these are object files) to include in a binary.
Reply With Quote
  #5  
Old 10th February 2011, 11:31 PM
matth45 Offline
Registered User
 
Join Date: Jun 2007
Posts: 160
linuxchrome
Re: objdump: file format not recognized

Thanks for the pointers everyone. I did not know that about linker scripts.

jpollard, objdump certainly is designed to handle .so files. 1) it works when you give it a real .so file and not a text file!, 2) the man page references dynamic objects and shared libraries.
Reply With Quote
  #6  
Old 11th February 2011, 01:28 AM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: objdump: file format not recognized

learn something new every day.
Reply With Quote
Reply

Tags
file, format, objdump, recognized

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a pdf file in A3 format from two sheets in A4 format? joseda Using Fedora 4 28th April 2010 08:31 PM
file not recognized: Is a directory dxdhit Programming & Packaging 3 7th May 2009 09:03 AM
vfat file format stops to get recognized. soumo Using Fedora 2 29th April 2007 06:52 PM
USB HDD not recognized after format failiure!! mjman Hardware & Laptops 2 7th December 2004 10:04 PM
Script file not being recognized in FC3??? confused261 Using Fedora 15 5th December 2004 11:08 PM


Current GMT-time: 08:28 (Friday, 24-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Lebedyan Travel Photos - Reo Instagram Photos - Trichur