[PATCH] D72228: [MIPS][ELF] Use PC-relative relocations in .eh_frame when possible

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 5 07:16:54 PST 2020


arichardson created this revision.
arichardson added reviewers: atanasyan, jrtc27, joerg.
Herald added subscribers: llvm-commits, MaskRay, hiraditya, sdardis, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

When compiling position-independent executables, we now use
DW_EH_PE_pcrel | DW_EH_PE_sdata4. However, the MIPS ABI does not define a
64-bit PC-relative ELF relocation so we cannot use sdata8 for the large
code model case. When using the large code model, we fall back to the
previous behaviour of generating absolute relocations.

With this change clang-generated .o files can be linked by LLD without
having to pass -Wl,-z,notext (which creates text relocations).
This is simpler than the approach used by ld.bfd, which rewrites the
.eh_frame section to convert absolute relocations into relative references.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72228

Files:
  lld/test/ELF/mips-eh_frame-pic.s
  llvm/lib/MC/MCObjectFileInfo.cpp
  llvm/lib/Object/RelocationResolver.cpp
  llvm/test/DebugInfo/Mips/eh_frame.ll
  llvm/test/MC/Mips/eh-frame.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72228.236247.patch
Type: text/x-patch
Size: 13804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200105/657eeac3/attachment.bin>


More information about the llvm-commits mailing list