[PATCH] D103303: [ELF] Add --overwrite-section-script

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 12:11:41 PDT 2021


MaskRay added a comment.

In D103303#2796607 <https://reviews.llvm.org/D103303#2796607>, @peter.smith wrote:

> Sorry for the delay in responding. I'm in favour of adding this as it should combine well with LLD when no default linker script is used.
>
> I'm thinking overwrite-section-script may be a better name than --overwrite-script. It would reinforce the narrow nature of the script, to overwrite specific SECTIONS commands, and also help people not seeing it as overwriting their whole linker script.

Much appreciate your review. I agree that --overwrite-section-script is better.

> With respect to Roland's comment in https://sourceware.org/bugzilla/show_bug.cgi?id=26404#c10 one way of having this work by adding another script fragment would be to add a keyword at the top of the linker script for example:
>
>   /* This linker script fragment is an overwrite script */
>   OVERWRITE_SCRIPT()

This would add some complexity to `readLinkerScript` as we will need to check the first token. Do we really need it?
This is just a matter between `$file` and `-Wl,--overwrite-script=$file` in the build system.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103303



More information about the llvm-commits mailing list