From b27685f2016c510d03ac9a64f7b04ce8efcf95c4 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 13 Jun 2017 13:04:56 -0700 Subject: ld: Don't define __start_SECNAME/__stop_SECNAME for -r __start_SECNAME and __stop_SECNAME shouldn't be defined for "ld -r". * ldlang.c (lang_set_startof): Skip if config.build_constructors is FALSE. * testsuite/ld-elf/sizeofc.d: New file. * testsuite/ld-elf/startofc.d: Likewise. --- ld/testsuite/ld-elf/sizeofc.d | 12 ++++++++++++ ld/testsuite/ld-elf/startofc.d | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ld/testsuite/ld-elf/sizeofc.d create mode 100644 ld/testsuite/ld-elf/startofc.d (limited to 'ld/testsuite') diff --git a/ld/testsuite/ld-elf/sizeofc.d b/ld/testsuite/ld-elf/sizeofc.d new file mode 100644 index 0000000..1cff854 --- /dev/null +++ b/ld/testsuite/ld-elf/sizeofc.d @@ -0,0 +1,12 @@ +#source: sizeof.s +#ld: -r +#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 +__stop_scnfoo +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +.sizeof.scnfoo +#pass diff --git a/ld/testsuite/ld-elf/startofc.d b/ld/testsuite/ld-elf/startofc.d new file mode 100644 index 0000000..4005625 --- /dev/null +++ b/ld/testsuite/ld-elf/startofc.d @@ -0,0 +1,12 @@ +#source: startof.s +#ld: -r +#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 +UND +__start_scnfoo +#pass -- cgit v1.1