This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not crash if symbol type set to TLS when there is no tls sections.
ClosedPublic

Authored by grimar on Sep 30 2016, 2:18 AM.

Details

Summary

id_000021,sig_11,src_000002,op_flip1,pos_92 from PR30540

does not have TLS sections, but type
of one of the symbol is broken and set to STT_TLS,
what resulted in a crash.

Diff Detail

Event Timeline

grimar updated this revision to Diff 73013.Sep 30 2016, 2:18 AM
grimar retitled this revision from to [ELF] - Do not crash if symbol type set to TLS when there is no tls sections..
grimar updated this object.
grimar added reviewers: ruiu, rafael, davide.
grimar added subscribers: llvm-commits, grimar, evgeny777.
ruiu added inline comments.Sep 30 2016, 1:25 PM
ELF/Symbols.cpp
64–65
fatal(getFilename(D.File) + " has a STT_TLS symbol but doesn't have a PT_TLS section.")
test/ELF/invalid/tls-symbol.s
3–4

The test file contains a STT_TLS symbol but has no TLS section.

5–6

You can write it in one line.

grimar updated this revision to Diff 73258.Oct 3 2016, 3:50 AM
  • Addressed review comments.
ruiu accepted this revision.Oct 3 2016, 10:00 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 3 2016, 10:00 AM
This revision was automatically updated to reflect the committed changes.