This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF][ARM] Add a test that maxes out the thunk convergence limit
ClosedPublic

Authored by peter.smith on Aug 16 2019, 6:44 AM.

Details

Summary

Add a test that takes the maximum amount of passes permitted to converge. This will make sure that any symbol defined in a linker script gets the correct value and that any other convergence limit involving symbol address doesn't restrict Thunk convergence.

Related to D66279 which is looking at iterating until symbol addresses stabilize.

Diff Detail

Event Timeline

peter.smith created this revision.Aug 16 2019, 6:44 AM
MaskRay added inline comments.Aug 16 2019, 9:10 AM
lld/test/ELF/arm-thunk-many-passes.s
63

Probably add a comment saying that thunks are placed before .text.02. In each iteration a new thunk is created for one f* function but the 4 bytes it adds also makes the next function out of reach from the b.w instruction.

64

It seems the two .text.02 can be merged

.section .text.02, "ax", %progbits
.space 2 * 1024 * 1024 - 68
MaskRay added inline comments.Aug 16 2019, 9:14 AM
lld/test/ELF/arm-thunk-many-passes.s
13

one fewer than the limit of 10.

It takes 9 passes to create all thunks. An extra createThunks is called to check no address changes, so createThunks is actually called 10 times. (The 11th call of createThunks will error.)

I think the comment can be improved a bit but I am not sure how to reword it to make it clearer...

Thanks for the comments. I've merged the .text sections and have made an attempt at improving the comments.

MaskRay accepted this revision.Aug 16 2019, 6:48 PM
This revision is now accepted and ready to land.Aug 16 2019, 6:48 PM

Looks good. 2 questions are inline.

lld/test/ELF/arm-thunk-many-passes.s
27

Does it make sense to show that .text output section has size == 0x100004C (it seems)?

104

The last line with .thumb_func seems excessive?

Looks good. 2 questions are inline.

Thanks, I've updated the test to remove .thumb_func on the last line and check the section size.

This revision was automatically updated to reflect the committed changes.