This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Error if -r --gdb-index are used together
ClosedPublic

Authored by MaskRay on Jul 18 2018, 2:52 PM.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

MaskRay created this revision.Jul 18 2018, 2:52 PM
ruiu added a comment.Jul 18 2018, 2:55 PM

Instead of doing this, maybe we should report an error when -gdb-index is used with -r. I don't think there's a valid use case of giving the two flags at the same time.

MaskRay retitled this revision from [ELF] gdb-index: don't remove .debug_gnu_pub{names,types} in -r mode to [ELF] Error if -r --gdb-index are used together.Jul 18 2018, 3:03 PM
ruiu accepted this revision.Jul 18 2018, 3:07 PM

LGTM

This revision is now accepted and ready to land.Jul 18 2018, 3:07 PM
This revision was automatically updated to reflect the committed changes.

Would be good to have an explanation about why these options are incompatible in the commit message (missed that opportunity) and maybe in the source.

Is the schema in gdb_index unable to handle multiple code sections, for example?

This might not be especially useful - the gnu_pubnames sections don't
describe which CU they are for (if I recall correctly), so once you've got
multiple CUs in a single object file (admittedly, this happens in LTO too,
adn I'm not sure how that's handled) it might not be terribly useful. I'm
not sure what lld's gdb-index does when consuming an object with multiple
CUs in it, for example.