Hi
I am writing a code generator for ARM64.
To access a global variable I was generating
addrp x0,someglobal
add x0,[x0,:lo12:someglobal]
This worked without any problems with gcc version 4.9.2 (Debian/Linaro
4.9.2-10) and GNU ld (GNU Binutils for Debian) 2.25.
I have updated my system and now with gcc version 6.3.0 20170516 (Debian
6.3.0-18) and GNU ld (GNU Binutils for Debian) 2.28. The linker
complains about illegal relocations.
Investigating this, I noticed that now gcc generates
adrp x0, :got:stderr
ldr x0, [x0, #:got_lo12:stderr]
I changed now my code generator and it works again. The problem for me is:
1) How can I know what I should generate? Should I figure out the gcc
version installed?
2) Is there any documentation for this change somewhere? What does it mean?
3) What should be a portable solution for this problem?
Thanks in advance for your time.
Jacob