[PATCH] D44780: [ELF] - Implement linker script OVERLAYs.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 03:26:30 PDT 2018


grimar added inline comments.


================
Comment at: ELF/ScriptParser.cpp:725
+OutputSection *ScriptParser::readOutputSectionDescription(StringRef OutSec,
+                                                          bool InOverlay) {
   OutputSection *Cmd =
----------------
ruiu wrote:
> We shouldn't add a new parameter to this existing function for the minor feature. Please just remove it.
Do you mean we should just accept the syntax which is documented as not
supported for overlayed sections, like AT/ALIGN/SUBALIGN and memory
regions?

I am not fond of that idea honestly, but if so, there would be one more difference in
the syntax that does not allow me simply to drop the `InOverlay`:

Overlay declaration looks like:
```
 OVERLAY 0x1000 : AT ( 0x4000 ) {
    .abc { *(.foo) } 
...

```

Regular section declaration is:
```
  abc : { *(foo) }
```

Notice that `:` follows the `abc` for regular section declaration syntax. And I have to skip it somehow.
I do not think we can use `consume(":")` in place of `expect(":")` as it would relax all of our scripts.

What we can probably do instead then is to introduce `readOverlaySectionDescription` with the minimal needed
syntax support. I did it.


https://reviews.llvm.org/D44780





More information about the llvm-commits mailing list