forked from OSchip/llvm-project
cd01430ff1
This fixes a bug with string merging with string symbols that contain NULLs, as is the case in the `merge-string.s` test. The bug only showed when we run with `--relocatable` and then try read the resulting object back in. In this case we would end up with string symbols that extend past the end of the segment in which they live. The problem comes from the fact that sections which are flagged as string mergable assume that all strings are NULL terminated. The merging algorithm will drop trailing chars that follow a NULL since they are essentially unreachable. However, the "size" attribute (in the symbol table) of such a truncated symbol is not updated resulting a symbol size that can overlap the end of the segment. I verified that this can happen in ELF too given the right conditions and the its harmless enough. In practice Strings that contain embedded null should not be part of a mergable section. Differential Revision: https://reviews.llvm.org/D102281 |
||
---|---|---|
.. | ||
COFF | ||
ELF | ||
MachO | ||
MinGW | ||
Unit | ||
darwin | ||
mach-o | ||
wasm | ||
CMakeLists.txt | ||
lit.cfg.py | ||
lit.site.cfg.py.in |