aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-02-05 00:00:23 +0000
committerAlan Modra <amodra@gmail.com>2002-02-05 00:00:23 +0000
commit248866a8f545062eaa6eb6041ddb99747af0d601 (patch)
tree596f8bf85e1a06c4de97584c6c6ca8d7fe8a7179 /bfd
parent7dc472abdec9e6352fb29f2d1431b1a454608750 (diff)
downloadfsf-binutils-gdb-248866a8f545062eaa6eb6041ddb99747af0d601.zip
fsf-binutils-gdb-248866a8f545062eaa6eb6041ddb99747af0d601.tar.gz
fsf-binutils-gdb-248866a8f545062eaa6eb6041ddb99747af0d601.tar.bz2
* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
against section syms in readonly sections. Don't do the global sym check if we find one. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. (elf_s390_grok_prstatus): Add missing prototype.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elf32-hppa.c8
-rw-r--r--bfd/elf32-i386.c8
-rw-r--r--bfd/elf32-s390.c9
-rw-r--r--bfd/elf64-ppc.c8
-rw-r--r--bfd/elf64-s390.c8
6 files changed, 41 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9ab8714..0c9cbd6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2002-02-05 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
+ against section syms in readonly sections. Don't do the global
+ sym check if we find one.
+ * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
+ * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
+ * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
+ (elf_s390_grok_prstatus): Add missing prototype.
+
2002-02-04 Hans-Peter Nilsson <hp@bitrange.com>
* elf64-mmix.c (mmix_dump_bpo_gregs): New function.
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 0acfb19..41ec0ce 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -2329,10 +2329,12 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else
+ else if (p->count != 0)
{
srel = elf_section_data (p->sec)->sreloc;
srel->_raw_size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
}
}
}
@@ -2505,7 +2507,9 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info);
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
+ (PTR) info);
if ((info->flags & DF_TEXTREL) != 0)
{
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 6e79199..a1a7b5c 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1500,10 +1500,12 @@ elf_i386_size_dynamic_sections (output_bfd, info)
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else
+ else if (p->count != 0)
{
srel = elf_section_data (p->sec)->sreloc;
srel->_raw_size += p->count * sizeof (Elf32_External_Rel);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
}
}
}
@@ -1625,7 +1627,9 @@ elf_i386_size_dynamic_sections (output_bfd, info)
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info);
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
+ (PTR) info);
if ((info->flags & DF_TEXTREL) != 0)
{
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 0e7792f..0a913ef 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -69,6 +69,7 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class
static boolean elf_s390_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static boolean elf_s390_object_p PARAMS ((bfd *));
+static boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *));
#define USE_RELA 1 /* We want RELA relocations, not REL. */
@@ -1439,10 +1440,12 @@ elf_s390_size_dynamic_sections (output_bfd, info)
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else
+ else if (p->count != 0)
{
srela = elf_section_data (p->sec)->sreloc;
srela->_raw_size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
}
}
}
@@ -1564,7 +1567,9 @@ elf_s390_size_dynamic_sections (output_bfd, info)
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info);
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
+ (PTR) info);
if ((info->flags & DF_TEXTREL) != 0)
{
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 3e24e99..a945f5c 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2995,10 +2995,12 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else
+ else if (p->count != 0)
{
srel = elf_section_data (p->sec)->sreloc;
srel->_raw_size += p->count * sizeof (Elf64_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
}
}
}
@@ -3135,7 +3137,9 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info);
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
+ (PTR) info);
if ((info->flags & DF_TEXTREL) != 0)
{
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 210e152..efdf194 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1418,10 +1418,12 @@ elf_s390_size_dynamic_sections (output_bfd, info)
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else
+ else if (p->count != 0)
{
srela = elf_section_data (p->sec)->sreloc;
srela->_raw_size += p->count * sizeof (Elf64_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
}
}
}
@@ -1543,7 +1545,9 @@ elf_s390_size_dynamic_sections (output_bfd, info)
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, (PTR) info);
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
+ (PTR) info);
if ((info->flags & DF_TEXTREL) != 0)
{