mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
4ffb22ec40
It turns out we do need to backtrack when parsing after all. The fill_opt component in the section rule swiches to EXPRESSION and back to SCRIPT, and to find the end of an expression it is necessary to look ahead one token. * ldgram.y (section): Throw away lookahead NAME token. (overlay_section): Likewise. * testsuite/ld-elf/overlay.t: Add fill pattern on overlays. Test fill pattern before stupidly named normal sections too, and before /DISCARD/.
18 lines
461 B
Raku
18 lines
461 B
Raku
SECTIONS
|
|
{
|
|
. = SIZEOF_HEADERS;
|
|
.text : { *(.text) }
|
|
OVERLAY 0x1000 : AT (0x4000)
|
|
{
|
|
.text1 {*(.text1)}
|
|
.text2 {*(.text2)}
|
|
.silly-name1 { *(.silly-name1) } = 0
|
|
.silly-name2 { *(.silly-name2) } = 0
|
|
} = 0
|
|
.silly-name3 : { *(.silly-name3) } = 0
|
|
.silly-name4 : { *(.silly-name4) } = 0
|
|
/DISCARD/ : { *(.*) }
|
|
ASSERT(ADDR(.text1)==ADDR(.text2), "overlay error")
|
|
ASSERT(ADDR(.silly-name1)==ADDR(.silly-name2), "silly overlay error")
|
|
}
|