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

--- Comment #24 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
> --- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to r...@cebitec.uni-bielefeld.de from comment #21)
>> The linker isn't a factor here: both ld and gld 2.38 produce the same
>> result:
>> 
>> 08048890 <_Z3foov>:
>>  8048890:    65 a1 00 00 00 00       mov    %gs:0x0,%eax
>>  8048896:    05 d0 ff ff ff          add    $0xffffffd0,%eax
>>  804889b:    c3                      ret    
>
> How does foob look like when linked (from both)?

For ld:

08050f40 <_Z4foobv>:
 8050f40:       53                      push   %ebx
 8050f41:       65 8b 1d 00 00 00 00    mov    %gs:0x0,%ebx
 8050f48:       81 c3 d0 ff ff ff       add    $0xffffffd0,%ebx
 8050f4e:       5b                      pop    %ebx
 8050f4f:       c3                      ret    

Completely identical between ld and gld, except for the exact address of
_Z4foobv itself due to different segment layout:

For gld:

080488a0 <_Z4foobv>:
 80488a0:       53                      push   %ebx
 80488a1:       65 8b 1d 00 00 00 00    mov    %gs:0x0,%ebx
 80488a8:       81 c3 d0 ff ff ff       add    $0xffffffd0,%ebx
 80488ae:       5b                      pop    %ebx
 80488af:       c3                      ret

Reply via email to