[Bug go/81926] go/parse.o differs between stage2 and stage3 for gcc 7.2.0

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 22 23:46:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81926

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> the ELF section header table seems
>  to be in a slightly different place between the two files :
> 
> d$ elfdump -delv stage2-gcc/go/parse.o
> 
> ELF Header
>   ei_magic:   { 0x7f, E, L, F }
>   ei_class:   ELFCLASS64          ei_data:       ELFDATA2MSB
>   ei_osabi:   ELFOSABI_NONE       ei_abiversion: 0
>   e_machine:  EM_SPARCV9          e_version:     EV_CURRENT
>   e_type:     ET_REL
>   e_flags:    [ EF_SPARCV9_TSO ]
>   e_entry:                     0  e_ehsize:     64  e_shstrndx:  1
>   e_shoff:              0x3b7cd8  e_shentsize:  64  e_shnum:     86
>   e_phoff:                     0  e_phentsize:   0  e_phnum:     0
> 
> d$ elfdump -delv stage3-gcc/go/parse.o
> 
> ELF Header
>   ei_magic:   { 0x7f, E, L, F }
>   ei_class:   ELFCLASS64          ei_data:       ELFDATA2MSB
>   ei_osabi:   ELFOSABI_NONE       ei_abiversion: 0
>   e_machine:  EM_SPARCV9          e_version:     EV_CURRENT
>   e_type:     ET_REL
>   e_flags:    [ EF_SPARCV9_TSO ]
>   e_entry:                     0  e_ehsize:     64  e_shstrndx:  1
>   e_shoff:              0x3b7cd0  e_shentsize:  64  e_shnum:     86
>   e_phoff:                     0  e_phentsize:   0  e_phnum:     0
> d$
> 
> So there I see 0x3b7cd8 in stage2 and 0x3b7cd0 in stage3. 

Sure, but we need to find where this difference comes from, i.e. which section
of the executable has a different size.  elfdump can probably dump this info.

> At first glance there appears to be only an 8 byte difference in the
> size of the file but looking down through the various sections in the
> ELF data for both files I see the same data represented in very similar
> places but yet, slightly different.  For example the ELF header offset
> is 0x3b7cd0 in one of them and 0x3b7cd8 in the other.  Is this a valid
> functional difference at all?

Maybe not, but the comparison process is very strict.  In any case, 2 identical
compilers should produce identical object files (modulo timestamp).


More information about the Gcc-bugs mailing list