]> 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>
Sat, 12 Nov 2016 07:33:20 +0000 (02:33 -0500)
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 e7a8dff9d262fe7d44bf3521c2815894593f44e8..b03850b6fa17f468eccef6f4a85333488cfeac2a 100644 (file)
@@ -281,6 +281,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 62f97689ac5fb5c17d6309a7cc2036a07cbe9d5d..a9cd9f771d3d88bb3b63f918b4763fa997c61027 100644 (file)
@@ -247,6 +247,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]
 }