[PATCH] D102281: [lld][WebAssembly] Allow data symbols to extend past end of segment
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 11 17:47:31 PDT 2021
sbc100 added a comment.
In D102281#2752637 <https://reviews.llvm.org/D102281#2752637>, @sbc100 wrote:
> In D102281#2752454 <https://reviews.llvm.org/D102281#2752454>, @dschuff wrote:
>
>> I'm not sure I understand what the description means, in particular how null-termination is related to the symbol extending past the end of the segment. (more generally I guess I don't understand why we want to allow symbols to extend past the end).
>
> Each data symbol has a give size, but string tail merging ignores that an will treat each string as NULL terminated. In this example the symbol bar is of size 6 string merging removes the trailing 3 chars which are essentially unreachable but the symbol still has a size of 6 in the symbol table. Since its at the end of the section it end up being reports has overlapping the end of the section by 3 bytes... at least according the the size in the symbol table. I've verified the ELF does the same thing.
So now just only check that a symbol starts within the segment it is defined in.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102281/new/
https://reviews.llvm.org/D102281
More information about the llvm-commits
mailing list