aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-07-22 21:41:15 +0930
committerAlan Modra <amodra@gmail.com>2021-07-24 17:35:59 +0930
commit553dd76c7e49e3e6afb528ff865589da8f6f3e1c (patch)
tree1e437ebfcf9298b4e5d26a5116d83c0221859873 /ld/testsuite
parent77db4723ddda2a5eb20876e8a818f77ffa7dafc8 (diff)
downloadgdb-553dd76c7e49e3e6afb528ff865589da8f6f3e1c.zip
gdb-553dd76c7e49e3e6afb528ff865589da8f6f3e1c.tar.gz
gdb-553dd76c7e49e3e6afb528ff865589da8f6f3e1c.tar.bz2
Re: ld script expression parsing
Commit 40726f16a8d7 broke references to sections within ADDR(), and overlays with weird section names. * ldgram.y (paren_script_name): New rule. (exp): Use it for ALIGNOF, SIZEOF, ADDR, and LOADADDR. Similarly ensure script mode parsing for section name in SEGMENT_START. (overlay_section): Delete unnecessary ldlex_script call. Backup on a lookahead NAME parsed in expression mode. * testsuite/ld-elf/overlay.s: Add more sections. * testsuite/ld-elf/overlay.t: Test '-' in section names.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-elf/overlay.s4
-rw-r--r--ld/testsuite/ld-elf/overlay.t6
2 files changed, 9 insertions, 1 deletions
diff --git a/ld/testsuite/ld-elf/overlay.s b/ld/testsuite/ld-elf/overlay.s
index f153044..20d8f41 100644
--- a/ld/testsuite/ld-elf/overlay.s
+++ b/ld/testsuite/ld-elf/overlay.s
@@ -2,5 +2,9 @@
.space 0x10
.section .text2,"ax",%progbits
.space 0x20
+ .section .silly-name1,"ax",%progbits
+ .space 0x10
+ .section .silly-name2,"ax",%progbits
+ .space 0x20
.text
.space 0x30
diff --git a/ld/testsuite/ld-elf/overlay.t b/ld/testsuite/ld-elf/overlay.t
index dd374bb..2c50a6b 100644
--- a/ld/testsuite/ld-elf/overlay.t
+++ b/ld/testsuite/ld-elf/overlay.t
@@ -6,6 +6,10 @@ SECTIONS
{
.text1 {*(.text1)}
.text2 {*(.text2)}
- }
+ .silly-name1 { *(.silly-name1) }
+ .silly-name2 { *(.silly-name2) }
+ }
/DISCARD/ : { *(.*) }
+ ASSERT(ADDR(.text1)==ADDR(.text2), "overlay error")
+ ASSERT(ADDR(.silly-name1)==ADDR(.silly-name2), "silly overlay error")
}