[PATCH] D65651: [ELF] Move R_*_IRELATIVE from .rel[a].plt to .rel[a].dyn unless --pack-dyn-relocs=android[+relr]

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 10:08:13 PDT 2019


MaskRay added a comment.

> Have you checked whether we can reasonably expect this to be universal or does this need to be done on a per-architecture basis?

On non-Android, it is universal to place R_*_IRELATIVE in .rel[a].dyn :) __glibc_unlikely suggests it is not a good idea to have R_*_IRELATIVE in .rel[a].plt:

  sysdeps/aarch64/dl-machine.h
  444:  else if (__glibc_unlikely (r_type == AARCH64_R(IRELATIVE)))
  
  sysdeps/x86_64/dl-machine.h
  574:  else if (__glibc_unlikely (r_type == R_X86_64_IRELATIVE))

On Android (--pack-dyn-relocs=android[+relr]), because there is already one ".rela.dyn" used for the packed format. We cannot create another ".rela.dyn". So I mentioned in the description this should be improved. Either synthetic section should be renamed to not have an output section with mixed formats.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65651/new/

https://reviews.llvm.org/D65651





More information about the llvm-commits mailing list