This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold, strip] Question about the changed offset when stripping


Hi,

Have a little question about gold and strip, I have a linked by gold
binary with:

>readelf -S out/test_binary
 ....
  [18] .got              PROGBITS        00003f30 002f30 000024 00  WA  0   0  4
  [19] .got.plt          PROGBITS        00003f54 002f54 0000a8 00  WA  0   0  4
  [20] .bss              NOBITS          00004000 003000 000010 00  WA  0   0  8
  [21] .comment          PROGBITS        00000000 003000 000010 01  MS  0   0  1
  [22] .debug_info       PROGBITS        00000000 003010 00db90 00      0   0  1
  [23] .debug_abbrev     PROGBITS        00000000 010ba0 000b66 00      0   0  1
  [24] .debug_loc        PROGBITS        00000000 011706 000fc7 00      0   0  1
 ....

Then I strip it (with trunk strip):
>strip-new --strip-debug out/test_binary -o out/test_binary_stripped

>readelf -S out/test_binary_stripped

 ....
  [18] .got              PROGBITS        00003f30 002f30 000024 00  WA  0   0  4
  [19] .got.plt          PROGBITS        00003f54 002f54 0000a8 00  WA  0   0  4
  [20] .bss              NOBITS          00004000 002ffc 000010 00  WA  0   0  8
  [21] .comment          PROGBITS        00000000 002ffc 000010 01  MS  0   0  1
  [22] .note.gnu.gold-ve NOTE            00000000 00300c 00001c 00      0   0  4
 ....

 As you can see the offset of .bss is changed now (it is equal now to
the offset of got.plt+size of gol.plt).
Is it criminal? I don't see anything wrong with gold inserting a
padding between .got.plt and .bss, why strip do not honor it?

 I believe that it can cause troubles later on for me when I start to
debug the application.
The fact that I linked with gold could be accidental, however when I
do the same with bfd the debuging is OK for me (but the addresses of
the sections are the same there).

thanks,
Alexander


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]