[PATCH] D48929: [ELF] Update addends in non-allocatable sections for REL targets when creating a relocatable output.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 05:12:03 PDT 2018


grimar added inline comments.


================
Comment at: ELF/InputSection.cpp:732
 void InputSectionBase::relocate(uint8_t *Buf, uint8_t *BufEnd) {
   if (Flags & SHF_ALLOC) {
     relocateAlloc(Buf, BufEnd);
----------------
ikudrin wrote:
> grimar wrote:
> > Should instead of all other changes in this patch this line just be a 
> > 
> > `(Flags & SHF_ALLOC || Config->Relocatable)` ?
> > 
> > With the corresponding renaming/commenting of things may be.
> > 
> > We have `relocateAlloc`/`relocateNonAlloc` splitted mostly for speedup of
> > processing debug relocations I think. 
> > 
> > I do not feel it is very critical for -r. It seems better to reuse the existent
> > code than to add new.
> > 
> > Rui, what do you think?
> Yes, that's possible, and, actually, the first variant of the fix was made this way. I switched to the current version because I found it more straightforward.
> 
> > With the corresponding renaming/commenting of things may be.
> 
> What renaming are you suggesting?
Maybe something like `relocateAlloc`->`relocateAll`? 


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D48929





More information about the llvm-commits mailing list