Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Fangrui Song via Gcc-patches
On Thu, Nov 17, 2022 at 1:55 PM Andrew Pinski wrote: > > On Thu, Nov 17, 2022 at 1:46 PM Fangrui Song wrote: > > > > On Thu, Nov 17, 2022 at 1:37 PM Andrew Pinski wrote: > > > > > > On Thu, Nov 17, 2022 at 1:21 PM maskray--- via Gcc-patches > > > wrote: > > > > > > > > > +.. option::

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 17, 2022 at 1:46 PM Fangrui Song wrote: > > On Thu, Nov 17, 2022 at 1:37 PM Andrew Pinski wrote: > > > > On Thu, Nov 17, 2022 at 1:21 PM maskray--- via Gcc-patches > > wrote: > > > > > > > +.. option:: -mdirect-extern-access, -mno-direct-extern-access > > > > + > > > > + Use direct

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Fangrui Song via Gcc-patches
On Thu, Nov 17, 2022 at 1:37 PM Andrew Pinski wrote: > > On Thu, Nov 17, 2022 at 1:21 PM maskray--- via Gcc-patches > wrote: > > > > > +.. option:: -mdirect-extern-access, -mno-direct-extern-access > > > + > > > + Use direct accesses for external data symbols. It avoids a GOT > > >

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 17, 2022 at 1:21 PM maskray--- via Gcc-patches wrote: > > > +.. option:: -mdirect-extern-access, -mno-direct-extern-access > > + > > + Use direct accesses for external data symbols. It avoids a GOT > > indirection > > + on all external data symbols with :option:`-fpie` or

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread maskray--- via Gcc-patches
+.. option:: -mdirect-extern-access, -mno-direct-extern-access + + Use direct accesses for external data symbols. It avoids a GOT indirection + on all external data symbols with :option:`-fpie` or :option:`-fPIE`. This is + useful for executables linked with :option:`-static` or

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Ramana Radhakrishnan via Gcc-patches
On Thu, Nov 17, 2022 at 5:30 PM Richard Sandiford via Gcc-patches wrote: > > Wilco Dijkstra writes: > > Hi Richard, > > > >> Can you go into more detail about: > >> > >>Use :option:`-mdirect-extern-access` either in shared libraries or in > >>executables, but not in both. Protected

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Hi Richard, > >> Can you go into more detail about: >> >>Use :option:`-mdirect-extern-access` either in shared libraries or in >>executables, but not in both. Protected symbols used both in a shared >>library and executable may cause linker errors or fail to

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, > Can you go into more detail about: > >    Use :option:`-mdirect-extern-access` either in shared libraries or in >    executables, but not in both.  Protected symbols used both in a shared >    library and executable may cause linker errors or fail to work correctly > > If this is

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-16 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Add a new option -mdirect-extern-access similar to other targets. This > removes > GOT indirections on external symbols with -fPIE, resulting in significantly > better code quality. With -fPIC it only affects protected symbols, allowing > for more efficient shared

[PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-11 Thread Wilco Dijkstra via Gcc-patches
Add a new option -mdirect-extern-access similar to other targets. This removes GOT indirections on external symbols with -fPIE, resulting in significantly better code quality. With -fPIC it only affects protected symbols, allowing for more efficient shared libraries which can be linked with