aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-06-01 19:42:01 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-06-01 19:42:01 +0000
commit4b819e1f6e40e09d3d2b73b76afa007b842b3857 (patch)
tree478f6fce4d680ae898375e50e463673cbd08fc59 /bfd/elf64-x86-64.c
parent248d2a8fdcb2f5b0eba8f189ed55bac41480ca21 (diff)
downloadgdb-4b819e1f6e40e09d3d2b73b76afa007b842b3857.zip
gdb-4b819e1f6e40e09d3d2b73b76afa007b842b3857.tar.gz
gdb-4b819e1f6e40e09d3d2b73b76afa007b842b3857.tar.bz2
Properly warn relocation in readonly section in a shared object.
2011-06-01 H.J. Lu <hongjiu.lu@intel.com> * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn relocation in readonly section in a shared object. * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 5cbaff8..9d6d4a4 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2399,13 +2399,13 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
{
srel = elf_section_data (p->sec)->sreloc;
srel->size += p->count * bed->s->sizeof_rela;
- if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0
+ && (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"),
p->sec->owner, p->sec);
- break;
}
}
}