[all-commits] [llvm/llvm-project] 8f2129: MIPS: Use pcrel|sdata4 for eh_frame (#91291)

YunQiang Su via All-commits all-commits at lists.llvm.org
Wed May 8 02:30:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f21294897befee48f9f72734ea1b0ad4c920aa0
      https://github.com/llvm/llvm-project/commit/8f21294897befee48f9f72734ea1b0ad4c920aa0
  Author: YunQiang Su <syq at debian.org>
  Date:   2024-05-08 (Wed, 08 May 2024)

  Changed paths:
    M lld/test/ELF/mips-eh_frame-pic.s
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/MC/MCObjectFileInfo.cpp
    M llvm/test/CodeGen/Mips/ehframe-indirect.ll
    M llvm/test/DebugInfo/Mips/eh_frame.ll
    M llvm/test/MC/Mips/eh-frame.s

  Log Message:
  -----------
  MIPS: Use pcrel|sdata4 for eh_frame (#91291)

Gas uses encoding DW_EH_PE_absptr for PIC, and gnu ld converts it to
DW_EH_PE_sdata4|DW_EH_PE_pcrel.
LLD doesn't have this workarounding, thus complains
```
  relocation R_MIPS_32 cannot be used against local symbol; recompile with -fPIC
  relocation R_MIPS_64 cannot be used against local symbol; recompile with -fPIC
```

So, let's generates asm/obj files with `DW_EH_PE_sdata4|DW_EH_PE_pcrel`
encoding. In fact, GNU ld supports such OBJs well.

For N64, maybe we should use sdata8, while GNU ld doesn't support it
well, and in fact sdata4 is enough now. So we just ignore the `Large`
for `MCObjectFileInfo::initELFMCObjectFileInfo`. Maybe we should switch
back to sdata8 once GNU LD supports it well.

Fixes: #58377.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list