Page MenuHomePhabricator

[LLD][ELF][ARM] Don't apply --fix-cortex-a8 to relocatable links.
ClosedPublic

Authored by peter.smith on Jan 21 2020, 6:13 AM.

Details

Summary

The --fix-cortex-a8 is sensitive to alignment and the precise destination of branch instructions. These are not knowable at relocatable link time. We follow GNU ld and the --fix-cortex-a53-843419 (D72968) by not patching the code when there is a relocatable link.

Diff Detail

Event Timeline

peter.smith created this revision.Jan 21 2020, 6:13 AM

It looks fine to me, I'll leave it for others, have a minor question though.

lld/test/ELF/arm-fix-cortex-a8-recognize.s
14

Does it make sense to check what we do with -verbose -r?

peter.smith marked an inline comment as done.Jan 21 2020, 7:14 AM

It looks fine to me, I'll leave it for others, have a minor question though.

lld/test/ELF/arm-fix-cortex-a8-recognize.s
14

There is a small benefit. I'll add a check that we don't see the message as it makes it more consistent with the others.

Added a check for lld -v to make sure a detection message isn't printed.

MaskRay accepted this revision.Jan 21 2020, 9:59 AM

I was waiting for other opinions on D72968 because I was thinking whether it makes sense to reject -r --fix-*. It seems GNU ld has made a decision and the way is simple, let's do this.

lld/test/ELF/arm-fix-cortex-a8-recognize.s
14

-v --> --verbose

They are different options. -v just prints the version number.

This revision is now accepted and ready to land.Jan 21 2020, 9:59 AM
This revision was automatically updated to reflect the committed changes.
peter.smith marked an inline comment as done.