[lld] r282568 - [ELF] Ignore sections flagged with SHF_EXCLUDE
Eugene Leviant via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 28 01:42:03 PDT 2016
Author: evgeny777
Date: Wed Sep 28 03:42:02 2016
New Revision: 282568
URL: http://llvm.org/viewvc/llvm-project?rev=282568&view=rev
Log:
[ELF] Ignore sections flagged with SHF_EXCLUDE
Differential revision: https://reviews.llvm.org/D24966
Added:
lld/trunk/test/ELF/exclude.s
Modified:
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=282568&r1=282567&r2=282568&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Sep 28 03:42:02 2016
@@ -226,6 +226,11 @@ void elf::ObjectFile<ELFT>::initializeSe
if (Sections[I] == &InputSection<ELFT>::Discarded)
continue;
+ if (Sec.sh_flags & SHF_EXCLUDE) {
+ Sections[I] = &InputSection<ELFT>::Discarded;
+ continue;
+ }
+
switch (Sec.sh_type) {
case SHT_GROUP:
Sections[I] = &InputSection<ELFT>::Discarded;
Added: lld/trunk/test/ELF/exclude.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/exclude.s?rev=282568&view=auto
==============================================================================
--- lld/trunk/test/ELF/exclude.s (added)
+++ lld/trunk/test/ELF/exclude.s Wed Sep 28 03:42:02 2016
@@ -0,0 +1,12 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: ld.lld -o %t1 %t
+# RUN: llvm-objdump -section-headers %t1 | FileCheck %s
+# CHECK-NOT: .aaa
+
+.globl _start
+_start:
+ jmp _start
+
+.section .aaa,"ae"
+ .quad 0
More information about the llvm-commits
mailing list