/* BFD back-end for HP PA-RISC ELF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ Free Software Foundation, Inc.
Original code by
Center for Software Science
/* Set if we need a .plt stub to support lazy dynamic linking. */
unsigned int need_plt_stub:1;
- /* Small local sym to section mapping cache. */
- struct sym_sec_cache sym_sec;
+ /* Small local sym cache. */
+ struct sym_cache sym_cache;
/* Data for LDM relocations. */
union
/* Various hash macros and functions. */
#define hppa_link_hash_table(p) \
- ((struct elf32_hppa_link_hash_table *) ((p)->hash))
+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
+ == HPPA32_ELF_DATA ? ((struct elf32_hppa_link_hash_table *) ((p)->hash)) : NULL)
#define hppa_elf_hash_entry(ent) \
((struct elf32_hppa_link_hash_entry *)(ent))
return NULL;
if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd, hppa_link_hash_newfunc,
- sizeof (struct elf32_hppa_link_hash_entry)))
+ sizeof (struct elf32_hppa_link_hash_entry),
+ HPPA32_ELF_DATA))
{
free (htab);
return NULL;
htab->has_17bit_branch = 0;
htab->has_22bit_branch = 0;
htab->need_plt_stub = 0;
- htab->sym_sec.abfd = NULL;
+ htab->sym_cache.abfd = NULL;
htab->tls_ldm_got.refcount = 0;
return &htab->etab.root;
info = (struct bfd_link_info *)in_arg;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
stub_sec = hsh->stub_sec;
/* Make a note of the offset within the stubs for this entry. */
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0)
{
- /* GCC on hppa-linux produces binaries with OSABI=Linux,
+ /* GCC on hppa-linux produces binaries with OSABI=GNU,
but the kernel produces corefiles with OSABI=SysV. */
- if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_GNU &&
i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
/* Don't try to create the .plt and .got twice. */
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
if (htab->splt != NULL)
return TRUE;
htab->srelplt = bfd_get_section_by_name (abfd, ".rela.plt");
htab->sgot = bfd_get_section_by_name (abfd, ".got");
- htab->srelgot = bfd_make_section_with_flags (abfd, ".rela.got",
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY));
- if (htab->srelgot == NULL
- || ! bfd_set_section_alignment (abfd, htab->srelgot, 2))
- return FALSE;
+ htab->srelgot = bfd_get_section_by_name (abfd, ".rela.got");
htab->sdynbss = bfd_get_section_by_name (abfd, ".dynbss");
htab->srelbss = bfd_get_section_by_name (abfd, ".rela.bss");
return r_type;
}
+/* Return a pointer to the local GOT, PLT and TLS reference counts
+ for ABFD. Returns NULL if the storage allocation fails. */
+
+static bfd_signed_vma *
+hppa32_elf_local_refcounts (bfd *abfd)
+{
+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ bfd_signed_vma *local_refcounts;
+
+ local_refcounts = elf_local_got_refcounts (abfd);
+ if (local_refcounts == NULL)
+ {
+ bfd_size_type size;
+
+ /* Allocate space for local GOT and PLT reference
+ counts. Done this way to save polluting elf_obj_tdata
+ with another target specific pointer. */
+ size = symtab_hdr->sh_info;
+ size *= 2 * sizeof (bfd_signed_vma);
+ /* Add in space to store the local GOT TLS types. */
+ size += symtab_hdr->sh_info;
+ local_refcounts = bfd_zalloc (abfd, size);
+ if (local_refcounts == NULL)
+ return NULL;
+ elf_local_got_refcounts (abfd) = local_refcounts;
+ memset (hppa_elf_local_got_tls_type (abfd), GOT_UNKNOWN,
+ symtab_hdr->sh_info);
+ }
+ return local_refcounts;
+}
+
+
/* Look through the relocs for a section during the first phase, and
calculate needed space in the global offset table, procedure linkage
table, and dynamic reloc sections. At this point we haven't
const Elf_Internal_Rela *rela_end;
struct elf32_hppa_link_hash_table *htab;
asection *sreloc;
- asection *stubreloc;
int tls_type = GOT_UNKNOWN, old_tls_type = GOT_UNKNOWN;
if (info->relocatable)
return TRUE;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
eh_syms = elf_sym_hashes (abfd);
sreloc = NULL;
- stubreloc = NULL;
rela_end = relocs + sec->reloc_count;
for (rela = relocs; rela < rela_end; rela++)
if (r_type == R_PARISC_TLS_LDM21L
|| r_type == R_PARISC_TLS_LDM14R)
- hppa_link_hash_table (info)->tls_ldm_got.refcount += 1;
+ htab->tls_ldm_got.refcount += 1;
else
{
if (hh != NULL)
bfd_signed_vma *local_got_refcounts;
/* This is a global offset table entry for a local symbol. */
- local_got_refcounts = elf_local_got_refcounts (abfd);
+ local_got_refcounts = hppa32_elf_local_refcounts (abfd);
if (local_got_refcounts == NULL)
- {
- bfd_size_type size;
-
- /* Allocate space for local got offsets and local
- plt offsets. Done this way to save polluting
- elf_obj_tdata with another target specific
- pointer. */
- size = symtab_hdr->sh_info;
- size *= 2 * sizeof (bfd_signed_vma);
- /* Add in space to store the local GOT TLS types. */
- size += symtab_hdr->sh_info;
- local_got_refcounts = bfd_zalloc (abfd, size);
- if (local_got_refcounts == NULL)
- return FALSE;
- elf_local_got_refcounts (abfd) = local_got_refcounts;
- memset (hppa_elf_local_got_tls_type (abfd),
- GOT_UNKNOWN, symtab_hdr->sh_info);
- }
+ return FALSE;
local_got_refcounts[r_symndx] += 1;
old_tls_type = hppa_elf_local_got_tls_type (abfd) [r_symndx];
bfd_signed_vma *local_got_refcounts;
bfd_signed_vma *local_plt_refcounts;
- local_got_refcounts = elf_local_got_refcounts (abfd);
+ local_got_refcounts = hppa32_elf_local_refcounts (abfd);
if (local_got_refcounts == NULL)
- {
- bfd_size_type size;
-
- /* Allocate space for local got offsets and local
- plt offsets. */
- size = symtab_hdr->sh_info;
- size *= 2 * sizeof (bfd_signed_vma);
- /* Add in space to store the local GOT TLS types. */
- size += symtab_hdr->sh_info;
- local_got_refcounts = bfd_zalloc (abfd, size);
- if (local_got_refcounts == NULL)
- return FALSE;
- elf_local_got_refcounts (abfd) = local_got_refcounts;
- }
+ return FALSE;
local_plt_refcounts = (local_got_refcounts
+ symtab_hdr->sh_info);
local_plt_refcounts[r_symndx] += 1;
this reloc. */
if (sreloc == NULL)
{
- char *name;
- bfd *dynobj;
-
- name = (bfd_elf_string_from_elf_section
- (abfd,
- elf_elfheader (abfd)->e_shstrndx,
- elf_section_data (sec)->rel_hdr.sh_name));
- if (name == NULL)
- {
- (*_bfd_error_handler)
- (_("Could not find relocation section for %s"),
- sec->name);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
-
if (htab->etab.dynobj == NULL)
htab->etab.dynobj = abfd;
- dynobj = htab->etab.dynobj;
- sreloc = bfd_get_section_by_name (dynobj, name);
+ sreloc = _bfd_elf_make_dynamic_reloc_section
+ (sec, htab->etab.dynobj, 2, abfd, /*rela?*/ TRUE);
+
if (sreloc == NULL)
{
- flagword flags;
-
- flags = (SEC_HAS_CONTENTS | SEC_READONLY
- | SEC_IN_MEMORY | SEC_LINKER_CREATED);
- if ((sec->flags & SEC_ALLOC) != 0)
- flags |= SEC_ALLOC | SEC_LOAD;
- sreloc = bfd_make_section_with_flags (dynobj,
- name,
- flags);
- if (sreloc == NULL
- || !bfd_set_section_alignment (dynobj, sreloc, 2))
- return FALSE;
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
-
- elf_section_data (sec)->sreloc = sreloc;
}
/* If this is a global symbol, we count the number of
/* Track dynamic relocs needed for local syms too.
We really need local syms available to do this
easily. Oh well. */
-
asection *sr;
void *vpp;
+ Elf_Internal_Sym *isym;
- sr = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
- sec, r_symndx);
- if (sr == NULL)
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ if (isym == NULL)
return FALSE;
+ sr = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ if (sr == NULL)
+ sr = sec;
+
vpp = &elf_section_data (sr)->local_dynrel;
hdh_head = (struct elf32_hppa_dyn_reloc_entry **) vpp;
}
bfd_signed_vma *local_got_refcounts;
bfd_signed_vma *local_plt_refcounts;
const Elf_Internal_Rela *rela, *relend;
+ struct elf32_hppa_link_hash_table *htab;
if (info->relocatable)
return TRUE;
+ htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
elf_section_data (sec)->local_dynrel = NULL;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
case R_PARISC_TLS_LDM21L:
case R_PARISC_TLS_LDM14R:
- hppa_link_hash_table (info)->tls_ldm_got.refcount -= 1;
+ htab->tls_ldm_got.refcount -= 1;
break;
case R_PARISC_PCREL12F:
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
}
}
- if (! hppa_elf_hash_entry (eh)->plabel)
+ /* STT_GNU_IFUNC symbol must go through PLT. */
+ if (! hppa_elf_hash_entry (eh)->plabel
+ && eh->type != STT_GNU_IFUNC)
{
eh->needs_plt = 0;
- eh->plt = elf_hash_table (info)->init_plt_refcount;
+ eh->plt = elf_hash_table (info)->init_plt_offset;
}
}
if (eh->type == STT_FUNC
|| eh->needs_plt)
{
+ /* If the symbol is used by a plabel, we must allocate a PLT slot.
+ The refcounts are not reliable when it has been hidden since
+ hide_symbol can be called before the plabel flag is set. */
+ if (hppa_elf_hash_entry (eh)->plabel
+ && eh->plt.refcount <= 0)
+ eh->plt.refcount = 1;
+
if (eh->plt.refcount <= 0
|| (eh->def_regular
&& eh->root.type != bfd_link_hash_defweak
same memory location for the variable. */
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
/* We must generate a COPY reloc to tell the dynamic linker to
copy the initial value out of the dynamic object and into the
if (eh->root.type == bfd_link_hash_indirect)
return TRUE;
- if (eh->root.type == bfd_link_hash_warning)
- eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
-
info = (struct bfd_link_info *) inf;
hh = hppa_elf_hash_entry (eh);
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
if (htab->etab.dynamic_sections_created
&& eh->plt.refcount > 0)
{
if (eh->root.type == bfd_link_hash_indirect)
return TRUE;
- if (eh->root.type == bfd_link_hash_warning)
- eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
-
info = inf;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
hh = hppa_elf_hash_entry (eh);
if (htab->etab.dynamic_sections_created
clobber_millicode_symbols (struct elf_link_hash_entry *eh,
struct bfd_link_info *info)
{
- if (eh->root.type == bfd_link_hash_warning)
- eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
-
if (eh->type == STT_PARISC_MILLI
&& !eh->forced_local)
{
struct elf32_hppa_link_hash_entry *hh;
struct elf32_hppa_dyn_reloc_entry *hdh_p;
- if (eh->root.type == bfd_link_hash_warning)
- eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
-
hh = hppa_elf_hash_entry (eh);
for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->hdh_next)
{
bfd_boolean relocs;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
dynobj = htab->etab.dynobj;
if (dynobj == NULL)
abort ();
bfd_size_type amt;
struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return -1;
+
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
input_bfd != NULL;
{
struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return;
+
if (isec->output_section->index <= htab->top_index)
{
asection **list = htab->input_list + isec->output_section->index;
int stub_changed = 0;
struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return -1;
+
/* We want to read in symbol extension records only once. To do this
we need to read in the local symbols in parallel and save them for
later use; so hold pointers to the local symbols in an array. */
bfd_boolean stub_changed;
struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
/* Stash our params away. */
htab->stub_bfd = stub_bfd;
htab->multi_subspace = multi_subspace;
/* It's a local symbol. */
Elf_Internal_Sym *sym;
Elf_Internal_Shdr *hdr;
+ unsigned int shndx;
sym = local_syms + r_indx;
- hdr = elf_elfsections (input_bfd)[sym->st_shndx];
- sym_sec = hdr->bfd_section;
if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
sym_value = sym->st_value;
- destination = (sym_value + irela->r_addend
- + sym_sec->output_offset
- + sym_sec->output_section->vma);
+ shndx = sym->st_shndx;
+ if (shndx < elf_numsections (input_bfd))
+ {
+ hdr = elf_elfsections (input_bfd)[shndx];
+ sym_sec = hdr->bfd_section;
+ destination = (sym_value + irela->r_addend
+ + sym_sec->output_offset
+ + sym_sec->output_section->vma);
+ }
}
else
{
struct elf32_hppa_link_hash_table *htab;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
h = bfd_link_hash_lookup (&htab->etab.root, "$global$", FALSE, FALSE, FALSE);
if (h != NULL
struct elf32_hppa_link_hash_table *htab;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
for (stub_sec = htab->stub_bfd->sections;
stub_sec != NULL;
/* If we're producing a final executable, sort the contents of the
unwind section. */
+ if (info->relocatable)
+ return TRUE;
+
return elf_hppa_sort_unwind (abfd);
}
struct elf32_hppa_link_hash_table *htab;
htab = (struct elf32_hppa_link_hash_table*) data;
+ if (htab == NULL)
+ return;
if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
switch (r_type)
{
case R_PARISC_DLTIND21L:
+ case R_PARISC_TLS_GD21L:
+ case R_PARISC_TLS_LDM21L:
+ case R_PARISC_TLS_IE21L:
r_type = R_PARISC_DPREL21L;
break;
case R_PARISC_DLTIND14R:
+ case R_PARISC_TLS_GD14R:
+ case R_PARISC_TLS_LDM14R:
+ case R_PARISC_TLS_IE14R:
r_type = R_PARISC_DPREL14R;
break;
most efficient way of using PIC code in an incomplete executable,
but the user must follow the standard runtime conventions for
accessing data for this to work. */
- if (orig_r_type == R_PARISC_DLTIND21L)
- {
- /* Convert addil instructions if the original reloc was a
- DLTIND21L. GCC sometimes uses a register other than r19 for
- the operation, so we must convert any addil instruction
- that uses this relocation. */
- if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
- insn = ADDIL_DP;
- else
- /* We must have a ldil instruction. It's too hard to find
- and convert the associated add instruction, so issue an
- error. */
- (*_bfd_error_handler)
- (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
- input_bfd,
- input_section,
- offset,
- howto->name,
- insn);
- }
- else if (orig_r_type == R_PARISC_DLTIND14F)
+ if (orig_r_type != r_type)
{
- /* This must be a format 1 load/store. Change the base
- register to dp. */
- insn = (insn & 0xfc1ffff) | (27 << 21);
+ if (r_type == R_PARISC_DPREL21L)
+ {
+ /* GCC sometimes uses a register other than r19 for the
+ operation, so we must convert any addil instruction
+ that uses this relocation. */
+ if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
+ insn = ADDIL_DP;
+ else
+ /* We must have a ldil instruction. It's too hard to find
+ and convert the associated add instruction, so issue an
+ error. */
+ (*_bfd_error_handler)
+ (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
+ input_bfd,
+ input_section,
+ (long) offset,
+ howto->name,
+ insn);
+ }
+ else if (r_type == R_PARISC_DPREL14F)
+ {
+ /* This must be a format 1 load/store. Change the base
+ register to dp. */
+ insn = (insn & 0xfc1ffff) | (27 << 21);
+ }
}
- /* For all the DP relative relocations, we need to examine the symbol's
- section. If it has no section or if it's a code section, then
- "data pointer relative" makes no sense. In that case we don't
- adjust the "value", and for 21 bit addil instructions, we change the
- source addend register from %dp to %r0. This situation commonly
- arises for undefined weak symbols and when a variable's "constness"
- is declared differently from the way the variable is defined. For
- instance: "extern int foo" with foo defined as "const int foo". */
+ /* For all the DP relative relocations, we need to examine the symbol's
+ section. If it has no section or if it's a code section, then
+ "data pointer relative" makes no sense. In that case we don't
+ adjust the "value", and for 21 bit addil instructions, we change the
+ source addend register from %dp to %r0. This situation commonly
+ arises for undefined weak symbols and when a variable's "constness"
+ is declared differently from the way the variable is defined. For
+ instance: "extern int foo" with foo defined as "const int foo". */
if (sym_sec == NULL || (sym_sec->flags & SEC_CODE) != 0)
{
if ((insn & ((0x3f << 26) | (0x1f << 21)))
case R_PARISC_DLTIND14R:
case R_PARISC_DLTIND14F:
case R_PARISC_TLS_GD21L:
- case R_PARISC_TLS_GD14R:
case R_PARISC_TLS_LDM21L:
- case R_PARISC_TLS_LDM14R:
case R_PARISC_TLS_IE21L:
+ case R_PARISC_TLS_GD14R:
+ case R_PARISC_TLS_LDM14R:
case R_PARISC_TLS_IE14R:
value -= elf_gp (input_section->output_section->owner);
break;
(_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
input_bfd,
input_section,
- offset,
+ (long) offset,
hsh->bh_root.string);
bfd_set_error (bfd_error_bad_value);
return bfd_reloc_notsupported;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
local_got_offsets = elf_local_got_offsets (input_bfd);
rela = relocs;
}
if (sym_sec != NULL && elf_discarded_section (sym_sec))
- {
- /* For relocs against symbols from removed linkonce
- sections, or sections discarded by a linker script,
- we just want the section contents zeroed. Avoid any
- special processing. */
- _bfd_clear_contents (elf_hppa_howto_table + r_type, input_bfd,
- contents + rela->r_offset);
- rela->r_info = 0;
- rela->r_addend = 0;
- continue;
- }
+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+ rela, relend,
+ elf_hppa_howto_table + r_type,
+ contents);
if (info->relocatable)
continue;
bfd_byte *loc;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
if (eh->plt.offset != (bfd_vma) -1)
{
elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
{
/* Handle TLS relocs first; we don't want them to be marked
- relative by the "if (ELF32_R_SYM (rela->r_info) == 0)"
+ relative by the "if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)"
check below. */
switch ((int) ELF32_R_TYPE (rela->r_info))
{
return reloc_class_normal;
}
- if (ELF32_R_SYM (rela->r_info) == 0)
+ if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)
return reloc_class_relative;
switch ((int) ELF32_R_TYPE (rela->r_info))
bfd *dynobj;
struct elf32_hppa_link_hash_table *htab;
asection *sdyn;
+ asection * sgot;
htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
dynobj = htab->etab.dynobj;
+ sgot = htab->sgot;
+ /* A broken linker script might have discarded the dynamic sections.
+ Catch this here so that we do not seg-fault later on. */
+ if (sgot != NULL && bfd_is_abs_section (sgot->output_section))
+ return FALSE;
+
sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
if (htab->etab.dynamic_sections_created)
}
}
- if (htab->sgot != NULL && htab->sgot->size != 0)
+ if (sgot != NULL && sgot->size != 0)
{
/* Fill in the first entry in the global offset table.
We use it to point to our dynamic section, if we have one. */
bfd_put_32 (output_bfd,
sdyn ? sdyn->output_section->vma + sdyn->output_offset : 0,
- htab->sgot->contents);
+ sgot->contents);
/* The second entry is reserved for use by the dynamic linker. */
- memset (htab->sgot->contents + GOT_ENTRY_SIZE, 0, GOT_ENTRY_SIZE);
+ memset (sgot->contents + GOT_ENTRY_SIZE, 0, GOT_ENTRY_SIZE);
/* Set .got entry size. */
- elf_section_data (htab->sgot->output_section)
+ elf_section_data (sgot->output_section)
->this_hdr.sh_entsize = GOT_ENTRY_SIZE;
}
if ((htab->splt->output_offset
+ htab->splt->output_section->vma
+ htab->splt->size)
- != (htab->sgot->output_offset
- + htab->sgot->output_section->vma))
+ != (sgot->output_offset
+ + sgot->output_section->vma))
{
(*_bfd_error_handler)
(_(".got section not immediately after .plt section"));
/* Misc BFD support code. */
#define bfd_elf32_bfd_is_local_label_name elf_hppa_is_local_label_name
#define bfd_elf32_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup
#define elf_info_to_howto elf_hppa_info_to_howto
#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel
#define TARGET_BIG_SYM bfd_elf32_hppa_vec
#define TARGET_BIG_NAME "elf32-hppa"
#define ELF_ARCH bfd_arch_hppa
+#define ELF_TARGET_ID HPPA32_ELF_DATA
#define ELF_MACHINE_CODE EM_PARISC
#define ELF_MAXPAGESIZE 0x1000
#define ELF_OSABI ELFOSABI_HPUX
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-hppa-linux"
#undef ELF_OSABI
-#define ELF_OSABI ELFOSABI_LINUX
+#define ELF_OSABI ELFOSABI_GNU
#undef elf32_bed
#define elf32_bed elf32_hppa_linux_bed