This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] Move creation of .ARM.exidx sentinel before LinkerScript creation
ClosedPublic

Authored by peter.smith on May 24 2017, 7:22 AM.

Details

Summary

This change moves the creation of the .ARM.exidx sentinel section forward so that it is assigned to an OutputSection/InputSectionDescription with the existing .ARM.exidx sections.

A consequence of moving the .ARM.exidx creation earlier is that we can no longer guarantee that it will be already last in the table so we must account for this in the comparison function.

I've split this out from D33239 as it is a logical intermediate step towards converting the SHF_LINK_ORDER processing to use InputSectionDescriptions.

Diff Detail

Event Timeline

peter.smith created this revision.May 24 2017, 7:22 AM

Updated patch to just append the .ARM.exidx sentinel section to an existing LinkerScript InputSectionDescription.

To do the insertion I've moved the LinkerScript::inputSectionRanges() function from D33500 so we can use it do the insertion and updated D33500.

Updated patch to use Script->getCmd(OS) as suggested.

I removed the comment "This function adds linker-created Out::* sections." as it seemed to be out of date as we don't have Out:: sections any more. I'm happy to put it back in or change it to something more specific like: " // Add any linker dependent sections that are dependent on the OutputSections"

This revision was automatically updated to reflect the committed changes.