Page MenuHomePhabricator

[WIP][mips] Use pc-relative relocations in .eh_frame
Needs ReviewPublic

Authored by atanasyan on May 21 2020, 11:13 AM.



Use pc-relative relocations in .eh_frame. R_MIPS_PC32 relocation is generated in 32-bit case. R_MIPS_PC32 | R_MIPS_64 relocation chain is generated in 64-bit case for all code model.

With this change object files can be linked by LLD without having to pass -Wl,-z,notext options.

Now this patch is rather "proof-of-concept". Not a commit ready changes. Any comments are welcome.

Diff Detail

Event Timeline

atanasyan created this revision.May 21 2020, 11:13 AM
Herald added a project: Restricted Project. · View Herald Transcript

I cannot select default behaviour for the LLVM in case of generating .eh_frame sections for MIPS:

  1. Unconditionally use pc-relative relocations.
  2. Use pc-relative relocations by default, but provide options for switching to absolute relocations.
  3. Use absolute relocations by default, but provide options for switching to pc-relative relocations.

I prefer the second variant. Any comments?


I'd probably also go for 2 also as the default, as long as its configurable then just a sensible default is good


FYI, I backported this and the other diff to llvm 10 and its all working nicely, now building all packages with lld without issue