From: Mike Frysinger Date: Tue, 17 May 2005 02:10:19 +0000 (-0400) Subject: ld: always warn about textrels in files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c2e0712f0c87fcb92904b30bc3a22d5f2467998;p=thirdparty%2Fbinutils-gdb.git ld: always warn about textrels in files 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. --- diff --git a/ld/ldmain.c b/ld/ldmain.c index e7a8dff9d26..b03850b6fa1 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -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; diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 62f97689ac5..a9cd9f771d3 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -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] }