/* Support for HPPA 64-bit ELF
- Copyright (C) 1999-2019 Free Software Foundation, Inc.
+ Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
static bfd_boolean elf64_hppa_object_p
(bfd *);
-static void elf64_hppa_post_process_headers
- (bfd *, struct bfd_link_info *);
-
static bfd_boolean elf64_hppa_create_dynamic_sections
(bfd *, struct bfd_link_info *);
elf64_hppa_hash_table_create (bfd *abfd)
{
struct elf64_hppa_link_hash_table *htab;
- bfd_size_type amt = sizeof (*htab);
+ size_t amt = sizeof (*htab);
htab = bfd_zmalloc (amt);
if (htab == NULL)
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
return FALSE;
- return TRUE;
+ return ((hdr->sh_flags & SHF_PARISC_SHORT) == 0
+ || bfd_set_section_flags (hdr->bfd_section,
+ hdr->bfd_section->flags | SEC_SMALL_DATA));
}
/* SEC is a section containing relocs for an input BFD when linking; return
?!? Note we leak the last section_syms array. Presumably we
could free it in one of the later routines in this file. */
- if (hppa_info->section_syms)
- free (hppa_info->section_syms);
+ free (hppa_info->section_syms);
/* Read this BFD's local symbols. */
if (symtab_hdr->sh_info != 0)
/* HP requires the EI_OSABI field to be filled in. The assignment to
EI_ABIVERSION may not be strictly necessary. */
-static void
-elf64_hppa_post_process_headers (bfd *abfd,
- struct bfd_link_info *link_info ATTRIBUTE_UNUSED)
+static bfd_boolean
+elf64_hppa_init_file_header (bfd *abfd, struct bfd_link_info *info)
{
- Elf_Internal_Ehdr * i_ehdrp;
+ Elf_Internal_Ehdr *i_ehdrp;
- i_ehdrp = elf_elfheader (abfd);
+ if (!_bfd_elf_init_file_header (abfd, info))
+ return FALSE;
+ i_ehdrp = elf_elfheader (abfd);
i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
i_ehdrp->e_ident[EI_ABIVERSION] = 1;
+ return TRUE;
}
/* Create function descriptor section (.opd). This section is called .opd
/* Do not attempt to sort non-regular files. This is here
especially for configure scripts and kernel builds which run
tests with "ld [...] -o /dev/null". */
- if (stat (abfd->filename, &buf) != 0
+ if (stat (bfd_get_filename (abfd), &buf) != 0
|| !S_ISREG(buf.st_mode))
return TRUE;
else if (!bfd_link_relocatable (info))
{
bfd_boolean err;
- err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
- || ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT);
- (*info->callbacks->undefined_symbol) (info,
- eh->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset, err);
+
+ err = (info->unresolved_syms_in_objects == RM_DIAGNOSE
+ && !info->warn_unresolved_syms)
+ || ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT;
+
+ info->callbacks->undefined_symbol
+ (info, eh->root.root.string, input_bfd,
+ input_section, rel->r_offset, err);
}
if (!bfd_link_relocatable (info)
if (info->unresolved_syms_in_objects == RM_IGNORE
&& ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT
&& eh->type == STT_PARISC_MILLI)
- (*info->callbacks->undefined_symbol)
+ info->callbacks->undefined_symbol
(info, eh_name (eh), input_bfd,
input_section, rel->r_offset, FALSE);
}
#define elf_backend_create_dynamic_sections \
elf64_hppa_create_dynamic_sections
-#define elf_backend_post_process_headers elf64_hppa_post_process_headers
+#define elf_backend_init_file_header elf64_hppa_init_file_header
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all