[lld] r291674 - Make the -b binary .data section rw.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 07:13:05 PST 2017
Author: rafael
Date: Wed Jan 11 09:13:05 2017
New Revision: 291674
URL: http://llvm.org/viewvc/llvm-project?rev=291674&view=rev
Log:
Make the -b binary .data section rw.
This matches what bfd and gold do. It also matches the common flags of
other .data sections.
Modified:
lld/trunk/ELF/InputFiles.cpp
lld/trunk/test/ELF/format-binary.test
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=291674&r1=291673&r2=291674&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Jan 11 09:13:05 2017
@@ -857,8 +857,8 @@ template <class ELFT> void BinaryFile::p
StringRef EndName = Saver.save(Twine(Filename) + "_end");
StringRef SizeName = Saver.save(Twine(Filename) + "_size");
- auto *Section =
- make<InputSection<ELFT>>(SHF_ALLOC, SHT_PROGBITS, 8, Data, ".data");
+ auto *Section = make<InputSection<ELFT>>(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS,
+ 8, Data, ".data");
Sections.push_back(Section);
elf::Symtab<ELFT>::X->addRegular(StartName, STV_DEFAULT, STT_OBJECT, 0, 0,
Modified: lld/trunk/test/ELF/format-binary.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/format-binary.test?rev=291674&r1=291673&r2=291674&view=diff
==============================================================================
--- lld/trunk/test/ELF/format-binary.test (original)
+++ lld/trunk/test/ELF/format-binary.test Wed Jan 11 09:13:05 2017
@@ -15,6 +15,7 @@
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
+# CHECK-NEXT: SHF_WRITE
# CHECK-NEXT: ]
# CHECK-NEXT: Address: 0x0
# CHECK-NEXT: Offset:
More information about the llvm-commits
mailing list