diff options
author | Fangrui Song <i@maskray.me> | 2022-01-16 22:37:31 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-01-16 22:37:31 -0800 |
commit | a4c5db30be4e216834b44e31b47304ea1b92635f (patch) | |
tree | 46f73974fe0b5cf8ec93604b057e5096c13e2f92 /lld/ELF/SyntheticSections.cpp | |
parent | d46054d75d1117f96269c12139ab412f2db1beac (diff) | |
download | llvm-a4c5db30be4e216834b44e31b47304ea1b92635f.zip llvm-a4c5db30be4e216834b44e31b47304ea1b92635f.tar.gz llvm-a4c5db30be4e216834b44e31b47304ea1b92635f.tar.bz2 |
[ELF] Remove redundant fillTrap and memset(*, 0, *). NFC
The new tests in build-id.s would catch problems if we made a mistake here.
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 2bb94b5..6069c60 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2398,11 +2398,6 @@ void GnuHashTableSection::finalizeContents() { } void GnuHashTableSection::writeTo(uint8_t *buf) { - // The output buffer is not guaranteed to be zero-cleared because we pre- - // fill executable sections with trap instructions. This is a precaution - // for that case, which happens only when --no-rosegment is given. - memset(buf, 0, size); - // Write a header. write32(buf, nBuckets); write32(buf + 4, getPartition().dynSymTab->getNumSymbols() - symbols.size()); @@ -2515,10 +2510,6 @@ void HashTableSection::finalizeContents() { void HashTableSection::writeTo(uint8_t *buf) { SymbolTableBaseSection *symTab = getPartition().dynSymTab.get(); - - // See comment in GnuHashTableSection::writeTo. - memset(buf, 0, size); - unsigned numSymbols = symTab->getNumSymbols(); uint32_t *p = reinterpret_cast<uint32_t *>(buf); |