This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not crash if user section has name equal to one of synthetic sections.
ClosedPublic

Authored by grimar on Jan 11 2017, 4:54 AM.

Details

Summary

Previously we just crashed when had user defined
section .shstrtab, for example. Which name equals to synthetic one,
but have different type.

Testcase reveals an issue.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 83961.Jan 11 2017, 4:54 AM
grimar retitled this revision from to [ELF] - Do not crash if user section has name equal to one of synthetic sections..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.
grimar updated this object.Jan 11 2017, 4:58 AM
ruiu added inline comments.Jan 11 2017, 10:30 AM
ELF/InputSection.cpp
38–41 ↗(On Diff #83961)

If a section is a synthetic section, it's output will be something like

'foo'

while if it is not, it will be something like

bar.o:(foo)

So, apparently they are inconsistent in quoting style. That's not good.

This revision was automatically updated to reflect the committed changes.