bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about "invalid string offset" & "could not read symbols: Ma


From: Roger Moore
Subject: Re: question about "invalid string offset" & "could not read symbols: Malformed archive" linker errors (fwd)
Date: Fri, 22 Aug 2008 14:10:44 -0600 (MDT)

Hi Nick,

On Fri, 22 Aug 2008, Nick Clifton wrote:

> Hi Roger,
> 
> > We built the libxvtmapi.a ourselves.  Yes, I've tried deleting it and 
> > rebuilding but I still get the file format not recognized error message.  
> >   
> > The build procedure seems to work fine otherwise, though there are some 
> > warning messages.  That said, I haven't seen any warning messages that 
> > seem to be related to this issue.
> >   
> [If all else fails, try fixing the warnings anyway... :-)]

That is an option I will have to explore at some point, I think. :)

> > address@hidden testapp]$ objdump -p 
> > outdir/debug/libxvtxmapi.a 
> > In archive outdir/debug/libxvtxmapi.a:
> > objdump: tapp.o: File format not recognized
> > objdump: outdir/debug/libxvtxmapi.a: Malformed archive
> >   
> This is the cause of the problem - the tapp.o file is not recognized.  
> One possible cause for this is that the compiler used to build the 
> tapp.o file is targeted at one particular processor type and the 
> binutils (including objdump and the linker) are targeted at a different 
> system type.  To check this have a look at the output of "objdump 
> --help" and compare the supported  targets list with  the  target 
> displayed as part of the output of "gcc --verbose".

Both the objdump and gcc commands indicate they support the i386 
architecture, which is where I am building the testapp.  Here is the 
output from uname:

Linux randyx64-rh5 2.6.18-53.el5PAE #1 SMP Wed Oct 10 16:48:18 EDT 2007 
i686 i686 i386 GNU/Linux

So it is a 64-bit machine but we are running 32-bit Red Hat Enterprise 5 
on it.  It get identical build errors when I try to build it on 64-bit 
Red Hat Enterprise 5 as well.

> > Here is the tapp.o file:
> >
> > address@hidden testapp]$ find . -name tapp.o
> > ./xvtdsp55/linux_x86/src/ptk/CMakeFiles/xvtxmapid.dir/tapp.o
> What does "objdump -p tapp.o" report ?  Is it still unrecognized ?  (If 
> not then this is very worrying.  It would mean that placing the tapp.o 
> file into the libxvtxmapi.a archive has corrupted it).

The results from objdump are very confusing:

address@hidden xvtxmapid.dir]$ objdump -p tapp.o 

tapp.o:     file format elf32-i386

address@hidden xvtxmapid.dir]$ 

So it looks like objdump thinks tapp.o is OK!?

> How was tapp.o built ?  (Ie what was the command line used to compile it 
> and to assemble it).

Here are the commands in the makefile that related to tapp (please note 
that it is built using GNU Make 3.81, but the make is configured using 
cmake version 2.6-patch 1):

# target to build an object file
tapp.o:
        cd 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86 && 
$(MAKE) -f src/ptk/CMakeFiles/xvtxmapid.dir/build.make 
src/ptk/CMakeFiles/xvtxmapid.dir/tapp.o
.PHONY : tapp.o

# target to preprocess a source file
tapp.i:
        cd 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86 && 
$(MAKE) -f src/ptk/CMakeFiles/xvtxmapid.dir/build.make 
src/ptk/CMakeFiles/xvtxmapid.dir/tapp.i
.PHONY : tapp.i

# target to generate assembly for a file
tapp.s:
        cd 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86 && 
$(MAKE) -f src/ptk/CMakeFiles/xvtxmapid.dir/build.make 
src/ptk/CMakeFiles/xvtxmapid.dir/tapp.s
.PHONY : tapp.s

As well, here is the make command in the makefile:

# The main all target
all: cmake_check_build_system
        cd 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86 && 
$(CMAKE_COMMAND) -E cmake_progress_start 
/home/roger/workspace/branches/testappw-xvt5.8update/xvtdsp55/linux_x86/CMakeFiles
 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86/src/ptk/CMakeFiles/progress.make
        cd 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86 && 
$(MAKE) -f CMakeFiles/Makefile2 src/ptk/all
        $(CMAKE_COMMAND) -E cmake_progress_start 
/home/roger/workspace/branches/testapp-xvt5.8update/xvtdsp55/linux_x86/CMakeFiles
 
0
.PHONY : all
 
> Cheers
>   Nick

FYI, here is the output from objdump and gcc that you requested earlier:

address@hidden testapp-xvt5.8update]$ objdump --help
Usage: objdump <option(s)> <file(s)>
 Display information from object <file(s)>.
 At least one of the following switches must be given:
  -a, --archive-headers    Display archive header information
  -f, --file-headers       Display the contents of the overall file header
  -p, --private-headers    Display object format specific file header 
