aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-03-01 12:35:03 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2019-10-13 05:48:22 +0200
commitf8057df862ec647f228e2ad1fde05da079eb67c7 (patch)
tree5dbafbd0403e76a0bcb47ca359495abed3060fdd
parentGentoo: Pass --no-warn-shared-textrel to ld in its testsuite (diff)
downloadbinutils-gdb-f8057df862ec647f228e2ad1fde05da079eb67c7.tar.gz
binutils-gdb-f8057df862ec647f228e2ad1fde05da079eb67c7.tar.bz2
binutils-gdb-f8057df862ec647f228e2ad1fde05da079eb67c7.zip
Gentoo: Restore TEXTREL warnings for non-shared objects, fix tests accordingly
(cherry picked from commit 0c4fa652ef81b030beaaaa358c1a535006f0a52e) (cherry picked from commit 474f0cf721ac221f235a6f49df06eb5b81e65d0c) (cherry picked from commit 8dcb963e1da3b13ce9045ef520f2903fb2407d32)
-rw-r--r--bfd/elflink.c4
-rw-r--r--ld/testsuite/ld-i386/warn1.d2
2 files changed, 3 insertions, 3 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 16d83bb7a3..de13c06437 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12756,7 +12756,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
goto error_return;
/* Check for DT_TEXTREL (late, in case the backend removes it). */
- if (((info->warn_shared_textrel && bfd_link_pic (info))
+ if ((info->warn_shared_textrel
|| info->error_textrel)
&& (o = bfd_get_linker_section (dynobj, ".dynamic")) != NULL)
{
@@ -12777,7 +12777,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
(_("%P%X: read-only segment has dynamic relocations\n"));
else
info->callbacks->einfo
- (_("%P: warning: creating a DT_TEXTREL in a shared object\n"));
+ (_("%P: warning: creating a DT_TEXTREL in object\n"));
break;
}
}
diff --git a/ld/testsuite/ld-i386/warn1.d b/ld/testsuite/ld-i386/warn1.d
index 3c78f31efd..49bcb5171f 100644
--- a/ld/testsuite/ld-i386/warn1.d
+++ b/ld/testsuite/ld-i386/warn1.d
@@ -1,4 +1,4 @@
#name: --warn-shared-textrel --fatal-warnings
#as: --32
#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings
-#error: .*warning: creating a DT_TEXTREL in a shared object
+#error: .*warning: creating a DT_TEXTREL in object