[PATCH] PR gold/18609
Andrew Senkevich
andrew.n.senkevich@gmail.com
Mon Jul 20 15:25:00 GMT 2015
>> diff --git a/gold/x86_64.cc b/gold/x86_64.cc
>> index 007af1d..8f53bfc 100644
>> --- a/gold/x86_64.cc
>> +++ b/gold/x86_64.cc
>> @@ -2480,23 +2480,6 @@ Target_x86_64<size>::Scan::local(Symbol_table* symtab,
>> // The symbol requires a GOT section.
>> Output_data_got<64, false>* got = target->got_section(symtab, layout);
>>
>> - // If the relocation symbol isn't IFUNC,
>> - // and is local, then we will convert
>> - // mov foo@GOTPCREL(%rip), %reg
>> - // to lea foo(%rip), %reg.
>> - // in Relocate::relocate.
>> - if (r_type == elfcpp::R_X86_64_GOTPCREL
>> - && reloc.get_r_offset() >= 2
>> - && !is_ifunc)
>> - {
>> - section_size_type stype;
>> - const unsigned char* view = object->section_contents(data_shndx,
>> - &stype, true);
>> - if (view[reloc.get_r_offset() - 2] == 0x8b)
>> - break;
>> - }
>> -
>> -
>> // The symbol requires a GOT entry.
>> unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
>>
>> @@ -2906,21 +2889,6 @@ Target_x86_64<size>::Scan::global(Symbol_table* symtab,
>> // The symbol requires a GOT entry.
>> Output_data_got<64, false>* got = target->got_section(symtab, layout);
>>
>> - // If we convert this from
>> - // mov foo@GOTPCREL(%rip), %reg
>> - // to lea foo(%rip), %reg.
>> - // in Relocate::relocate, then there is nothing to do here.
>> - if (r_type == elfcpp::R_X86_64_GOTPCREL
>> - && reloc.get_r_offset() >= 2
>> - && Target_x86_64<size>::can_convert_mov_to_lea(gsym))
>> - {
>> - section_size_type stype;
>> - const unsigned char* view = object->section_contents(data_shndx,
>> - &stype, true);
>> - if (view[reloc.get_r_offset() - 2] == 0x8b)
>> - break;
>> - }
>> -
>
> If you remove those changes, won't it generate an unused GOT slot
> when GOTPCREL relocation is converted to PC-relative relocation?
Yes, it can generate unused GOT slots.
--
WBR,
Andrew
More information about the Binutils
mailing list