This is an archive of the discontinued LLVM Phabricator instance.

[ELF] --gdb-index: support --icf={safe,all}
ClosedPublic

Authored by MaskRay on Oct 19 2020, 4:46 PM.

Details

Summary

The combination has not been tested before. In the case of ICF,
e.section->getVA(0) equals the start address of the output section.

This can cause incorrect overlapping with the actual function at the
start of the output section and potentially trigger a GDB internal error
in dw2_find_pc_sect_compunit_symtab (presumably because:
if a short address range incorrectly starts at the start address of the
output section, GDB may pick it instead of the correct longer address
range. When mapping an address within the long address range but
out of the scope of the short address range, the routine may find
nothing - while the code asserts that it can find something).

Note that in the case of ICF there may be duplicate address range entries,
but GDB appears to be fine with them.

Diff Detail

Event Timeline

MaskRay created this revision.Oct 19 2020, 4:46 PM
MaskRay requested review of this revision.Oct 19 2020, 4:46 PM
grimar accepted this revision.Oct 20 2020, 12:08 AM

LGTM

lld/test/ELF/gdb-index-icf.s
29

# -> ##?

This revision is now accepted and ready to land.Oct 20 2020, 12:08 AM
MaskRay marked an inline comment as done.Oct 20 2020, 9:35 AM

Thanks!

lld/test/ELF/gdb-index-icf.s
29

I think we should loose the requirement for comment markers starting in the middle of a line.
This is basically clang -S -g produced assembly with a lot of clean-ups. Comments starting in the middle of a line make them immediately stand out, so ## is probably not needed.

This revision was landed with ongoing or failed builds.Oct 20 2020, 9:42 AM
This revision was automatically updated to reflect the committed changes.
MaskRay marked an inline comment as done.