summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-07-10 02:29:22 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-07-10 02:29:22 +0000
commit5d21d768b2c9f3601cbb00aa36a5ec22bacf93df (patch)
tree9f6c3a9c7f6dc298b58f5ddb2655b080c986678d /contrib/binutils/bfd
parentc497cd3792b4bca40349c51f22dfd4c77c77ec9f (diff)
downloadFreeBSD-src-5d21d768b2c9f3601cbb00aa36a5ec22bacf93df.zip
FreeBSD-src-5d21d768b2c9f3601cbb00aa36a5ec22bacf93df.tar.gz
Teach our toolchain how to generate 64-bit PowerPC binaries. This fixes
a variety of bugs in binutils related to handling of 64-bit PPC ELF, provides a GCC configuration for 64-bit PowerPC on FreeBSD, and associated build systems tweaks. Obtained from: projects/ppc64
Diffstat (limited to 'contrib/binutils/bfd')
-rw-r--r--contrib/binutils/bfd/elf64-ppc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/binutils/bfd/elf64-ppc.c b/contrib/binutils/bfd/elf64-ppc.c
index a0d81d0..bc9e0a7 100644
--- a/contrib/binutils/bfd/elf64-ppc.c
+++ b/contrib/binutils/bfd/elf64-ppc.c
@@ -3268,13 +3268,13 @@ create_got_section (bfd *abfd, struct bfd_link_info *info)
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
- got = bfd_make_section (abfd, ".got");
+ got = bfd_make_section_anyway (abfd, ".got");
if (!got
|| !bfd_set_section_flags (abfd, got, flags)
|| !bfd_set_section_alignment (abfd, got, 3))
return FALSE;
- relgot = bfd_make_section (abfd, ".rela.got");
+ relgot = bfd_make_section_anyway (abfd, ".rela.got");
if (!relgot
|| ! bfd_set_section_flags (abfd, relgot, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, relgot, 3))
@@ -6033,6 +6033,10 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
{
+ /* Skip this BFD if it is not ELF */
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
+ continue;
+
s = ppc64_elf_tdata (ibfd)->got;
if (s != NULL && s != htab->got)
{
@@ -7206,7 +7210,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
stub_sec->_cooked_size = 0;
}
- if (htab->plt != NULL)
+ if (htab->glink != NULL && htab->glink->contents != NULL)
{
unsigned int indx;
bfd_vma plt0;
@@ -9000,6 +9004,10 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
while ((dynobj = dynobj->link_next) != NULL)
{
asection *s;
+
+ if (bfd_get_flavour (dynobj) != bfd_target_elf_flavour)
+ continue;
+
s = ppc64_elf_tdata (dynobj)->got;
if (s != NULL
&& s->_raw_size != 0
OpenPOWER on IntegriCloud