This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "GOT" under aarch64


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]