[PATCH] D34459: [ELF] Better handling of _GLOBAL_OFFSET_TABLE_

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 04:05:44 PDT 2017


evgeny777 added a comment.

> Does it help to set visibility to hidden?

As you may noticed addOptionalRegular sets visibility to hidden by default. In my experiments I tried creating _GLOBAL_OFFSET_TABLE_ in a following way:

  addOptionalRegular("_GLOBAL_OFFSET_TABLE_", InX::Got, 0, STV_HIDDEN, STB_LOCAL);

What troubles me with this approach is that the following can't be linked (ld/gold work fine):

  ldr r0, =_GLOBAL_OFFSET_TABLE_

And one of lld test cases also fails.


https://reviews.llvm.org/D34459





More information about the llvm-commits mailing list