[PATCH] D38625: [ELF] - Ignore non-absolute R_386_GOTPC relocation in debug sections.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 13:52:09 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/InputSection.cpp:669-673
+      // At the moment of 20 october 2017, gcc has a bug which creates
+      // R_386_GOTPC relocation against _GLOBAL_OFFSET_TABLE_ in .debug_info.
+      // We ignore such relocation. All gcc versions seem to be affected.
+      // TODO: remove this hack once issue is fixed and we stop supporting
+      //       gcc versions affected.
----------------
// GCC 8.0 or earlier have a bug that it emits R_386_GOTPC relocations against _GLOBAL_OFFSET_TABLE for .debug_info. The bug seems to have been fixed in 2017 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82630), but we need to keep this bug-compatible code for a while.

Also, you should be more explicit on what you are doing. Specifically, you should avoid calling getRelExpr.


https://reviews.llvm.org/D38625





More information about the llvm-commits mailing list