[PATCH] D81359: [ELF] Add --[no-]relax for RISC-V

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 09:13:37 PDT 2020


MaskRay added a comment.

In D81359#2092282 <https://reviews.llvm.org/D81359#2092282>, @grimar wrote:

> My main objection against this is that it introduces a `config->relax` which is not used and hence not needed.
>  I feel really uncomfortable to accept such way to do things as all last years of develepment we tried to avoid adding an unnecessary code to LLD and
>  I find it to be a very reasonable approach, I remember how I tried to do this, was stopped on reviews and as a result it actually helped to avoid a dead/unneded code few times.
>
> GNU man says (https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html):
>  //An option with machine dependent effects. This option is only supported on a few targets. See section ld and the H8 <https://reviews.llvm.org/H8>/300. See section ld and the Intel 960 family.
>  On some platforms, the `--relax' option performs global optimizations that become possible when the linker resolves addressing in the program, such as relaxing
>  address modes and synthesizing new instructions in the output object file. **On platforms where this is not supported, `--relax' is accepted, but ignored.**//
>
> I'd be OK just to add it to the "Options listed below are silently ignored for now for compatibility." list to ignore it (+ to docs/ld.lld.1),
>  as currently no platforms are supporting it in LLD.


My argument is whether we can go back to my first revision (https://reviews.llvm.org/D81359?id=269101) which did something potentially useful for x86-64. I have provided one use case: it can help compare --no-relax and --relax output. Then, there is no concern that `config->relax` is added for no use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81359





More information about the llvm-commits mailing list