PR 25562: New binutils testsuite failures

Jozef Lawrynowicz jozef.l@mittosystems.com
Mon Mar 30 12:36:50 GMT 2020


On Mon, 30 Mar 2020 13:26:53 +0100
Nick Clifton <nickc@redhat.com> wrote:

> Hi Jozef,
> 
> > The test is working as expected, for those targets an objcopy of an executable
> > is not creating an exact copy of the original file.  
> 
> Ah, OK.
> 
> > For the PE targets the datestamp in the executable file is not being copied by
> > objcopy.  
> 
> The old determinism problem.  *sigh*  We should probably just xfail these
> targets since we know that the binaries can never be the same.

I should clarify, the datestamp is actually just being reset completely to
the epoch, rather than being set to the time of the objcopy.

> 
> > For the MIPS targets, objcopy has added the names of output sections to the
> > string table, where in the linked executable they were not in the string table.  
> 
> Where were the names stored then, if not in the string table ?  Or did the
> objcopy actually add new section symbols ?

They're in .shstrab originally, but then the objcopy adds them to .strtab as
well. Here's the readelf output (bintest is the original file):

$ ../readelf -p .strtab -p .shstrtab bintest

String dump of section '.strtab':
  [     1]  tmpdir/bintest.o
  [    12]  a
  [    14]  c
  [    16]  _start


String dump of section '.shstrtab':
  [     1]  .symtab
  [     9]  .strtab
  [    11]  .shstrtab
  [    1b]  .data
  [    21]  .text
  [    27]  .MIPS.abiflags
  [    36]  .bss
  [    3b]  .reginfo
  [    44]  .gnu.attributes

$ ../readelf -p .strtab -p .shstrtab copy

String dump of section '.strtab':
  [     1]  .data
  [     7]  .text
  [     d]  .MIPS.abiflags
  [    1c]  .bss
  [    21]  .reginfo
  [    2a]  .gnu.attributes
  [    3a]  tmpdir/bintest.o
  [    4b]  c
  [    4d]  _start


String dump of section '.shstrtab':
  [     1]  .symtab
  [     9]  .strtab
  [    11]  .shstrtab
  [    1b]  .data
  [    21]  .text
  [    27]  .MIPS.abiflags
  [    36]  .bss
  [    3b]  .reginfo
  [    44]  .gnu.attributes

This means that in the copied executable you can see the names of the SECTION
type symbols in .symtab:

$ ../readelf -s bintest

Symbol table '.symtab' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 SECTION LOCAL  DEFAULT    1 
     2: 00001204     0 SECTION LOCAL  DEFAULT    2 
     3: 00001208     0 SECTION LOCAL  DEFAULT    3 
     4: 00000201     0 SECTION LOCAL  DEFAULT    4 
     5: 00000000     0 SECTION LOCAL  DEFAULT    5 
     6: 00000000     0 SECTION LOCAL  DEFAULT    6 
............. snip ........

$ ../readelf -s copy

Symbol table '.symtab' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 SECTION LOCAL  DEFAULT    1 .data
     2: 00001204     0 SECTION LOCAL  DEFAULT    2 .text
     3: 00001208     0 SECTION LOCAL  DEFAULT    3 .MIPS.abiflags
     4: 00000201     0 SECTION LOCAL  DEFAULT    4 .bss
     5: 00000000     0 SECTION LOCAL  DEFAULT    5 .reginfo
     6: 00000000     0 SECTION LOCAL  DEFAULT    6 .gnu.attributes
............... snip ............


> 
> This does sound like something that the MIPS maintainers ought to investigate
> and decide whether it is a real bug or not.
> 
> > I can file bugzillas for these if you would like.  
> 
> No, that should not be necessary.  I will check in an update for the PE targets
> once I have tested it locally.

Ok sounds good, thanks.
Jozef

> 
> Cheers
>   Nick
> 
> 




More information about the Binutils mailing list