[PATCH] D43161: Rename DynamicReloc::getAddend() to getRelaAddend(). NFC

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 08:02:09 PST 2018


Alexander Richardson via Phabricator <reviews at reviews.llvm.org> writes:

> Index: ELF/SyntheticSections.h
> ===================================================================
> --- ELF/SyntheticSections.h
> +++ ELF/SyntheticSections.h
> @@ -316,16 +316,25 @@
>          UseSymVA(UseSymVA), Addend(Addend) {}
>  
>    uint64_t getOffset() const;
> -  int64_t getAddend() const;
>    uint32_t getSymIndex() const;
>    const InputSectionBase *getInputSec() const { return InputSec; }
>  
> +  // Return the value that should be written to the Elf_Rela r_addend field.

This is the same addend value that should be used with Elf_Rel, so the
description and name are a bit confusing too.

I would suggest keeping the current name or calling it computeAddend and
add a comment on the lines of:

-------------------------------------------------------------------------
Computes the addend of the dynamic relocation. Note that this is not the
same as the Addend member variable as it also includes the symbol
address if UseSymVA is true.
-------------------------------------------------------------------------

Cheers,
Rafael


More information about the llvm-commits mailing list