Hi, You'll get GOT relocations to globals when you use -fpic:
int x;
int f(void) { return x; }
>gcc -O2 -S -o- -fpic
f:
adrp x0, :got:x
ldr x0, [x0, #:got_lo12:x]
ldr w0, [x0]
ret
So it doesn't depend on the compiler but what options you compile for.
There may be an issue with your setup, -fpic shouldn't be on by default.
Use gcc -v -Q -c testfile.c to list all the default settings - there could be
more non-standard or inefficient options enabled.
Wilco
