[PATCH] D59488: [llvm-objcopy] - Calculate the string table section sizes correctly.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 18 06:48:56 PDT 2019
grimar added a comment.
In D59488#1433045 <https://reviews.llvm.org/D59488#1433045>, @jhenderson wrote:
> LGTM, with a couple of comment nits.
>
> I think you might have flushed out another bug with string table building, based on the size changes in the two archive tests. Could you double-check, and fix or file a bug, please? I'm guessing it's just that we're adding an extra null byte.
Yes, sure, I am actually looking at this :) It seems the issue is that we add a zero's symbol name here (instead of ignoring that symbol):
(https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.cpp#L498)
> // Add all of our strings to SymbolNames so that SymbolNames has the right
> // size before layout is decided.
> for (auto &Sym : Symbols)
> SymbolNames->addString(Sym->Name);
I am not sure yet, just made this observation during developing this patch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59488/new/
https://reviews.llvm.org/D59488
More information about the llvm-commits
mailing list