This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
.hash section oddity
- From: "Smith, Stephen \(SwCOE\)" <stephen dot smith at honeywell dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Wed, 5 Sep 2007 16:23:48 -0700
- Subject: .hash section oddity
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?