On Sun, Nov 7, 2010 at 9:14 PM, Rafael Espindola
<[email protected]> wrote:
> +  if (IsUbuntu(Distro))
> +    ExtraOpts.push_back("-z relro");

Regular binutils ld doesn't mind this, but gold gives an error: "ld:
relro: unknown -z option" (note that there are _two_ spaces in front
of "relro" there)
I think the problem is that you're pushing this as a single argument
with a space in it, and apparently gold doesn't strip the space when
it processes the -z option.
You should probably either push "-zrelro" or push "-z" and "relro"
separately. (neither give an error from the command line, though I
don't know what it's supposed to do so I can't check whether the first
does what's expected...)
The attached patch implements the second option.
Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp	(revision 118404)
+++ lib/Driver/ToolChains.cpp	(working copy)
@@ -1360,8 +1360,10 @@
 
   LinuxDistro Distro = DetectLinuxDistro(Arch);
 
-  if (IsUbuntu(Distro))
-    ExtraOpts.push_back("-z relro");
+  if (IsUbuntu(Distro)) {
+    ExtraOpts.push_back("-z");
+    ExtraOpts.push_back("relro");
+  }
 
   if (Arch == llvm::Triple::arm)
     ExtraOpts.push_back("-X");
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to