Re: "GOT" under aarch64

2017-09-22 Thread Ramana Radhakrishnan
On Fri, Sep 22, 2017 at 12:29 PM, Wilco Dijkstra wrote: > 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: > adrpx0, :got:x > ldr x0, [x0, #:got_lo12:x] > ldr w0, [x0] >

Re: "GOT" under aarch64

2017-09-22 Thread Wilco Dijkstra
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: adrpx0, :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. T

Re: "GOT" under aarch64

2017-09-22 Thread Florian Weimer
* jacob navia: > 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? It's probably due to a downstream packaging change to enable position-independent executables (PIE) by defau

"GOT" under aarch64

2017-09-22 Thread jacob navia
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 m