summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-10-04 16:47:49 +0000
committerRui Ueyama <ruiu@google.com>2016-10-04 16:47:49 +0000
commitaf9793d1c1a3e23ecd0b0b640ca6ba8c0e69435b (patch)
tree987fbf793fc93c3b7333463400342ba9b3d1c222
parent9e5afc4a2c8d1dff4b8626d5003707c5a97ccd0e (diff)
downloadbcm5719-llvm-af9793d1c1a3e23ecd0b0b640ca6ba8c0e69435b.tar.gz
bcm5719-llvm-af9793d1c1a3e23ecd0b0b640ca6ba8c0e69435b.zip
Add a comment.
llvm-svn: 283229
-rw-r--r--lld/ELF/InputFiles.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 566da9cb843..cd29311ccdc 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -226,7 +226,10 @@ void elf::ObjectFile<ELFT>::initializeSections(
if (Sections[I] == &InputSection<ELFT>::Discarded)
continue;
- if (!Config->Relocatable && (Sec.sh_flags & SHF_EXCLUDE)) {
+ // SHF_EXCLUDE'ed sections are discarded by the linker. However,
+ // if -r is given, we'll let the final link discard such sections.
+ // This is compatible with GNU.
+ if ((Sec.sh_flags & SHF_EXCLUDE) && !Config->Relocatable) {
Sections[I] = &InputSection<ELFT>::Discarded;
continue;
}
OpenPOWER on IntegriCloud