Page MenuHomePhabricator

[ELF] - Do not crash when assign common symbol's values in script
ClosedPublic

Authored by grimar on Jan 19 2017, 8:04 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jan 19 2017, 8:04 AM

IIUC, the crash is b/c LinkerScript<ELFT>::getSymbolSection has no code to handle the common symbol case. The fix is to use SymbolTableSection<ELFT>::getOutputSection, which does have code for handling commons (and various other kinds). If so, then LGTM.

grimar added a comment.EditedJan 19 2017, 8:34 AM

IIUC, the crash is b/c LinkerScript<ELFT>::getSymbolSection has no code to handle the common symbol case. The fix is to use SymbolTableSection<ELFT>::getOutputSection, which does have code for handling commons (and various other kinds). If so, then LGTM.

Yes, you're correct. Previously we just partially duplicated code from getSymbolSection().
I probably had to write that all in description. Thank you for looking at this !

This revision was automatically updated to reflect the committed changes.