diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-06-13 08:18:19 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-06-13 08:22:10 -0700 |
commit | dc74becf498f60c842d81eb6e98cfcbc3f167c22 (patch) | |
tree | 693897b270ad36e069cd96ca87546abfd61a1f87 | |
parent | 8569cfa78c2cc8b5ef66b0bebddcc0e63231fb51 (diff) | |
download | gdb-dc74becf498f60c842d81eb6e98cfcbc3f167c22.zip gdb-dc74becf498f60c842d81eb6e98cfcbc3f167c22.tar.gz gdb-dc74becf498f60c842d81eb6e98cfcbc3f167c22.tar.bz2 |
ld: Add tests for -Ur
Test -Ur with __start_SECNAME, __stop_SECNAME, .startof.SECNAME and
.sizeof.SECNAME. __start_SECNAME and __stop_SECNAME should be defined
to the start and the end of section SECNAME. .startof.SECNAME and
.sizeof.SECNAME should be undefined.
* testsuite/ld-elf/sizeof.d: New file.
* testsuite/ld-elf/sizeof.s: Likewise.
* testsuite/ld-elf/startof.d: Likewise.
* testsuite/ld-elf/startof.s: Likewise.
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/sizeof.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/sizeof.s | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/startof.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/startof.s | 11 |
5 files changed, 51 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 1c81211..309bb3a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2017-06-13 H.J. Lu <hongjiu.lu@intel.com> + + * testsuite/ld-elf/sizeof.d: New file. + * testsuite/ld-elf/sizeof.s: Likewise. + * testsuite/ld-elf/startof.d: Likewise. + * testsuite/ld-elf/startof.s: Likewise. + 2017-06-13 Renlin Li <renlin.li@arm.com> * testsuite/ld-elf/shared.exp (build_tests): Add --no-dynamic-linker diff --git a/ld/testsuite/ld-elf/sizeof.d b/ld/testsuite/ld-elf/sizeof.d new file mode 100644 index 0000000..7cad75a --- /dev/null +++ b/ld/testsuite/ld-elf/sizeof.d @@ -0,0 +1,11 @@ +#ld: -Ur +#readelf: -sW + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +__stop_scnfoo +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +.sizeof.scnfoo +#pass diff --git a/ld/testsuite/ld-elf/sizeof.s b/ld/testsuite/ld-elf/sizeof.s new file mode 100644 index 0000000..016ac60 --- /dev/null +++ b/ld/testsuite/ld-elf/sizeof.s @@ -0,0 +1,11 @@ + .section scnfoo,"aw",%progbits + .zero 0x10 + + .globl bar + .data + .align 8 + .type bar, %object + .size bar, 8 +bar: + .dc.a __stop_scnfoo + .dc.a .sizeof. (scnfoo) diff --git a/ld/testsuite/ld-elf/startof.d b/ld/testsuite/ld-elf/startof.d new file mode 100644 index 0000000..cf1f064 --- /dev/null +++ b/ld/testsuite/ld-elf/startof.d @@ -0,0 +1,11 @@ +#ld: -Ur +#readelf: -sW + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +.startof.scnfoo +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +__start_scnfoo +#pass diff --git a/ld/testsuite/ld-elf/startof.s b/ld/testsuite/ld-elf/startof.s new file mode 100644 index 0000000..982f347 --- /dev/null +++ b/ld/testsuite/ld-elf/startof.s @@ -0,0 +1,11 @@ + .section scnfoo,"aw",%progbits + .zero 0x10 + + .globl bar + .data + .align 8 + .type bar, %object + .size bar, 8 +bar: + .dc.a __start_scnfoo + .dc.a .startof. (scnfoo) |