* .hash section oddity
@ 2007-09-05 23:24 Smith, Stephen (SwCOE)
2007-09-06 0:43 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Smith, Stephen (SwCOE) @ 2007-09-05 23:24 UTC (permalink / raw)
To: binutils
I have a situation when a component is compiled on several different host platforms the binary is different when it is not expected.
In all cases the host is a Cygwin box (with the same Cygwin versions and the cross compiler is for powerpc-motorol-elf or i686-pc-elf plaforms). The binutils package is version 2.17 (we upgraded from 2.10 to 2.17 so that we could create debug link files). In this case the executable (libansi.so) points at libansi.so.dbg which is what has the symbolic debugging information.
With that as the background I took one of the builds, disassembled (using the -D switch) one of the binaries in question, and diff'ed it and got:
$ diff -u ppc-libansi-300.txt ppc-libansi-3873.txt
--- ppc-libansi-300.txt 2007-09-05 10:45:48.871022500 -0700
+++ ppc-libansi-3873.txt 2007-09-05 10:44:53.152272500 -0700
@@ -1,5 +1,5 @@
-../../ansi-3_0_0/ppc/appbin/dbg/libansi.so: file format elf32-powerpc
+ppc/appbin/dbg/libansi.so: file format elf32-powerpc
Disassembly of section .hash:
@@ -13354,4 +13354,4 @@
4: 6e 73 69 2e xoris r19,r19,26926
8: 73 6f 2e 64 andi. r15,r27,11876
c: 62 67 00 6e ori r7,r19,110
- 10: 2a af b8 77 cmpldi cr5,r15,47223
+ 10: 13 10 72 26 vmsumuhm v24,v16,v14,v8
This told me that a DWORD is different and that the variable is aligned on a DWORD boundary.
Next I used the "od -a" command on both binaries, compared the output and found:
--- ppc-libansi-300-od.txt 2007-09-05 10:56:13.699147500 -0700
+++ ppc-libansi-3873-od.txt 2007-09-05 10:56:55.949147500 -0700
@@ -3230,11 +3230,11 @@
0145200 l ) nul nul G C C : sp ( G N U ) sp 2
0145220 . 9 5 . 2 - 6 sp 1 9 9 9 1 0 2 4
0145240 sp ( c y g w i n sp e x p e r i m
0145260 e n t a l ) nul nul G N U sp C sp d c
0145300 r t n . S nul l i b a n s i . s o
-0145320 . d b g nul n * / 8 w nul . s y m t
+0145320 . d b g nul n dc3 dle r & nul . s y m t
0145340 a b nul . s t r t a b nul . s h s t
0145360 r t a b nul . h a s h nul . d y n s
0145400 y m nul . d y n s t r nul . r e l a
0145420 . d y n nul . r e l a . p l t nul .
0145440 i n i t nul . t e x t nul . f i n i
What is interesting is that the difference is following the debug link name libansi.so.dbg.
What is at the point in the file where the two binaries differ? Why don't I see similar results in other binaries we build?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: .hash section oddity
2007-09-05 23:24 .hash section oddity Smith, Stephen (SwCOE)
@ 2007-09-06 0:43 ` Alan Modra
2007-09-06 16:10 ` Smith, Stephen (SWCOE)
0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2007-09-06 0:43 UTC (permalink / raw)
To: Smith, Stephen (SwCOE); +Cc: binutils
On Wed, Sep 05, 2007 at 04:23:48PM -0700, Smith, Stephen (SwCOE) wrote:
> $ diff -u ppc-libansi-300.txt ppc-libansi-3873.txt
> --- ppc-libansi-300.txt 2007-09-05 10:45:48.871022500 -0700
> +++ ppc-libansi-3873.txt 2007-09-05 10:44:53.152272500 -0700
> @@ -1,5 +1,5 @@
>
> -../../ansi-3_0_0/ppc/appbin/dbg/libansi.so: file format elf32-powerpc
> +ppc/appbin/dbg/libansi.so: file format elf32-powerpc
>
> Disassembly of section .hash:
>
> @@ -13354,4 +13354,4 @@
> 4: 6e 73 69 2e xoris r19,r19,26926
> 8: 73 6f 2e 64 andi. r15,r27,11876
> c: 62 67 00 6e ori r7,r19,110
> - 10: 2a af b8 77 cmpldi cr5,r15,47223
> + 10: 13 10 72 26 vmsumuhm v24,v16,v14,v8
>
> This told me that a DWORD is different and that the variable is aligned on a DWORD boundary.
This difference isn't in the .hash section.
> What is at the point in the file where the two binaries differ?
You tell us. :-) Look in ppc-libansi-300.txt at around line 13350
for the section name.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: .hash section oddity
2007-09-06 0:43 ` Alan Modra
@ 2007-09-06 16:10 ` Smith, Stephen (SWCOE)
2007-09-06 23:41 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Smith, Stephen (SWCOE) @ 2007-09-06 16:10 UTC (permalink / raw)
To: Alan Modra; +Cc: binutils
Thanks - It is in the debuglink section.
-----Original Message-----
From: Alan Modra [mailto:amodra@bigpond.net.au]
Sent: Wednesday, September 05, 2007 5:44 PM
To: Smith, Stephen (SWCOE)
Cc: binutils@sources.redhat.com
Subject: Re: .hash section oddity
On Wed, Sep 05, 2007 at 04:23:48PM -0700, Smith, Stephen (SwCOE) wrote:
> $ diff -u ppc-libansi-300.txt ppc-libansi-3873.txt
> --- ppc-libansi-300.txt 2007-09-05 10:45:48.871022500 -0700
> +++ ppc-libansi-3873.txt 2007-09-05 10:44:53.152272500 -0700
> @@ -1,5 +1,5 @@
>
> -../../ansi-3_0_0/ppc/appbin/dbg/libansi.so: file format
elf32-powerpc
> +ppc/appbin/dbg/libansi.so: file format elf32-powerpc
>
> Disassembly of section .hash:
>
> @@ -13354,4 +13354,4 @@
> 4: 6e 73 69 2e xoris r19,r19,26926
> 8: 73 6f 2e 64 andi. r15,r27,11876
> c: 62 67 00 6e ori r7,r19,110
> - 10: 2a af b8 77 cmpldi cr5,r15,47223
> + 10: 13 10 72 26 vmsumuhm v24,v16,v14,v8
>
> This told me that a DWORD is different and that the variable is
aligned on a DWORD boundary.
This difference isn't in the .hash section.
> What is at the point in the file where the two binaries differ?
You tell us. :-) Look in ppc-libansi-300.txt at around line 13350
for the section name.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: .hash section oddity
2007-09-06 16:10 ` Smith, Stephen (SWCOE)
@ 2007-09-06 23:41 ` Alan Modra
0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2007-09-06 23:41 UTC (permalink / raw)
To: Smith, Stephen (SWCOE); +Cc: binutils
On Thu, Sep 06, 2007 at 09:10:35AM -0700, Smith, Stephen (SWCOE) wrote:
> Thanks - It is in the debuglink section.
That's what I thought you would find. The difference is the CRC for
the debug info file, so somehow your debug info is different.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-06 23:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-05 23:24 .hash section oddity Smith, Stephen (SwCOE)
2007-09-06 0:43 ` Alan Modra
2007-09-06 16:10 ` Smith, Stephen (SWCOE)
2007-09-06 23:41 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).