This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not crash when linkerscript applies fill to .bss.
ClosedPublic

Authored by grimar on May 29 2017, 6:32 AM.

Details

Summary

I found that during visual inspection of code while wrote different patch.
Script in testcase probably have nothing common with real life, but
we segfault currently using it.

I think if output section is known NOBITS, there is no need to create
writers threads for doing nothing or proccess any filler logic that is useless here.
We can just early return, that is what this patch do.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.May 29 2017, 6:32 AM
This revision was automatically updated to reflect the committed changes.
ruiu added inline comments.Jun 5 2017, 3:15 PM
lld/trunk/ELF/LinkerScript.cpp
1083–1084

Why don't you write this at the very beginning of this function?

grimar added inline comments.Jun 6 2017, 12:47 AM
lld/trunk/ELF/LinkerScript.cpp
1083–1084

Done in r304777.