-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
arm/emit.mlp - duplicate label in PIC mode #11202
Comments
a bug it seems:
which then became:
a swap in the saved pair order without adjustment in emit-literals edit: indeed the usage of pic/got in emit-literals should be swapped
it worked before 4.13 because the pair was the wrong way round! |
Well spotted! Looks like the bug was introduced by #8936. @gretay-js : could you please confirm and perhaps submit a fix? |
Yes, the bug is swapping the order of the two labels in emit_literals, and the fix is exactly what @progman1 suggested, thank you! The CI seems unhappy with the fix for unrelated reasons, and I don't have access to an arm to test. |
The two labels were swapped. Fixes: #11202
The two labels were swapped. Fixes: ocaml#11202
The two labels were swapped. Fixes: ocaml#11202
The two labels were swapped. Fixes: ocaml#11202
The two labels were swapped. Fixes: ocaml#11202
The two labels were swapped. Fixes: ocaml#11202
in v4.14/asmcomp/arm/emit.mlp # 330, namely the emit-load-symbol-addr function,
the generated asm sequence for the PIC case includes a label definition:
but on emission of the literal produced by
the same label is defined again in emit-literals:
since this is in a constant island within the .text section the two definitions should necessarily clash.
I cannot say a bug results from this as I'm still figuring out how to construct some ML code to generate the asm.
but it does look wrong.
and indeed I am having a hard time understanding how the generated code sequence is intended to work.
and maybe they are related! so any guidance appreciated!
more generally would someone comment on the following?:
emit-load-symbol-addr, by dealing with non-relative symbol addresses, is a means to avoid the issue of far pointers - out-of-range of limited ARM instructions - that would likely otherwise occur when linking compilation units.
thanks.
The text was updated successfully, but these errors were encountered: