diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-01-11 15:13:05 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-01-11 15:13:05 +0000 |
| commit | 79114a673e65fc03626da592a843f3e7c4794d78 (patch) | |
| tree | 3843cc4e63ca5a3683914502c896e2cd8ae371e0 | |
| parent | c282975604e31609625b6d7016d4b0b5d5c99844 (diff) | |
| download | bcm5719-llvm-79114a673e65fc03626da592a843f3e7c4794d78.tar.gz bcm5719-llvm-79114a673e65fc03626da592a843f3e7c4794d78.zip | |
Make the -b binary .data section rw.
This matches what bfd and gold do. It also matches the common flags of
other .data sections.
llvm-svn: 291674
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 4 | ||||
| -rw-r--r-- | lld/test/ELF/format-binary.test | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 1fddf40f5b2..f3afb1c3456 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -857,8 +857,8 @@ template <class ELFT> void BinaryFile::parse() { 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, diff --git a/lld/test/ELF/format-binary.test b/lld/test/ELF/format-binary.test index 586f5f963df..94b9b51afe7 100644 --- a/lld/test/ELF/format-binary.test +++ b/lld/test/ELF/format-binary.test @@ -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: |

