[PATCH] D19996: New clang option -mpiecopyrelocs to indicate support for linker copy relocations when linking as PIE

2016-05-05 Thread Sriraman Tallam via cfe-commits
tmsriram created this revision. tmsriram added a reviewer: rnk. tmsriram added subscribers: cfe-commits, davidxl, rafael. With linker copy relocations, PIE can generate better code for external global variable accesses. This patch adds a new option to clang to specify this. Please see http://

Re: [PATCH] D19996: New clang option -mpiecopyrelocs to indicate support for linker copy relocations when linking as PIE

2016-05-05 Thread Rafael Espíndola via cfe-commits
Is there a gcc option or they just assume they are targeting the linker that was around when gcc was built? > + if (Args.hasFlag(options::OPT_mpiecopyrelocs, > options::OPT_mno_piecopyrelocs, > + false)) { > +CmdArgs.push_back("-piecopyrelocs"); > + } you don't need the

Re: [PATCH] D19996: New clang option -mpiecopyrelocs to indicate support for linker copy relocations when linking as PIE

2016-05-05 Thread Sriraman Tallam via cfe-commits
On Thu, May 5, 2016 at 2:31 PM, Rafael Espíndola wrote: > Is there a gcc option or they just assume they are targeting the > linker that was around when gcc was built? It is done at configure time, the linker is checked for copy relocations support. I recently saw a request to replace this with

Re: [PATCH] D19996: New clang option -mpiecopyrelocs to indicate support for linker copy relocations when linking as PIE

2016-05-10 Thread Sean Silva via cfe-commits
If this is something that GCC doesn't have, it would be nice if we put something in our own docs about it (something like docs/UsersManual.rst). On Thu, May 5, 2016 at 2:34 PM, Sriraman Tallam via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Thu, May 5, 2016 at 2:31 PM, Rafael Espíndola