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

ocamlopt -nodynlink does not work on armhf #8867

Open
glondu opened this issue Aug 9, 2019 · 1 comment

Comments

@glondu
Copy link
Contributor

commented Aug 9, 2019

Hello,

As instructed in ocaml/dune#2527, I open an issue here.

When I compile a simple hello.ml file (Debian unstable armhf):

print_endline "Hello world!"

with ocamlopt -nodynlink hello.ml, I get relocation errors that go away when I remove -nodynlink.

Please have look at @nojb's insights in ocaml/dune#2527

@nojb

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

It seems (https://sourceware.org/ml/binutils/2009-04/msg00395.html) we should not be using MOVW/MOVT to load addresses of symbols coming from PIC libraries :

ocaml/asmcomp/arm/emit.mlp

Lines 389 to 392 in 0557f07

end else if !arch > ARMv6 && not !Clflags.dlcode && !fastcode_flag then begin
` movw {emit_reg dst}, #:lower16:{emit_symbol s}\n`;
` movt {emit_reg dst}, #:upper16:{emit_symbol s}\n`;
2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.