summaryrefslogtreecommitdiffstats
path: root/lld/test
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2015-12-10 09:12:18 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2015-12-10 09:12:18 +0000
commita5fbebc2065d12a403f82380cbe0c3a571cfccbe (patch)
treec63f3cf75900c832b63c8e8ce07fd112b09bf121 /lld/test
parente451eeff5c7e070764584aba20ffdd8919b4b4cd (diff)
downloadbcm5719-llvm-a5fbebc2065d12a403f82380cbe0c3a571cfccbe.tar.gz
bcm5719-llvm-a5fbebc2065d12a403f82380cbe0c3a571cfccbe.zip
[ELF] - Implemented --print-gc-sections command line argument.
List all sections removed by garbage collection. This option is only effective if garbage collection has been enabled via the `--gc-sections' option. Differential revision: http://reviews.llvm.org/D15327 llvm-svn: 255235
Diffstat (limited to 'lld/test')
-rw-r--r--lld/test/ELF/gc-sections-print.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/lld/test/ELF/gc-sections-print.s b/lld/test/ELF/gc-sections-print.s
new file mode 100644
index 00000000000..59177a65367
--- /dev/null
+++ b/lld/test/ELF/gc-sections-print.s
@@ -0,0 +1,23 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: ld.lld %t --gc-sections --print-gc-sections -o %t2 2>&1 | FileCheck -check-prefix=PRINT %s
+
+# PRINT: removing unused section from '.text.x' in file
+# PRINT-NEXT: removing unused section from '.text.y' in file
+
+.globl _start
+.protected a, x, y
+_start:
+ call a
+
+.section .text.a,"ax",@progbits
+a:
+ nop
+
+.section .text.x,"ax",@progbits
+x:
+ nop
+
+.section .text.y,"ax",@progbits
+y:
+ nop
OpenPOWER on IntegriCloud