[PATCH] D149751: [LLD][ELF][RISCV] Add auipc->lui relaxation.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 10:14:32 PDT 2023


MaskRay requested changes to this revision.
MaskRay added a comment.
This revision now requires changes to proceed.

> This relaxation enables use of weak undefined symbols in programms written with medany code model in mind if code section happens to be placed far from zero address(>2GiB).

I think the motivation is not right. For such weak references, the compiler should generate GOT-generating relocations, not relying on linker relaxation (which is an optional feature) for correctness.

https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/201 "Not doing so is deprecated and a future version of this specification will require using the GOT, not just advise."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149751/new/

https://reviews.llvm.org/D149751



More information about the llvm-commits mailing list