aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-gc/gc.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2008-01-11 09:11:18 +0000
committerTristan Gingold <gingold@adacore.com>2008-01-11 09:11:18 +0000
commitac69cbc672a0702152d34bac2da436dcee2e5346 (patch)
tree6ffc8a7b8272f96af39210413806e543b28c186b /ld/testsuite/ld-gc/gc.c
parent7dda2462a7035e0c9cc9706abfda31861c551b14 (diff)
downloadgdb-ac69cbc672a0702152d34bac2da436dcee2e5346.zip
gdb-ac69cbc672a0702152d34bac2da436dcee2e5346.tar.gz
gdb-ac69cbc672a0702152d34bac2da436dcee2e5346.tar.bz2
ld:
2008-01-11 Tristan Gingold <gingold@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * ldlang.c (lang_end): Warns if the entry point is not found when --gc-sections. Emit an error if no root is specified when --gc-sections -r. * ld.texinfo (Options): Document that --gc-sections is compatible with -r and -q. * ldmain.c (main): Do not error out if -r and --gc-sections. * scripttempl/elf.sc: Emit ENTRY command only if relocating. ld/testsuite: 2008-01-11 Tristan Gingold <gingold@adacore.com> * lib/ld-lib.exp (check_gc_sections_available): Now available on VxWorks. * ld-gc: New directory for testing --gc-sections. * ld-gc/gc.c: New file. * ld-gc/gc.exp: New file. * ld-gc/noent.s: New file. * ld-gc/noent.d: New file.
Diffstat (limited to 'ld/testsuite/ld-gc/gc.c')
-rw-r--r--ld/testsuite/ld-gc/gc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ld/testsuite/ld-gc/gc.c b/ld/testsuite/ld-gc/gc.c
new file mode 100644
index 0000000..c662f72
--- /dev/null
+++ b/ld/testsuite/ld-gc/gc.c
@@ -0,0 +1,20 @@
+int unused_var = 7;
+int used_var = 7;
+
+int
+unused_func (int v)
+{
+ return 3 * unused_var;
+}
+
+int
+used_func (int v)
+{
+ return 2 * used_var;
+}
+
+int
+main (void)
+{
+ return used_func (5);
+}