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

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 4 11:35:23 PDT 2021


mcgrathr added a comment.

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

> Thanks for the updates.
>
> One idea that might work better for the linker script fragment is to use a new keyword. For example instead of using --overwrite-section-script and SECTIONS. Use a new keyword like OVERWRITE_SECTIONS this could essentially be mixed in with any other linker script without needing --overwrite-section-script.

I think that's an excellent idea.  The new command really has different semantics from the old one, so making it a different keyword feels right.
It also makes it much simpler to have clear rules about what linker constructs are allowed in what kinds of contexts.  Another syntax that would have equivalent properties from the user's point of view would be a trailing OVERWRITE keyword.  That frankly seems less clear than OVERWRITE_SECTIONS, but it's more consistent with the existing `SECTIONS { ... } INSERT ...` syntax.


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