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: Tue, 26 Aug 2008 13:17:40 -0600 (MDT)

Hi Nick,

On Tue, 26 Aug 2008, Nick Clifton wrote:

> >>> In archive outdir/debug/libxvtxmapi.a:
> >>> objdump: tapp.o: File format not recognized
> 
> > address@hidden xvtxmapid.dir]$ objdump -p tapp.o 
> > tapp.o:     file format elf32-i386
> 
> 
> Oh dear.  So it would appear that tapp.o is being corrupted when it is 
> added to the libxvtmapi.a archive.
> 
> If you extract a copy from the archive is this version also 
> unreconizable ?  Is it the same size as the original version ?  Do they 
> compare the same ?

When I attempt to extract tapp.o from libxvtxmapi.a, I get the malformed 
archive problem again,

address@hidden debug]$ ar -x libxvtxmapi.a tapp.o
ar: libxvtxmapi.a: Malformed archive

When I compare tapp.o to libxvtxmapi.a in a hex editor, the only part that 
is common between the two files is,

007876745F6170705F6765745F64656661756C745F63746F6F6C73007876745F6170705F6765745F66696C65007876745F6170705F7365745F66696C655F70726F636573736564007876745F6170705F6765745F66696C65735F636F756E74007876745F6170705F657363617065007876745F6170705F

Here is the tapp.o file in ASCII.  When I visually compare this to what is 
in libxvtxmapi.a, they *look* identical but my hex editor indicates they 
are different for some reason except for the part that I indicated above,

.ELF....................................4.....(.................U..S......................$..........f..t9.......D$.N....D$...a..D$......D$...$.................[]..............[].........'....U....(.].............u..u.........$.......t..4$...............]..u...]........D$.+....D$...!..D$......D$...$.................t&.U......].............u.........$....................]..u...]..v.U..S......................$..................[].................U....(.].............}..}..u..u.........$.......tW..t..t$..<$...........]..u..}...]..D$............D$...!..D$.......$.....D$..............D$...............'....U....(.]..E.............E..u.........$......E..D$..E...$................]....u...].........'....U..S......................[]..v.U....(.].............u..u..}..}........t~........$.......t...t3.E..t$..|$..D$..E..D$..E...$...........]..u..}...]..D$.b..........D$...!..D$.......$.....D$...............$....f.......o....D$.\.................U..S......................$..................[].....xvt_app_process_pending_events../mnt/hgfs/pclinux/trunk/branches/vistanew-xvt5.8update/xvtdsp55/linux_x86/src/ptk/tapp.c.xvt_app_get_default_ctools.xvt_app_get_file.xvt_app_set_file_processed.xvt_app_get_files_count.xvt_app_escape.xvt_app_create.xvt_app_allow_quit...
 
....GCC: (GNU) 4.1.2 20070626 (Red Hat 
4.1.2-14)address@hidden(...x..................................................................................................................................................................................................................................."...............'...,...........,...G...........1..._...........6...n...........;address@hidden|address@hidden
 
...S.......................................................................................*...............:...............Q...p...1.......d................tapp.c.xvt_source_file..LC0..LC1..LC2..LC3..LC4..LC5..LC6..LC7.xvt_app_process_pending_events.__i686.get_pc_thunk.bx._GLOBAL_OFFSET_TABLE_.xvtv_errfrm_mark_API.xvtv_app_proc_update.xvtv_errmsg_dispatch.xvtv_errfrm_unmark_API.xvtk_app_process_pending_events.xvt_app_get_default_ctools.xvtv_app_get_default_ctools.xvt_app_get_file.xvtk_app_get_file.xvt_app_set_file_processed.xvtk_app_set_file_processed.xvt_app_get_files_count.xvtk_app_get_files_count.xvt_app_escape.xvtk_app_escape.xvt_app_destroy.xvtv_app_destroy.xvt_app_create.xvtv_mem_get_functions.xvtk_app_create.xvtv_mem_set_functions.xvt_app_allow_quit.xvtk_app_allow_quit.................................!.......,.......T.......Y.......d.......i.......................................................................................................!.......&....
 
..-.......E.......K.......T.......\.......a...."..f............................................$..................................-.......3.......?.......G.......Y....&..`............................(.......................*.......................+..................<.......A.......Q....,..u.......{...............................................

The part that my hex editor indicates is identical between libxvtxmapi.a 
and tapp.o is this part,

.xvt_app_get_default_ctools.xvt_app_get_file.xvt_app_set_file_processed.xvt_app_get_files_count.xvt_app_escape.xvt_app_

Do you have any other ways I could extract tapp.o besides using ar?  

> > 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" 
>  > [...]
> > /usr/bin/ranlib ../../lib/libxvtxmapi.a 
> 
> Quick question - if you intercept the libxvtmapi.a build process after 
> the invocation of "ar" but before the invocation of "ranlib" is the 
> version of tapp.o inside the archive unrecognizable ?  Ie is the "ar" 
> process or the "ranlib" process that is corrupting tapp.o ?
>
> 
> Which versions of "ar" and "ranlib" are you using ?
> 
> Cheers
>    Nick

If I take ranlib out of the link.txt file, and then try to build, I get 
the same malformed archive message on libxvtxmapi.a, so it appears that 
the corruption occurs before ranlib is called.

The ar and ranlib commands are from the CVS checkout I performed on GNU 
Binutils:

address@hidden debug]$ ar --version
GNU ar (GNU Binutils) 2.18.50.20080822
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later 
version.
This program has absolutely no warranty.
address@hidden debug]$ 

address@hidden debug]$ ranlib --version
GNU ranlib (GNU Binutils) 2.18.50.20080822
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later 
version.
This program has absolutely no warranty.
address@hidden debug]$ 

Do you have any suggestions in terms of how to intercept the build 
process?  Should I use something like bashdb to step through the makefile?

Here are the settings in cmake,

 BUILD_64BIT                      OFF                                          
 BUILD_ALL                        OFF                                          
 BUILD_ARCHITECT                  OFF                                          
 BUILD_CMDLINE                    ON                                           
 BUILD_COMPAT                     OFF                                          
 BUILD_DESIGN                     OFF                                          
 BUILD_DSC                        ON                                           
 BUILD_DSC_XPO                    OFF                                          
 BUILD_DSP                        OFF                                          
 BUILD_DSP_XPO                    OFF                                          
 BUILD_EASYLM_GUI                 OFF                                          
 BUILD_EVAL                       OFF                                          
 BUILD_GUITOOLS                   OFF                                          
 BUILD_NET                        OFF                                          
 BUILD_NOLM                       ON                                           
 BUILD_PTK                        ON                                           
 BUILD_PWR                        OFF                                           
 BUILD_RETIRED                    OFF                                          
 BUILD_SAMPLES                    OFF                                          
 BUILD_SOURCE                     ON                                           
 BUILD_STATIC                     OFF                                          
 BUILD_TESTS                      OFF                                          
 CMAKE_BACKWARDS_COMPATIBILITY    2.4                                          
 CMAKE_BUILD_TYPE                 Debug                                        
 SVNVERSIONCOMMAND                /usr/bin/svnversion                          

SVNVERSIONCOMMAND: Path to a program.                                           
Press [enter] to edit option                         CMake Version 2.4 - 
patch 8
Press [c] to configure
Press [h] for help         Press [q] to quit without generating
Press [t] to toggle advanced mode (Currently Off)

Thanks so much for your help!

Cheers,

Roger





reply via email to

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