[PATCH] D46319: [MC][ARM] Emit R_ARM_BASE_PREL for _GLOBAL_OFFSET_TABLE_ expressions

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 12 23:25:43 PDT 2020


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

This patch still applies. This is similar to D47507 <https://reviews.llvm.org/D47507> (x86).

> The R_ARM_BASE_PREL is therefore slightly more robust to linker's that may not follow the convention of placement of the _GLOBAL_OFFSET_TABLE_; for example LLD for some time defined _GLOBAL_OFFSET_TABLE_ to 0.

Agree that this is slightly more robust. We may not need to worry much about the cases when `_GLOBAL_OFFSET_TABLE_` is missing in the symbol table, because glibc crti.o (`sysdeps/arm/crti.S`) references it:

  .word _GLOBAL_OFFSET_TABLE_-(.LPIC+8)


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

https://reviews.llvm.org/D46319





More information about the llvm-commits mailing list