This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] Add linker script generated data to non-contiguous relro test [NFC].
ClosedPublic

Authored by peter.smith on Dec 1 2017, 8:23 AM.

Details

Summary

Adapted from an example in PR35478. If in the future we are going to ignore zero sized sections we need to account for linker scripts with location counter expressions or data creating functions such as BYTE. These linker script commands may be evaluated late on so testing early for OutputSection size will miss them.

This should only be committed once the revert of r318924 has been done (D40710).

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith created this revision.Dec 1 2017, 8:23 AM
jhenderson added inline comments.Dec 1 2017, 8:34 AM
test/ELF/relro-non-contiguous.s
27–28 ↗(On Diff #125148)

I feel like these should be in two separate links. By combining the two, if one is correctly seen as influencing the size, but not the other, we won't notice.

Thanks for the comment, I've uploaded a new diff that tests each case individually.

This is almost exactly what I added as
test/ELF/relro-non-contiguous-script-data.s.

Would you mind rebasing this to add the BYTE case there instead?

Sorry,
Rafael

Sure I'll just commit that as it will be just a small addition to the existing test.

This revision was automatically updated to reflect the committed changes.