[gold patch 1/3] Support for incremental linking: write incremental inputs, symtab, relocs

Cary Coutant ccoutant@google.com
Thu Aug 12 04:00:00 GMT 2010


>> +      // Get the addend.
>> +      typename elfcpp::Elf_types<size>::Elf_Swxword addend;
>> +      if (sh_type == elfcpp::SHT_RELA)
>> +     addend =
>> +         Reloc_types<sh_type, size, big_endian>::get_reloc_addend(&reloc);
>> +      else
>> +        {
>> +          // FIXME: Get the addend for SHT_REL.
>> +          addend = 0;
>> +        }
>
> Why does the value of the addend matter for a SHT_REL section?

Because the original addend will have been overwritten by the result
of the relocation during the previous link. Hmmm, maybe it could be
recovered because we know the original value of the symbol. I'll have
to think about that -- I think that would require more target-specific
knowledge than it would take to just fetch the original addend here.

-cary



More information about the Binutils mailing list