contents
  -h, --[section-]headers  Display the contents of the section headers
  -x, --all-headers        Display the contents of all headers
  -d, --disassemble        Display assembler contents of executable 
sections
  -D, --disassemble-all    Display assembler contents of all sections
  -S, --source             Intermix source code with disassembly
  -s, --full-contents      Display the full contents of all sections 
requested
  -g, --debugging          Display debug information in object file
  -e, --debugging-tags     Display debug information using ctags style
  -G, --stabs              Display (in raw form) any STABS info in the 
file
  -W, --dwarf              Display DWARF info in the file
  -t, --syms               Display the contents of the symbol table(s)
  -T, --dynamic-syms       Display the contents of the dynamic symbol 
table
  -r, --reloc              Display the relocation entries in the file
  -R, --dynamic-reloc      Display the dynamic relocation entries in the 
file
  @<file>                  Read options from <file>
  -v, --version            Display this program's version number
  -i, --info               List object formats and architectures supported
  -H, --help               Display this information

 The following switches are optional:
  -b, --target=BFDNAME           Specify the target object format as 
BFDNAME
  -m, --architecture=MACHINE     Specify the target architecture as 
MACHINE
  -j, --section=NAME             Only display information for section NAME
  -M, --disassembler-options=OPT Pass text OPT on to the disassembler
  -EB --endian=big               Assume big endian format when 
disassembling
  -EL --endian=little            Assume little endian format when 
disassembling
      --file-start-context       Include context from start of file (with 
-S)
  -I, --include=DIR              Add DIR to search list for source files
  -l, --line-numbers             Include line numbers and filenames in 
output
  -F, --file-offsets             Include file offsets when displaying 
information
  -C, --demangle[=STYLE]         Decode mangled/processed symbol names
                                  The STYLE, if specified, can be `auto', 
`gnu',
                                  `lucid', `arm', `hp', `edg', `gnu-v3', 
`java'
                                  or `gnat'
  -w, --wide                     Format output for more than 80 columns
  -z, --disassemble-zeroes       Do not skip blocks of zeroes when 
disassembling
      --start-address=ADDR       Only process data whose address is >= 
ADDR
      --stop-address=ADDR        Only process data whose address is <= 
ADDR
      --prefix-addresses         Print complete address alongside 
disassembly
      --[no-]show-raw-insn       Display hex alongside symbolic 
disassembly
      --adjust-vma=OFFSET        Add OFFSET to all displayed section 
addresses
      --special-syms             Include special symbols in symbol dumps

objdump: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 
efi-bsdrv-ia32 efi-rtdrv-ia32 elf32-little elf32-big srec symbolsrec 
tekhex binary ihex trad-core
objdump: supported architectures: i386 i386:x86-64 i8086 i386:intel 
i386:x86-64:intel

The following i386/x86-64 specific disassembler options are supported for 
use
with the -M switch (multiple options should be separated by commas):
  x86-64      Disassemble in 64bit mode
  i386        Disassemble in 32bit mode
  i8086       Disassemble in 16bit mode
  att         Display instruction in AT&T syntax
  intel       Display instruction in Intel syntax
  att-mnemonic
              Display instruction in AT&T mnemonic
  intel-mnemonic
              Display instruction in Intel mnemonic
  addr64      Assume 64bit address size
  addr32      Assume 32bit address size
  addr16      Assume 16bit address size
  data32      Assume 32bit data size
  data16      Assume 16bit data size
  suffix      Always display instruction suffix in AT&T syntax
Report bugs to <http://www.sourceware.org/bugzilla/>.
address@hidden testapp-xvt5.8update]$ 

address@hidden testapp-xvt5.8update]$ gcc --verbose
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--enable-checking=release --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --enable-libgcj-multifile 
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada 
--enable-java-awt=gtk --disable-dssi --enable-plugin 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre 
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)
address@hidden testapp-xvt5.8update]$ 

Here is the file 
xvtdsp55/linux_x86/src/ptk/CMakeFiles/xvtxmapi.dir/link.txt: 

