summaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-05-19 06:58:44 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-05-19 06:58:44 +0000
commit5a660903f6882ccbeebabde0f22badd8b68d26be (patch)
tree8c4a30f4ca256e1d7b5dfa85b5f676b08c0231ef /bfd/elf32-ppc.c
parentae41a1660054bef9160b3d0dc4437f710cd2fdb1 (diff)
downloadbinutils-redhat-5a660903f6882ccbeebabde0f22badd8b68d26be.tar.gz
bfd/
* elf32-ppc.h (has_vle_insns, is_ppc_vle): Delete. (has_tls_reloc, has_tls_get_addr_call): Move back to.. * elf32-ppc.c: ..here. (ppc_elf_section_flags, elf_backend_section_flags): Delete. (ppc_elf_modify_segment_map): Use ELF sh_flags to detect VLE sections. opcodes/ * ppc-dis.c: Don't include elf32-ppc.h, do include elf/ppc.h. (get_powerpc_dialect): Detect VLE sections from ELF sh_flags. ld/testsuite/ * ld-powerpc/vle.ld: New. * ld-powerpc/powerpc.exp (vle reloc tests): Link using vle.ld.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 63d77d26a5..fabd06530b 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2246,15 +2246,6 @@ ppc_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, ...)
}
}
-static bfd_boolean
-ppc_elf_section_flags (flagword *flags ATTRIBUTE_UNUSED,
- const Elf_Internal_Shdr *hdr)
-{
- if (hdr->sh_flags & SHF_PPC_VLE)
- hdr->bfd_section->has_vle_insns = 1;
- return TRUE;
-}
-
static flagword
ppc_elf_lookup_section_flags (char *flag_name)
{
@@ -2372,17 +2363,17 @@ ppc_elf_modify_segment_map (bfd *abfd,
if (m->count == 0)
continue;
- sect0_vle = is_ppc_vle (m->sections[0]);
+ sect0_vle = (elf_section_flags (m->sections[0]) & SHF_PPC_VLE) != 0;
for (j = 1; j < m->count; ++j)
{
- if (is_ppc_vle (m->sections[j]) != sect0_vle)
+ sectj_vle = (elf_section_flags (m->sections[j]) & SHF_PPC_VLE) != 0;
+
+ if (sectj_vle != sect0_vle)
break;
}
if (j >= m->count)
continue;
- sectj_vle = is_ppc_vle (m->sections[j]);
-
/* sections 0..j-1 stay in this (current) segment,
the remainder are put in a new segment.
The scan resumes with the new segment. */
@@ -3120,6 +3111,15 @@ struct ppc_elf_link_hash_table
struct sym_cache sym_cache;
};
+/* Rename some of the generic section flags to better document how they
+ are used for ppc32. The flags are only valid for ppc32 elf objects. */
+
+/* Nonzero if this section has TLS related relocations. */
+#define has_tls_reloc sec_flg0
+
+/* Nonzero if this section has a call to __tls_get_addr. */
+#define has_tls_get_addr_call sec_flg1
+
/* Get the PPC ELF linker hash table from a link_info structure. */
#define ppc_elf_hash_table(p) \
@@ -9710,7 +9710,6 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define elf_backend_lookup_section_flags_hook ppc_elf_lookup_section_flags
-#define elf_backend_section_flags ppc_elf_section_flags
#define elf_backend_section_processing ppc_elf_section_processing
#include "elf32-target.h"