aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf32-i386.c10
-rw-r--r--bfd/elf64-x86-64.c10
3 files changed, 21 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1220455..9732bea 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2015-02-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/17935
+ * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
+ warning for relocation in readonly section for -z text.
+ (elf_i386_size_dynamic_sections): Likewise.
+ * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
+ (elf_x86_64_size_dynamic_sections): Likewise.
+
2015-02-06 H.J. Lu <hongjiu.lu@intel.com>
PR ld/12365
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 439538e..dd4dbdc 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2600,8 +2600,9 @@ elf_i386_readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf)
info->flags |= DF_TEXTREL;
- if (info->warn_shared_textrel && info->shared)
- info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'.\n"),
+ if ((info->warn_shared_textrel && info->shared)
+ || info->error_textrel)
+ info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'\n"),
p->sec->owner, h->root.root.string,
p->sec);
@@ -2842,8 +2843,9 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
&& (info->flags & DF_TEXTREL) == 0)
{
info->flags |= DF_TEXTREL;
- if (info->warn_shared_textrel && info->shared)
- info->callbacks->einfo (_("%P: %B: warning: relocation in readonly section `%A'.\n"),
+ if ((info->warn_shared_textrel && info->shared)
+ || info->error_textrel)
+ info->callbacks->einfo (_("%P: %B: warning: relocation in readonly section `%A'\n"),
p->sec->owner, p->sec);
}
}
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 80136bf..5fd727b 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2850,8 +2850,9 @@ elf_x86_64_readonly_dynrelocs (struct elf_link_hash_entry *h,
info->flags |= DF_TEXTREL;
- if (info->warn_shared_textrel && info->shared)
- info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'.\n"),
+ if ((info->warn_shared_textrel && info->shared)
+ || info->error_textrel)
+ info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'\n"),
p->sec->owner, h->root.root.string,
p->sec);
@@ -3090,8 +3091,9 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
&& (info->flags & DF_TEXTREL) == 0)
{
info->flags |= DF_TEXTREL;
- if (info->warn_shared_textrel && info->shared)
- info->callbacks->einfo (_("%P: %B: warning: relocation in readonly section `%A'.\n"),
+ if ((info->warn_shared_textrel && info->shared)
+ || info->error_textrel)
+ info->callbacks->einfo (_("%P: %B: warning: relocation in readonly section `%A'\n"),
p->sec->owner, p->sec);
}
}