Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for R_ARM_THM_MOVW_ABS_NC / R_ARM_THM_MOVT_ABS relocations? #11

Open
tpetazzoni opened this issue Jun 23, 2019 · 4 comments
Open

Comments

@tpetazzoni
Copy link
Contributor

When building some Buildroot packages for ARM Cortex-M (ARMv7-M), we sometimes see movt/movw instructions generated with corresponding R_ARM_THM_MOVW_ABS_NC and/or R_ARM_THM_MOVT_ABS relocations generated:

00000380  00003f2f R_ARM_THM_MOVW_AB 00000000   PawnHashKey
00000388  00003f30 R_ARM_THM_MOVT_AB 00000000   PawnHashKey
00000464  00003f2f R_ARM_THM_MOVW_AB 00000000   PawnHashKey
00000470  00003f30 R_ARM_THM_MOVT_AB 00000000   PawnHashKey

Unfortunately, these types of relocations are not handled by elf2flt, which errors out with:

ERROR: reloc type R_ARM_THM_MOVW_ABS_NC unsupported in this context
ERROR: reloc type R_ARM_THM_MOVT_ABS unsupported in this context
ERROR: reloc type R_ARM_THM_MOVW_ABS_NC unsupported in this context
ERROR: reloc type R_ARM_THM_MOVT_ABS unsupported in this context

Would it be possible to add support for these relocation types ?

@RomainNaour
Copy link
Contributor

Hi @gregungerer @cpriouzeau,

This is another issue with ARM Cortex-m4 toolchain and elf2flt tool, there are more details/context in this message [1] in the Buildroot mailing-list.

Can you have a look?

[1] http://lists.busybox.net/pipermail/buildroot/2019-June/253203.html

Best regards,
Romain

@gregungerer
Copy link
Contributor

gregungerer commented Nov 8, 2019 via email

@tpetazzoni
Copy link
Contributor Author

So, in the end, what should be do about this? Compiling with -fpic seems like a weird workaround for statically-linked binaries. We continue to have build failures caused by this in Buildroot.

@plauche
Copy link

plauche commented Jan 27, 2020

@tpetazzoni did you ever have any insight into how to work around this?

I am running into a similar issue. The PIC suggestion is interesting, as that is how I ended up here in the first place. I inferred from this mailing list post that having PIC enabled was the root of my issue (reloc outside program on a cortex-m3 target), but disabling it led me to these other unsupported relocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants