This is an archive of the discontinued LLVM Phabricator instance.

[lld] Check for branch range overflows.
ClosedPublic

Authored by sidneym on Oct 11 2019, 9:27 AM.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sidneym created this revision.Oct 11 2019, 9:27 AM
Herald added a project: Restricted Project. · View Herald Transcript
bcain accepted this revision.Oct 11 2019, 10:01 AM

LGTM, but suggestions for stricter test case.

lld/test/ELF/hexagon-verify.s
5–9

I'd make the subsequent ones CHECK-NEXT.

Also may make sense to constrain the FileCheck with implicit-check-not='out of range' to make sure no range errors are emitted that aren't checked for.

This revision is now accepted and ready to land.Oct 11 2019, 10:01 AM
lebedev.ri retitled this revision from Check for branch range overflows. to [lld] Check for branch range overflows..Oct 11 2019, 10:25 AM
sidneym updated this revision to Diff 224637.Oct 11 2019, 11:00 AM

Update test case.

MaskRay added inline comments.Oct 11 2019, 6:18 PM
lld/test/ELF/hexagon-verify.s
6

#CHECK -> # CHECK

If such branch relocation types have a categorical name, e.g. jump, consider rename this test to something like hexagon-jump-error.s

x86-64-reloc-error.s
aarch64-lo21-error.s  # the name is good
MaskRay added inline comments.Oct 11 2019, 6:20 PM
lld/test/ELF/hexagon-verify.s
22

Consider moving the CHECK lines just before the corresponding instructions.

29

If jump #b15 works, you can delete the local label pc15.

sidneym updated this revision to Diff 224866.Oct 14 2019, 9:11 AM

Update and rename testcase.

ruiu accepted this revision.Oct 15 2019, 3:31 AM

LGTM

This revision was automatically updated to reflect the committed changes.