/usr/bin/ar cr ../../lib/libxvtxmapi.a  "CMakeFiles/xvtxmapi.dir/tapp.o" 
"CMakeFiles/xvtxmapi.dir/tcb.o" "CMakeFiles/xvtxmapi.dir/tctl.o" 
"CMakeFiles/xvtxmapi.dir/tcxo.o" "CMakeFiles/xvtxmapi.dir/tdebug.o" 
"CMakeFiles/xvtxmapi.dir/tdlg.o" "CMakeFiles/xvtxmapi.dir/tdm.o" 
"CMakeFiles/xvtxmapi.dir/tdwin.o" "CMakeFiles/xvtxmapi.dir/terr.o" 
"CMakeFiles/xvtxmapi.dir/tevent.o" "CMakeFiles/xvtxmapi.dir/tfont.o" 
"CMakeFiles/xvtxmapi.dir/tfsys.o" "CMakeFiles/xvtxmapi.dir/tgmem.o" 
"CMakeFiles/xvtxmapi.dir/thtml.o" "CMakeFiles/xvtxmapi.dir/timage.o" 
"CMakeFiles/xvtxmapi.dir/tiostr.o" "CMakeFiles/xvtxmapi.dir/tlist.o" 
"CMakeFiles/xvtxmapi.dir/tmem.o" "CMakeFiles/xvtxmapi.dir/tmenu.o" 
"CMakeFiles/xvtxmapi.dir/tnav.o" "CMakeFiles/xvtxmapi.dir/tnotebk.o" 
"CMakeFiles/xvtxmapi.dir/tpalet.o" "CMakeFiles/xvtxmapi.dir/tpat.o" 
"CMakeFiles/xvtxmapi.dir/tpict.o" "CMakeFiles/xvtxmapi.dir/tpmap.o" 
"CMakeFiles/xvtxmapi.dir/tprint.o" "CMakeFiles/xvtxmapi.dir/trect.o" 
"CMakeFiles/xvtxmapi.dir/tres.o" "CMakeFiles/xvtxmapi.dir/tsbar.o" 
"CMakeFiles/xvtxmapi.dir/tscr.o" "CMakeFiles/xvtxmapi.dir/tslist.o" 
"CMakeFiles/xvtxmapi.dir/tstr.o" "CMakeFiles/xvtxmapi.dir/ttimer.o" 
"CMakeFiles/xvtxmapi.dir/ttreev.o" "CMakeFiles/xvtxmapi.dir/ttx.o" 
"CMakeFiles/xvtxmapi.dir/tvobj.o" "CMakeFiles/xvtxmapi.dir/twin.o" 
"CMakeFiles/xvtxmapi.dir/rotated.o" "CMakeFiles/xvtxmapi.dir/xvtcm.o" 
/usr/bin/ranlib ../../lib/libxvtxmapi.a 

Here is the file 
xvtdsp55/linux_x86/src/ptk/CMakeFiles/xvtxmapid.dir/link.txt: 

/usr/bin/ar cr ../../lib/libxvtxmapid.a  CMakeFiles/xvtxmapid.dir/tapp.o 
CMakeFiles/xvtxmapid.dir/tcb.o CMakeFiles/xvtxmapid.dir/tctl.o 
CMakeFiles/xvtxmapid.dir/tcxo.o CMakeFiles/xvtxmapid.dir/tdebug.o 
CMakeFiles/xvtxmapid.dir/tdlg.o CMakeFiles/xvtxmapid.dir/tdm.o 
CMakeFiles/xvtxmapid.dir/tdwin.o CMakeFiles/xvtxmapid.dir/terr.o 
CMakeFiles/xvtxmapid.dir/tevent.o CMakeFiles/xvtxmapid.dir/tfont.o 
CMakeFiles/xvtxmapid.dir/tfsys.o CMakeFiles/xvtxmapid.dir/tgmem.o 
CMakeFiles/xvtxmapid.dir/thtml.o CMakeFiles/xvtxmapid.dir/timage.o 
CMakeFiles/xvtxmapid.dir/tiostr.o CMakeFiles/xvtxmapid.dir/tlist.o 
CMakeFiles/xvtxmapid.dir/tmem.o CMakeFiles/xvtxmapid.dir/tmenu.o 
CMakeFiles/xvtxmapid.dir/tnav.o CMakeFiles/xvtxmapid.dir/tnotebk.o 
CMakeFiles/xvtxmapid.dir/tpalet.o CMakeFiles/xvtxmapid.dir/tpat.o 
CMakeFiles/xvtxmapid.dir/tpict.o CMakeFiles/xvtxmapid.dir/tpmap.o 
CMakeFiles/xvtxmapid.dir/tprint.o CMakeFiles/xvtxmapid.dir/trect.o 
CMakeFiles/xvtxmapid.dir/tres.o CMakeFiles/xvtxmapid.dir/tsbar.o 
CMakeFiles/xvtxmapid.dir/tscr.o CMakeFiles/xvtxmapid.dir/tslist.o 
CMakeFiles/xvtxmapid.dir/tstr.o CMakeFiles/xvtxmapid.dir/ttimer.o 
CMakeFiles/xvtxmapid.dir/ttreev.o CMakeFiles/xvtxmapid.dir/ttx.o 
CMakeFiles/xvtxmapid.dir/tvobj.o CMakeFiles/xvtxmapid.dir/twin.o 
CMakeFiles/xvtxmapid.dir/rotated.o CMakeFiles/xvtxmapid.dir/xvtcm.o 
/usr/bin/ranlib ../../lib/libxvtxmapid.a 

The only difference as far as I've been able to tell so far between 
xvtmapi and xvtmapid is the former is intended for cmake 2.4 while the 
latter is intended for cmake 2.6.

Thanks so much--I really appreciate your help!  If you have any more 
questions or ideas, please feel free to let me know.

Cheers,

Roger





reply via email to

[Prev in Thread] Current Thread [Next in Thread]