This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Fallback to sh_link=0 if neither .dynsym nor .symtab exists
ClosedPublic

Authored by MaskRay on Oct 30 2018, 12:13 PM.

Details

Summary

.rela.plt may only contain R_*_{,I}RELATIVE relocations and not need a symbol table link. bfd/gold fallbacks to sh_link=0 in this case. Without this patch, ld.lld --strip-all caused lld to dereference a null pointer.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Oct 30 2018, 12:13 PM
MaskRay updated this revision to Diff 171767.Oct 30 2018, 12:51 PM

Update comment

ruiu added inline comments.Oct 30 2018, 12:56 PM
ELF/SyntheticSections.cpp
1498–1500 ↗(On Diff #171767)

If ?: is nested, plain if ~ else if is perhaps easier to read.

MaskRay updated this revision to Diff 171781.Oct 30 2018, 1:38 PM

Use if .. else if ... else

ruiu accepted this revision.Oct 30 2018, 1:55 PM

LGTM

This revision is now accepted and ready to land.Oct 30 2018, 1:55 PM
This revision was automatically updated to reflect the committed changes.