This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Explicitly write null bytes in string tables
ClosedPublic

Authored by jhenderson on Aug 3 2017, 7:16 AM.

Details

Summary

Following rL309829, if a string table appears in an executable segment, the strings will not be null terminated. This is a problem, for example, for the .dynstr section when using -no-rosegment. The strings end up being terminated with 0xcc because prior to this patch, LLD did not explicitly write the null terminators. This change fixes that by always writing the null terminators.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.Aug 3 2017, 7:16 AM
jhenderson accepted this revision.Aug 4 2017, 1:57 AM

@rafael accepted this on the mailing list.

This revision is now accepted and ready to land.Aug 4 2017, 1:57 AM
This revision was automatically updated to reflect the committed changes.
ruiu edited edge metadata.Aug 4 2017, 2:10 AM

LGTM