summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-16 22:10:19 -0400
committerMike Frysinger <vapier@gentoo.org>2017-03-03 11:02:53 -0700
commitbb101959912073f460669d75097215cde7b20019 (patch)
treee64270a2332229c6623a4872f40b993fade0ad2a
parent7fa393306ed8b93019d225548474c0540b8928f7 (diff)
downloadbinutils-gdb-bb101959912073f460669d75097215cde7b20019.tar.gz
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.
-rw-r--r--ld/ldmain.c1
-rw-r--r--ld/testsuite/lib/ld-lib.exp4
2 files changed, 5 insertions, 0 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 1e48b1a2dbb..f634eaa908a 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -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;
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index cf7886b4866..6c6a0b7a001 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -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]
}