/* PowerPC-specific support for 32-bit ELF
- Copyright (C) 1994-2019 Free Software Foundation, Inc.
+ Copyright (C) 1994-2020 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
return FALSE;
newsect = hdr->bfd_section;
- flags = bfd_section_flags (newsect);
+ flags = 0;
if (hdr->sh_flags & SHF_EXCLUDE)
flags |= SEC_EXCLUDE;
if (hdr->sh_type == SHT_ORDERED)
flags |= SEC_SORT_ENTRIES;
- bfd_set_section_flags (newsect, flags);
- return TRUE;
+ if (strncmp (name, ".PPC.EMB", 8) == 0)
+ name += 8;
+ if (strncmp (name, ".sbss", 5) == 0
+ || strncmp (name, ".sdata", 6) == 0)
+ flags |= SEC_SMALL_DATA;
+
+ return (flags == 0
+ || bfd_set_section_flags (newsect, newsect->flags | flags));
}
/* Set up any other section flags and such that may be necessary. */
for (m = elf_seg_map (abfd); m != NULL; m = m->next)
{
struct elf_segment_map *n;
- bfd_size_type amt;
+ size_t amt;
unsigned int j, k;
unsigned int p_flags;
bfd_vma stub_off;
asymbol *s;
arelent *p;
- long count, i, stub_delta;
+ size_t count, i, stub_delta;
size_t size;
char *names;
bfd_byte buf[4];
break;
if (ent == NULL)
{
- bfd_size_type amt = sizeof (*ent);
+ size_t amt = sizeof (*ent);
ent = bfd_alloc (abfd, amt);
if (ent == NULL)
return FALSE;
if (!ppc_elf_merge_obj_attributes (ibfd, info))
return FALSE;
+ if ((ibfd->flags & DYNAMIC) != 0)
+ return TRUE;
+
new_flags = elf_elfheader (ibfd)->e_flags;
old_flags = elf_elfheader (obfd)->e_flags;
if (!elf_flags_init (obfd))
case R_PPC_VLE_ADDR20:
ppc_elf_vle_split20 (output_bfd, contents + rel->r_offset, relocation);
- continue;
+ goto copy_reloc;
/* Relocate against the beginning of the section. */
case R_PPC_SECTOFF: