[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 15:07:22 PDT 2016


looking

On 19 May 2016 at 06:54, George Rimar <grimar at accesssoftek.com> wrote:
> grimar added inline comments.
>
> ================
> Comment at: ELF/Target.cpp:513
> @@ +512,3 @@
> +    return false;
> +  return (S.getName() != "_DYNAMIC");
> +}
> ----------------
> rafael wrote:
>> Why is _DYNAMIC special?
>>
>> The other checks are not architecture specific and should be in architecture independent code.
> That is something directly mentioned in docs I think, but initially in binutils there also were no exception for _DYNAMIC,
> and they had to do that finally because it turns out ld.so uses it:
> https://sourceware.org/ml/binutils/2012-09/msg00000.html
>
> ================
> Comment at: ELF/Target.cpp:537
> @@ -525,1 +536,3 @@
> +  case R_X86_64_REX_GOTPCRELX:
> +    return canRelaxGotPCRel(S) ? R_X86_REX_RELAX_GOT_PC : R_GOT_PC;
>    case R_X86_64_GOTPCREL:
> ----------------
> rafael wrote:
>> I would probably have this return R_GOT_PC and then have a generic logic for "can we optimize this got use". This would be somewhat similar to the fact that we optimize plt acesses to local symbols.
> Done, reimplemented in more generic way.
>
>
> http://reviews.llvm.org/D15779
>
>
>


More information about the llvm-commits mailing list