]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: always warn about textrels in files
authorMike Frysinger <vapier@gentoo.org>
Tue, 17 May 2005 02:10:19 +0000 (22:10 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 3 Mar 2017 18:02:53 +0000 (11:02 -0700)
textrels are bad for forcing copy-on-write (this affects everyone), and for
security/runtime code generation, this affects security ppl.  But in either
case, it doesn't matter who needs textrels, it's the very fact that they're
needed at all.

ld/ldmain.c
ld/testsuite/lib/ld-lib.exp

index 1e48b1a2dbbcf37f70e4e723e51c2e888eb1d2e0..f634eaa908a52b2448e3da7fe2db0e3f222a1006 100644 (file)
@@ -294,6 +294,7 @@ main (int argc, char **argv)
   link_info.dynamic_undefined_weak = -1;
   link_info.pei386_auto_import = -1;
   link_info.spare_dynamic_tags = 5;
+  link_info.warn_shared_textrel = TRUE;
   link_info.path_separator = ':';
 #ifdef DEFAULT_FLAG_COMPRESS_DEBUG
   link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
index cf7886b4866fca033a17108c2884c6169b78401f..6c6a0b7a001e4c03247a40b22f754b031080b967 100644 (file)
@@ -250,6 +250,10 @@ proc default_ld_simple_link { ld target objects } {
     # symbol, since the default linker script might use ENTRY.
     regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
 
+    # Gentoo tweak:
+    # We want to ignore TEXTREL warnings since we force enable them by default
+    regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
+
     return [string match "" $exec_output]
 }