aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2018-06-03 21:12:16 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2019-10-13 05:47:58 +0200
commitf4bf0a6b3581af5bb943b0e39951b77888048163 (patch)
treedc717f7050c490a342ddc1eb939515abd030a6d5
parentGentoo: ld: always warn about textrels in files (diff)
downloadbinutils-gdb-f4bf0a6b3581af5bb943b0e39951b77888048163.tar.gz
binutils-gdb-f4bf0a6b3581af5bb943b0e39951b77888048163.tar.bz2
binutils-gdb-f4bf0a6b3581af5bb943b0e39951b77888048163.zip
Gentoo: Add an option --no-warn-shared-textrel (self-explanatory)
(cherry picked from commit 10389166c08e84d708e7533d1f413e0aae51789a)
-rw-r--r--ld/ld.texi4
-rw-r--r--ld/ldlex.h1
-rw-r--r--ld/lexsup.c6
3 files changed, 11 insertions, 0 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index b3447050ed..ad2537454c 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -2360,6 +2360,10 @@ the section (@pxref{SECTIONS}).
@item --warn-shared-textrel
Warn if the linker adds a DT_TEXTREL to a shared object.
+@kindex --no-warn-shared-textrel
+@item --no-warn-shared-textrel
+Do not warn if the linker adds a DT_TEXTREL to a shared object.
+
@kindex --warn-alternate-em
@item --warn-alternate-em
Warn if an object has alternate ELF machine code.
diff --git a/ld/ldlex.h b/ld/ldlex.h
index 32a7a6409e..96f88bc365 100644
--- a/ld/ldlex.h
+++ b/ld/ldlex.h
@@ -131,6 +131,7 @@ enum option_values
OPTION_WARN_UNRESOLVED_SYMBOLS,
OPTION_ERROR_UNRESOLVED_SYMBOLS,
OPTION_WARN_SHARED_TEXTREL,
+ OPTION_NO_WARN_SHARED_TEXTREL,
OPTION_WARN_ALTERNATE_EM,
OPTION_REDUCE_MEMORY_OVERHEADS,
#ifdef ENABLE_PLUGINS
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 1c15ac29c0..a6c72b9e3b 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -514,6 +514,9 @@ static const struct ld_option ld_options[] =
{ {"warn-shared-textrel", no_argument, NULL, OPTION_WARN_SHARED_TEXTREL},
'\0', NULL, N_("Warn if shared object has DT_TEXTREL"),
TWO_DASHES },
+ { {"no-warn-shared-textrel", no_argument, NULL, OPTION_NO_WARN_SHARED_TEXTREL},
+ '\0', NULL, N_("Do not warn if shared object has DT_TEXTREL"),
+ TWO_DASHES },
{ {"warn-alternate-em", no_argument, NULL, OPTION_WARN_ALTERNATE_EM},
'\0', NULL, N_("Warn if an object has alternate ELF machine code"),
TWO_DASHES },
@@ -1441,6 +1444,9 @@ parse_args (unsigned argc, char **argv)
case OPTION_WARN_SHARED_TEXTREL:
link_info.warn_shared_textrel = TRUE;
break;
+ case OPTION_NO_WARN_SHARED_TEXTREL:
+ link_info.warn_shared_textrel = FALSE;
+ break;
case OPTION_WARN_ALTERNATE_EM:
link_info.warn_alternate_em = TRUE;
break;