I hit this relocation while building some software for ARM and realized the support for that is a little bit weird. In fact, TARGET1 is interpreted as REL32 or ABS32 depending on if --target1-rel or --target1-abs is passed on the cmdline. The default behaviour seems to interpret the relocation as ABS if no option is passed.
Details
Diff Detail
Event Timeline
Makes sense. Virtual calls are expensive, alas :( I also forgot to git add the test, should be in this revision.
ELF/Target.cpp | ||
---|---|---|
1505 | I think I'd prefer adding case R_ARM_TARGET1 to the following switches because, by doing so, you don't need to read this function to understand how we handle ARM relocations for all relocation types except TARGET1. See below. | |
1536 | case R_ARM_TARGET1: return Config->Target1Rel ? R_PC : R_ABS; | |
1558 | if (Type == R_ARM_TARGET1 && !Config->Target1Rel) return R_ARM_ABS32; | |
1641 | Add case R_ARM_TARGET32: so that you can remove modifyARMReloc from this function. | |
1770 | Ditto |
Revert.