diff options
author | Nathan Sidwell <nathan@acm.org> | 2023-04-18 18:13:16 -0400 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2023-04-19 15:51:12 -0400 |
commit | f2f0411924184ca59911b3abebb564e22b569f40 (patch) | |
tree | 1960a1df111d27f49d0bfe8456c71fe80ed6c33d /bolt/lib | |
parent | 31deca465f46c6860e4f1fb5c3cad4ab1ce4211b (diff) | |
download | llvm-f2f0411924184ca59911b3abebb564e22b569f40.tar.gz |
[BOLT] Adjust Shdr alignment
Shdr's are not necesarily size 2^n, and there is no reason to align to
that boundary if they are.
Differential Revision: https://reviews.llvm.org/D148666
Diffstat (limited to 'bolt/lib')
-rw-r--r-- | bolt/lib/Rewrite/RewriteInstance.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 4c4b3fa47c62..9e38736d147d 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4765,9 +4765,10 @@ void RewriteInstance::patchELFSectionHeaderTable(ELFObjectFile<ELFT> *File) { dbgs() << " " << I << " -> " << NewSectionIndex[I] << '\n'; ); - // Align starting address for section header table. + // Align starting address for section header table. There's no architecutal + // need to align this, it is just for pleasant human readability. uint64_t SHTOffset = OS.tell(); - SHTOffset = appendPadding(OS, SHTOffset, sizeof(ELFShdrTy)); + SHTOffset = appendPadding(OS, SHTOffset, 16); // Write all section header entries while patching section references. for (ELFShdrTy &Section : OutputSections) { |