binutils-gdb/bfd/elf64-hppa.c

4047 lines
119 KiB
C
Raw Normal View History

2001-01-14 06:22:51 +01:00
/* Support for HPPA 64-bit ELF
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
PR 14072 * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * sysdep.h: Generate an error if included before config.h. * alpha-opc.c: Include sysdep.h before any other header file. * alpha-dis.c: Likewise. * avr-dis.c: Likewise. * cgen-opc.c: Likewise. * cr16-dis.c: Likewise. * cris-dis.c: Likewise. * crx-dis.c: Likewise. * d10v-dis.c: Likewise. * d10v-opc.c: Likewise. * d30v-dis.c: Likewise. * d30v-opc.c: Likewise. * h8500-dis.c: Likewise. * i370-dis.c: Likewise. * i370-opc.c: Likewise. * m10200-dis.c: Likewise. * m10300-dis.c: Likewise. * micromips-opc.c: Likewise. * mips-opc.c: Likewise. * mips61-opc.c: Likewise. * moxie-dis.c: Likewise. * or32-opc.c: Likewise. * pj-dis.c: Likewise. * ppc-dis.c: Likewise. * ppc-opc.c: Likewise. * s390-dis.c: Likewise. * sh-dis.c: Likewise. * sh64-dis.c: Likewise. * sparc-dis.c: Likewise. * sparc-opc.c: Likewise. * spu-dis.c: Likewise. * tic30-dis.c: Likewise. * tic54x-dis.c: Likewise. * tic80-dis.c: Likewise. * tic80-opc.c: Likewise. * tilegx-dis.c: Likewise. * tilepro-dis.c: Likewise. * v850-dis.c: Likewise. * v850-opc.c: Likewise. * vax-dis.c: Likewise. * w65-dis.c: Likewise. * xgate-dis.c: Likewise. * xtensa-dis.c: Likewise. * rl78-decode.opc: Likewise. * rl78-decode.c: Regenerate. * rx-decode.opc: Likewise. * rx-decode.c: Regenerate. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * sysdep.h: Generate an error if included before config.h. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * aclocal.m4: Regenerate. * bfd-in.h: Generate an error if included before config.h. * sysdep.h: Likewise. * bfd-in2.h: Regenerate. * compress.c: Remove #include "config.h". * plugin.c: Likewise. * elf32-m68hc1x.c: Include sysdep.h before alloca-conf.h. * elf64-hppa.c: Likewise. * som.c: Likewise. * xsymc.c: Likewise. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * aclocal.m4: Regenerate. * Makefile.am: Use wrappers around C files generated by flex. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. * itbl-lex-wrapper.c: New file. * config/bfin-lex-wrapper.c: New file. * cgen.c: Include as.h before setjmp.h. * config/tc-dlx.c: Include as.h before any other header. * config/tc-h8300.c: Likewise. * config/tc-lm32.c: Likewise. * config/tc-mep.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-msp430.c: Likewise. * config/tc-or32.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-xtensa.c: Likewise. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * unwind-ia64.h: Include config.h.
2012-05-17 17:13:28 +02:00
#include "alloca-conf.h"
#include "bfd.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/hppa.h"
#include "libhppa.h"
#include "elf64-hppa.h"
#include "libiberty.h"
#define ARCH_SIZE 64
#define PLT_ENTRY_SIZE 0x10
#define DLT_ENTRY_SIZE 0x8
#define OPD_ENTRY_SIZE 0x20
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/pa20_64/dld.sl"
/* The stub is supposed to load the target address and target's DP
value out of the PLT, then do an external branch to the target
address.
LDD PLTOFF(%r27),%r1
BVE (%r1)
LDD PLTOFF+8(%r27),%r27
Note that we must use the LDD with a 14 bit displacement, not the one
with a 5 bit displacement. */
static char plt_stub[] = {0x53, 0x61, 0x00, 0x00, 0xe8, 0x20, 0xd0, 0x00,
0x53, 0x7b, 0x00, 0x00 };
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf_link_hash_entry eh;
/* Offsets for this symbol in various linker sections. */
bfd_vma dlt_offset;
bfd_vma plt_offset;
bfd_vma opd_offset;
bfd_vma stub_offset;
/* The index of the (possibly local) symbol in the input bfd and its
associated BFD. Needed so that we can have relocs against local
symbols in shared libraries. */
long sym_indx;
bfd *owner;
/* Dynamic symbols may need to have two different values. One for
the dynamic symbol table, one for the normal symbol table.
In such cases we store the symbol's real value and section
index here so we can restore the real value before we write
the normal symbol table. */
bfd_vma st_value;
int st_shndx;
/* Used to count non-got, non-plt relocations for delayed sizing
of relocation sections. */
struct elf64_hppa_dyn_reloc_entry
{
/* Next relocation in the chain. */
struct elf64_hppa_dyn_reloc_entry *next;
/* The type of the relocation. */
int type;
/* The input section of the relocation. */
asection *sec;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Number of relocs copied in this section. */
bfd_size_type count;
/* The index of the section symbol for the input section of
the relocation. Only needed when building shared libraries. */
int sec_symndx;
/* The offset within the input section of the relocation. */
bfd_vma offset;
/* The addend for the relocation. */
bfd_vma addend;
} *reloc_entries;
/* Nonzero if this symbol needs an entry in one of the linker
sections. */
unsigned want_dlt;
unsigned want_plt;
unsigned want_opd;
unsigned want_stub;
};
struct elf64_hppa_link_hash_table
{
struct elf_link_hash_table root;
/* Shortcuts to get to the various linker defined sections. */
asection *dlt_sec;
asection *dlt_rel_sec;
asection *opd_sec;
asection *opd_rel_sec;
asection *other_rel_sec;
/* Offset of __gp within .plt section. When the PLT gets large we want
to slide __gp into the PLT section so that we can continue to use
single DP relative instructions to load values out of the PLT. */
bfd_vma gp_offset;
/* Note this is not strictly correct. We should create a stub section for
each input section with calls. The stub section should be placed before
the section with the call. */
asection *stub_sec;
bfd_vma text_segment_base;
bfd_vma data_segment_base;
/* We build tables to map from an input section back to its
symbol index. This is the BFD for which we currently have
a map. */
bfd *section_syms_bfd;
/* Array of symbol numbers for each input section attached to the
current BFD. */
int *section_syms;
};
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
#define hppa_link_hash_table(p) \
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
(elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
== HPPA64_ELF_DATA ? ((struct elf64_hppa_link_hash_table *) ((p)->hash)) : NULL)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
#define hppa_elf_hash_entry(ent) \
((struct elf64_hppa_link_hash_entry *)(ent))
#define eh_name(eh) \
(eh ? eh->root.root.string : "<undef>")
typedef struct bfd_hash_entry *(*new_hash_entry_func)
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
static struct bfd_link_hash_table *elf64_hppa_hash_table_create
(bfd *abfd);
/* This must follow the definitions of the various derived linker
hash tables and shared functions. */
#include "elf-hppa.h"
static bfd_boolean elf64_hppa_object_p
(bfd *);
static bfd_boolean elf64_hppa_create_dynamic_sections
(bfd *, struct bfd_link_info *);
static bfd_boolean elf64_hppa_adjust_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
static bfd_boolean elf64_hppa_mark_milli_and_exported_functions
(struct elf_link_hash_entry *, void *);
static bfd_boolean elf64_hppa_size_dynamic_sections
(bfd *, struct bfd_link_info *);
* elf-bfd.h (struct elf_backend_data <elf_backend_link_output_symbol_hook>): Return an int. * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop symbols on deleted .opd entries. * elflink.c (elf_link_output_sym): Return without outputting sym if output_symbol_hook returns 2. (elf_link_output_extsym): Don't assign h->indx when symbol discarded. Abort if we must not discard sym. (elf_link_input_bfd): Similarly, don't set finfo->indices for local syms. (bfd_elf_final_link): Adjust elf_link_output_sym calls. * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for elf_backend_link_output_symbol_hook return type change. * elf32-arm.c (output_arch_syminfo): Likewise. (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. (elf32_arm_output_arch_local_syms): Likewise. * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. (bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
2009-05-21 16:15:50 +02:00
static int elf64_hppa_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *);
static bfd_boolean elf64_hppa_finish_dynamic_symbol
(bfd *, struct bfd_link_info *,
struct elf_link_hash_entry *, Elf_Internal_Sym *);
static bfd_boolean elf64_hppa_finish_dynamic_sections
(bfd *, struct bfd_link_info *);
static bfd_boolean elf64_hppa_check_relocs
(bfd *, struct bfd_link_info *,
asection *, const Elf_Internal_Rela *);
static bfd_boolean elf64_hppa_dynamic_symbol_p
(struct elf_link_hash_entry *, struct bfd_link_info *);
static bfd_boolean elf64_hppa_mark_exported_functions
(struct elf_link_hash_entry *, void *);
static bfd_boolean elf64_hppa_finalize_opd
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean elf64_hppa_finalize_dlt
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean allocate_global_data_dlt
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean allocate_global_data_plt
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean allocate_global_data_stub
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean allocate_global_data_opd
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean get_reloc_section
(bfd *, struct elf64_hppa_link_hash_table *, asection *);
static bfd_boolean count_dyn_reloc
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(bfd *, struct elf64_hppa_link_hash_entry *,
int, asection *, int, bfd_vma, bfd_vma);
static bfd_boolean allocate_dynrel_entries
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean elf64_hppa_finalize_dynreloc
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(struct elf_link_hash_entry *, void *);
static bfd_boolean get_opd
(bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *);
static bfd_boolean get_plt
(bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *);
static bfd_boolean get_dlt
(bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *);
static bfd_boolean get_stub
(bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *);
static int elf64_hppa_elf_get_symbol_type
(Elf_Internal_Sym *, int);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Initialize an entry in the link hash table. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
static struct bfd_hash_entry *
hppa64_link_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (entry == NULL)
{
entry = bfd_hash_allocate (table,
sizeof (struct elf64_hppa_link_hash_entry));
if (entry == NULL)
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
return entry;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
}
/* Call the allocation method of the superclass. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
entry = _bfd_elf_link_hash_newfunc (entry, table, string);
if (entry != NULL)
{
struct elf64_hppa_link_hash_entry *hh;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Initialize our local data. All zeros. */
hh = hppa_elf_hash_entry (entry);
memset (&hh->dlt_offset, 0,
(sizeof (struct elf64_hppa_link_hash_entry)
- offsetof (struct elf64_hppa_link_hash_entry, dlt_offset)));
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
return entry;
}
/* Create the derived linker hash table. The PA64 ELF port uses this
derived hash table to keep information specific to the PA ElF
linker (without using static variables). */
static struct bfd_link_hash_table*
elf64_hppa_hash_table_create (bfd *abfd)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_table *htab;
bfd_size_type to size_t bfd_size_type was invented a long time ago in the K&R days. Many places in binutils ought to be using size_t instead (and there are lots of places that use long or unsigned long that really ought to use size_t too). Note that you can't change everything over to size_t: A 32-bit host needs a larger type than size_t to support reading and processing of 64-bit ELF object files. This patch just tidies some of the more obvious uses of bfd_size_type that could be size_t. There no doubt are more lurking in the source. Incidentally, practically all functions used for output of object files can use size_t and don't need to worry about overflow of size expressions. If you have something like symcount * sizeof (void *) when symcount is counting symbols already in memory then you know that this expression can't overflow since the size of a symbol in memory is larger by far than that of a pointer. * aix386-core.c (aix386_core_file_p): Use size_t for "amt". * aout-target.h (object_p): Likewise. * aout-tic30.c (tic30_aout_object_p): Likewise. * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol), (emit_stringtab, write_syms, link_hash_table_create), (aout_link_write_other_symbol): Likewise. * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p), (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents), (_bfd_compute_and_write_armap): Likewise. * archures.c (bfd_arch_list): Likewise. * bfd.c (bfd_record_phdr): Likewise. * binary.c (binary_canonicalize_symtab): Likewise. * cisco-core.c (cisco_core_file_validate): Likewise. * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue), (find_arm_glue, record_arm_to_thumb_glue), (record_thumb_to_arm_glue): Likewise. * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc), (ppc_allocate_toc_section): Likewise. * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise. * coff-sh.c (sh_relax_section): Likewise. * coff64-rs6000.c (xcoff64_archive_p): Likewise. * coffcode.h (handle_COMDAT, coff_new_section_hook), (coff_set_alignment_hook, coff_mkobject), (coff_compute_section_file_positions): Likewise. * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol), (coff_find_nearest_line_with_names), ( bfd_coff_set_symbol_class): Likewise. * cofflink.c (_bfd_coff_link_hash_table_create), (_bfd_coff_link_input_bfd): Likewise. * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise. * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info), (build_line_info_table, sort_line_sequences), (line_info_add_include_dir, line_info_add_file_name), (decode_line_info, scan_unit_for_symbols, parse_comp_unit), (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise. * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol), (_bfd_ecoff_find_nearest_line), (_bfd_ecoff_bfd_link_hash_table_create): Likewise. * ecofflink.c (bfd_ecoff_debug_init): Likewise. * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise. * elf-m10300.c (mn10300_elf_relax_section), (elf32_mn10300_link_hash_table_create): Likewise. * elf-strtab.c (_bfd_elf_strtab_init): Likewise. * elf.c (make_mapping, copy_elf_program_header): Likewise. * elf32-arm.c (elf32_arm_link_hash_table_create), (elf32_arm_setup_section_lists, elf32_arm_check_relocs), (elf32_arm_new_section_hook): Likewise. * elf32-avr.c (elf_avr_new_section_hook), (elf32_avr_link_hash_table_create, get_local_syms), (elf32_avr_setup_section_lists): Likewise. * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create), (bfin_link_hash_table_create): Likewise. * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise. * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. * elf32-csky.c (csky_elf_link_hash_table_create), (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise. * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create), (elf32_hppa_setup_section_lists, get_local_syms): Likewise. * elf32-i386.c (elf_i386_check_relocs): Likewise. * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise. * elf32-m32r.c (m32r_elf_link_hash_table_create), (m32r_elf_check_relocs): Likewise. * elf32-m68hc1x.c (m68hc11_elf_hash_table_create), (elf32_m68hc11_setup_section_lists), (elf32_m68hc11_size_stubs): Likewise. * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. * elf32-metag.c (elf_metag_link_hash_table_create), (elf_metag_setup_section_lists): Likewise. * elf32-microblaze.c (microblaze_elf_link_hash_table_create), (microblaze_elf_check_relocs): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create), (nds32_elf_check_relocs): Likewise. * elf32-nios2.c (nios2_elf32_setup_section_lists), (get_local_syms, nios2_elf32_check_relocs), (nios2_elf32_link_hash_table_create): Likewise. * elf32-or1k.c (or1k_elf_link_hash_table_create), (or1k_elf_check_relocs): Likewise. * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise. * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise. * elf32-s390.c (elf_s390_link_hash_table_create), (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section), (s3_elf32_score_new_section_hook), (elf32_score_link_hash_table_create): Likewise. * elf32-score7.c (score_elf_create_got_section), (s7_elf32_score_new_section_hook): Likewise. * elf32-sh.c (sh_elf_link_hash_table_create), (sh_elf_check_relocs): Likewise. * elf32-tic6x.c (elf32_tic6x_link_hash_table_create), (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise. * elf32-tilepro.c (tilepro_elf_link_hash_table_create), (tilepro_elf_check_relocs): Likewise. * elf32-v850.c (remember_hi16s_reloc): Likewise. * elf32-vax.c (elf_vax_link_hash_table_create): Likewise. * elf32-xtensa.c (elf_xtensa_link_hash_table_create), (elf_xtensa_new_section_hook): Likewise. * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create), (get_got_entry, elf64_alpha_check_relocs): Likewise. * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise. * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise. * elf64-mmix.c (mmix_elf_new_section_hook): Likewise. * elf64-ppc.c (ppc64_elf_new_section_hook), (ppc64_elf_link_hash_table_create, update_local_sym_info), (update_plt_info, ppc64_elf_check_relocs): Likewise. * elf64-s390.c (elf_s390_link_hash_table_create), (elf_s390_check_relocs): Likewise. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. * elflink.c (bfd_elf_link_record_local_dynamic_symbol), (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols), (elf_link_add_archive_symbols, compute_bucket_count), (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create), (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out), (bfd_elf_final_link): Likewise. * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create), (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs), (elfNN_aarch64_new_section_hook): Likewise. * elfnn-ia64.c (elfNN_ia64_object_p): Likewise. * elfnn-riscv.c (riscv_elf_link_hash_table_create), (riscv_elf_check_relocs): Likewise. * elfxx-mips.c (_bfd_mips_elf_new_section_hook), (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs), (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents), (_bfd_mips_elf_link_hash_table_create): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create), (_bfd_sparc_elf_check_relocs), (_bfd_sparc_elf_new_section_hook): Likewise. * elfxx-tilegx.c (tilegx_elf_link_hash_table_create), (tilegx_elf_check_relocs): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. * format.c (bfd_check_format_matches): Likewise. * hash.c (_bfd_stringtab_init): Likewise. * ihex.c (ihex_scan): Likewise. * irix-core.c (irix_core_core_file_p): Likewise. * linker.c (bfd_wrapped_link_hash_lookup), (_bfd_generic_link_hash_table_create), (_bfd_generic_reloc_link_order): Likewise. * lynx-core.c (lynx_core_file_p): Likewise. * netbsd-core.c (netbsd_core_file_p): Likewise. * osf-core.c (osf_core_core_file_p): Likewise. * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol), (link_hash_table_create, aout_link_write_other_symbol): Likewise. * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise. * peicode.h (pe_mkobject): Likewise. * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise. * ptrace-core.c (ptrace_unix_core_file_p): Likewise. * sco5-core.c (read_uarea): Likewise. * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers), (som_write_fixups, som_write_space_strings, som_write_symbol_strings), (som_finish_writing, som_canonicalize_symtab, som_new_section_hook), (som_bfd_copy_private_section_data, bfd_som_set_section_attributes), (bfd_som_attach_aux_hdr, som_write_armap): Likewise. * srec.c (srec_scan): Likewise. * syms.c (_bfd_generic_make_empty_symbol): Likewise. * targets.c (bfd_target_list): Likewise. * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise. * trad-core.c (trad_unix_core_file_p): Likewise. * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create), (vms_new_section_hook): Likewise. * wasm-module.c (wasm_make_empty_symbol): Likewise. * xcofflink.c (xcoff_get_section_contents), (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path), (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym), (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2020-02-19 03:42:00 +01:00
size_t amt = sizeof (*htab);
htab = bfd_zmalloc (amt);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (htab == NULL)
return NULL;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (!_bfd_elf_link_hash_table_init (&htab->root, abfd,
hppa64_link_hash_newfunc,
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
sizeof (struct elf64_hppa_link_hash_entry),
HPPA64_ELF_DATA))
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
{
free (htab);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
return NULL;
}
ELF: Add _bfd_elf_add_dynamic_tags All ELF backends with shared library support need to add dynamic tags. Add dt_pltgot_required and dt_jmprel_required to elf_link_hash_table to indicate that DT_PLTGOT and DT_JMPREL are required dynamic tags. 1. Add _bfd_elf_add_dynamic_tags to add common dynamic tags. 2. Add _bfd_elf_maybe_vxworks_add_dynamic_tags to add common VxWorks dynamic tags. * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and dt_jmprel_required. (_bfd_elf_add_dynamic_tags): New. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. * elf32-arm.c (elf32_arm_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc, dt_reloc_sz and dt_reloc_ent. * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New. * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set etab.dt_pltgot_required. (elf32_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-metag.c (elf_metag_link_hash_table_create): Set etab.dt_pltgot_required. (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-sh.c (sh_elf_link_hash_table_create): Set root.dt_pltgot_required for FDPIC output. (sh_elf_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set elf.dt_pltgot_required. (elf_xtensa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf64-hppa.c (elf64_hppa_hash_table_create): Set root.dt_pltgot_required. (elf64_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set root.dt_pltgot_required. (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags. * elflink.c (_bfd_elf_add_dynamic_tags): New.
2020-06-23 14:07:31 +02:00
htab->root.dt_pltgot_required = TRUE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
htab->text_segment_base = (bfd_vma) -1;
htab->data_segment_base = (bfd_vma) -1;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
return &htab->root.root;
}
/* Return nonzero if ABFD represents a PA2.0 ELF64 file.
Additionally we set the default architecture and machine. */
static bfd_boolean
elf64_hppa_object_p (bfd *abfd)
{
Elf_Internal_Ehdr * i_ehdrp;
unsigned int flags;
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
{
/* 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_GNU
&& i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
else
{
/* HPUX produces binaries with OSABI=HPUX,
but the kernel produces corefiles with OSABI=SysV. */
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX
&& i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
flags = i_ehdrp->e_flags;
switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE))
{
case EFA_PARISC_1_0:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 10);
case EFA_PARISC_1_1:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11);
case EFA_PARISC_2_0:
if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64)
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
else
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20);
case EFA_PARISC_2_0 | EF_PARISC_WIDE:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
}
/* Don't be fussy. */
return TRUE;
}
/* Given section type (hdr->sh_type), return a boolean indicating
whether or not the section is an elf64-hppa specific section. */
static bfd_boolean
elf64_hppa_section_from_shdr (bfd *abfd,
Elf_Internal_Shdr *hdr,
const char *name,
int shindex)
{
switch (hdr->sh_type)
{
case SHT_PARISC_EXT:
if (strcmp (name, ".PARISC.archext") != 0)
return FALSE;
break;
case SHT_PARISC_UNWIND:
if (strcmp (name, ".PARISC.unwind") != 0)
return FALSE;
break;
case SHT_PARISC_DOC:
case SHT_PARISC_ANNOT:
default:
return FALSE;
}
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
return FALSE;
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
a suitable section for holding relocs in the output BFD for a link. */
static bfd_boolean
get_reloc_section (bfd *abfd,
struct elf64_hppa_link_hash_table *hppa_info,
asection *sec)
{
const char *srel_name;
asection *srel;
bfd *dynobj;
srel_name = (bfd_elf_string_from_elf_section
(abfd, elf_elfheader(abfd)->e_shstrndx,
bfd/ * elf-bfd.h (struct bfd_elf_section_reloc_data): New structure. (struct bfd_elf_section_data): New members REL and RELA; delete members REL_HDR, REL_HDR2, REL_COUNT, REL_COUNT2, REL_IDX, REL_IDX2, REL_HASHES. (_bfd_elf_init_reloc_shdr): Adjust declaration. (_bfd_elf_single_rel_hdr): Declare. (RELOC_AGAINST_DISCARDED_SECTION): Use it. * elf.c (bfd_section_from_shdr): Adjusted to match changes in data structures. (_bfd_elf_init_reloc_shdr): New arg RELDATA. Remove arg REL_HDR. All callers changed. Allocate memory for the Elf_Internal_Shdr structure. (_bfd_elf_single_rel_hdr): New function. (struct fake_section_arg): New structure. (elf_fake_section): Expect to see a pointer to it in the third argument. If doing a relocatable link, allocate both REL and RELA sections as needed. (assign_section_numbers): Adjusted to match changes in data structures. (_bfd_elf_compute_section_file_positions): Call elf_fake_sections with a struct fake_section_args argument. * elfcode.h (elf_write_relocs): Adjusted to match changes in data structures. (elf_slurp_reloc_table): Likewise. * elflink.c (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Remove arg REL_HDR, replace with RELDATA. Remove argument O. All callers changed. Remove code to discover the right rel_hdr and count. (_bfd_elf_link_output_relocs): Adjusted to match changes in data structures. (elf_link_adjust_relocs): Remove args REL_HDR, COUNT and REL_HASH; replace with RELDATA. All callers changed. (elf_link_input_bfd): Correctly generate rel_hash data when both REL and RELA sections are present. (elf_reloc_link_order): Adjusted to match changes in data structures. (bfd_elf_final_link): Simplify code to count relocs. Free the hashes array for both REL and RELA. (get_dynamic_reloc_section_name): Use _bfd_elf_single_reloc_hdr * elf32-m32r.c (m32r_elf_fake_sections, elf_backend_fake_sections): Delete. * elf32-tic6x.c (elf32_tic6x_fake_sections, elf_backend_fake_sections): Delete. (elf32_tic6x_rel_relocation_p): Adjusted to match changes in data structures. * elf32-microblaze.c (microblaze_elf_check_relocs): Use _bfd_elf_single_rel_hdr. * elf32-ppc.c (ppc_elf_relax_section): Likewise. * elf32-spu.c (spu_elf_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-hppa.c (get_reloc_section): Likewise. * elf64-mips.c (mips_elf64_slurp_reloc_table): Adjusted to match changes in data structures. (mips_elf64_write_relocs): Use _bfd_elf_single_rel_hdr. * elf64-ppc.c (ppc64_elf_edit_opd): Likewise. (ppc64_elf_edit_toc): Likewise. (get_relocs): Adjusted to match changes in data structures. Allocate an Elf_Internal_Shdr structure if necessary. (ppc64_elf_finish_dynamic_sections): Use _bfd_elf_single_rel_hdr. * elf64-sparc.c (elf64_sparc_slurp_reloc_table): Adjusted to match changes in data structures. * elfxx-ia64.c (get_reloc_section): Use _bfd_elf_single_rel_hdr. * elfxx-mips.c (MIPS_RELOC_RELA_P): Remove macro. (mips_elf_rel_relocation_p): Adjusted to match changes in data structures. (_bfd_mips_elf_relocate_section): Use mips_elf_rel_relocation_p rather than MIPS_RELOC_RELOCA_P. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Use _bfd_elf_single_rel_hdr. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * emultempl/xtensaelf.em (replace_insn_sec_with_prop_sec): Use _bfd_elf_single_rel_hdr.
2010-10-04 16:13:10 +02:00
_bfd_elf_single_rel_hdr(sec)->sh_name));
if (srel_name == NULL)
return FALSE;
dynobj = hppa_info->root.dynobj;
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
2012-06-29 16:46:03 +02:00
srel = bfd_get_linker_section (dynobj, srel_name);
if (srel == NULL)
{
2012-06-29 16:46:03 +02:00
srel = bfd_make_section_anyway_with_flags (dynobj, srel_name,
(SEC_ALLOC
| SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_LINKER_CREATED
| SEC_READONLY));
if (srel == NULL
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (srel, 3))
return FALSE;
}
hppa_info->other_rel_sec = srel;
return TRUE;
}
/* Add a new entry to the list of dynamic relocations against DYN_H.
We use this to keep a record of all the FPTR relocations against a
particular symbol so that we can create FPTR relocations in the
output file. */
static bfd_boolean
count_dyn_reloc (bfd *abfd,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh,
int type,
asection *sec,
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
int sec_symndx,
bfd_vma offset,
bfd_vma addend)
{
struct elf64_hppa_dyn_reloc_entry *rent;
rent = (struct elf64_hppa_dyn_reloc_entry *)
bfd_alloc (abfd, (bfd_size_type) sizeof (*rent));
if (!rent)
return FALSE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
rent->next = hh->reloc_entries;
rent->type = type;
rent->sec = sec;
rent->sec_symndx = sec_symndx;
rent->offset = offset;
rent->addend = addend;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->reloc_entries = rent;
return TRUE;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Return a pointer to the local DLT, PLT and OPD reference counts
for ABFD. Returns NULL if the storage allocation fails. */
static bfd_signed_vma *
hppa64_elf_local_refcounts (bfd *abfd)
{
Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
bfd_signed_vma *local_refcounts;
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
local_refcounts = elf_local_got_refcounts (abfd);
if (local_refcounts == NULL)
{
bfd_size_type size;
/* Allocate space for local DLT, PLT and OPD reference
counts. Done this way to save polluting elf_obj_tdata
with another target specific pointer. */
size = symtab_hdr->sh_info;
size *= 3 * sizeof (bfd_signed_vma);
local_refcounts = bfd_zalloc (abfd, size);
elf_local_got_refcounts (abfd) = local_refcounts;
}
return local_refcounts;
}
/* Scan the RELOCS and record the type of dynamic entries that each
referenced symbol needs. */
static bfd_boolean
elf64_hppa_check_relocs (bfd *abfd,
struct bfd_link_info *info,
asection *sec,
const Elf_Internal_Rela *relocs)
{
struct elf64_hppa_link_hash_table *hppa_info;
const Elf_Internal_Rela *relend;
Elf_Internal_Shdr *symtab_hdr;
const Elf_Internal_Rela *rel;
include/elf/ PR 5900 * common.h (SHN_BAD): Delete. (SHN_LORESERVE .. SHN_HIRESERVE): Move to.. * external.h: ..here. * internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define. (SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define. (SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define. bfd/ PR 5900 * elf-bfd.h: Include elf/internal.h after elf/external.h. * elfcode.h (elf_swap_symbol_in): Map reserved shndx range. (elf_swap_symbol_out): Adjust SHN_XINDEX test. (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. (valid_section_index_p): Delete. (elf_object_p): Don't increment section numbers over reserved range. Simplify test for valid sh_link, sh_info and e_shstrndx fields. (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. Don't increment section numbers over reserved range. * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx. (bfd_section_from_shdr): Likewise. (group_signature): Range check before accessing elf_elfsections. (_bfd_elf_setup_sections): Likewise. (bfd_section_from_shdr): Likewise. (bfd_section_from_shdr): Don't increment section number over reserved sections. (assign_file_positions_for_non_load_sections): Likewise. (assign_file_positions_except_relocs): Likewise. (_bfd_elf_write_object_contents): Likewise. (assign_section_numbers): Likewise. Adjust for changed SHN_*. (prep_headers): Delete unused variable. * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust for changed SHN_* values. (check_dynsym, elf_link_input_bfd): Likewise. (bfd_elf_final_link): Likewise. Don't skip over reserved section range. (elf_fixup_link_order): Check that sh_link field is valid. * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned. * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before accesssing elf_elfsections. * elf32-avr.c (elf32_avr_size_stubs): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed SHN_* defines. Test for SHN_BAD return from _bfd_elf_section_from_bfd_section binutils/ PR 5900 * readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete. Remove use throughout file. (SECTION_HEADER): Likewise. (dump_relocations): Don't adjust st_shndx for reserved range. (process_file_header): Mask SHN_XINDEX to values seen in external elf structs. Simplify valid section index tests. (get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX. Map reserved st_shndx to internal form. (process_section_groups): Test that group symbol st_shndx is in range, not just non-zero. Delete reserved range check. (get_symbol_index_type): Mask "type" to 16 bits when printing PRC, OS or RSV. gdb/ PR 5900 * elfread.c (elf_symtab_read): Make shndx an unsigned int. * mipsread.c: Include elf/internal.h. (read_alphacoff_dynamic_symtab): Map external reserved sym_shndx to internal range. ld/testsuite/ PR 5900 * ld-elf/sec64k.exp: Update.
2008-03-12 09:37:09 +01:00
unsigned int sec_symndx;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_relocatable (info))
return TRUE;
/* If this is the first dynamic object found in the link, create
the special sections required for dynamic linking. */
if (! elf_hash_table (info)->dynamic_sections_created)
{
* elflink.c (_bfd_elf_link_create_dynamic_sections): Move from elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. (bfd_elf_record_link_assignment): Move from elflink.h. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_add_default_symbol): Likewise. (_bfd_elf_export_symbol): Likewise. (_bfd_elf_link_find_version_dependencies): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel and bed->s->sizeof_rela. (_bfd_elf_link_output_relocs): Likewise. * elf-bfd.h (struct elf_size_info): Rename file_align to log_file_align. (struct elf_info_failed): Move from elflink.h. (struct elf_assign_sym_version_info): Likewise. (struct elf_find_verdep_info): Likewise. (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms): Declare. (bfd_elf32_link_create_dynamic_sections): Don't declare. (_bfd_elf32_link_read_relocs): Likewise. (bfd_elf64_link_create_dynamic_sections): Likewise. (_bfd_elf64_link_read_relocs): Likewise. * elflink.h: Move lots o' stuff elsewhere. * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. (bfd_elf64_record_link_assignment): Likewise. (bfd_elf_record_link_assignment): Declare. * bfd-in2.h: Regenerate. * elfcode.h (elf_link_create_dynamic_sections): Don't declare. (NAME(_bfd_elf,size_info)): Adjust for log_file_align. * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. (assign_file_positions_for_segments): Likewise. (assign_file_positions_except_relocs): Likewise. (swap_out_syms, elfcore_write_note): Likewise. * elf-m10200.c: Adjust for changed function names. * elf-m10300.c: Likewise. * elf32-arm.h: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-mips.c (mips_elf64_size_info): Likewise. * elf64-s390.c (s390_elf64_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2003-05-09 04:27:11 +02:00
if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
return FALSE;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* If necessary, build a new table holding section symbols indices
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
for this BFD. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) && hppa_info->section_syms_bfd != abfd)
{
unsigned long i;
Support for more than 64k ELF sections. include/elf/ChangeLog * external.h (Elf_External_Sym_Shndx): Declare. * internal.h (struct elf_internal_sym <st_shndx>): Make it an unsigned int. * common.h (SHN_BAD): Define. bfd/ChangeLog * configure.in: Bump bfd version. * configure: Regenerate. * elf-bfd.h (elf_size_info <swap_symbol_out>): Add shndx param. (bfd_elf32_swap_symbol_in): Likewise. (bfd_elf32_swap_symbol_out): Likewise. (bfd_elf64_swap_symbol_in): Likewise. (bfd_elf64_swap_symbol_out): Likewise. (elf_reloc_cookie): Add locsym_shndx field. Make locsyms a PTR. (elf_obj_tdata): Add num_elf_sections, symtab_shndx_hdr and symtab_shndx_section. (elf_numsections): Define. (elf_symtab_shndx): Define. * elf.c (setup_group): Use elf_numsections rather than header e_shnum. (bfd_elf_find_section): Likewise. (bfd_section_from_elf_index): Likewise. (bfd_section_from_shdr): Likewise. Handle SHT_SYMTAB_SHNDX. (bfd_section_from_r_symndx): Read symbol shndx extension, and translate st_shndx for > SHN_HIRESERVE. (assign_section_numbers): Skip reserved sections. Assign symtab_shndx_section and elf_numsections. Exclude reserved sections from e_shnum. Set up symtab_shndx_hdr. (_bfd_elf_compute_section_file_positions): Handle symtab_shndx_hdr. (map_sections_to_segments): Don't map eh_frame_hdr unless required. (assign_file_positions_except_relocs): Use elf_numsections rather than header e_shnum. Skip reserved sections and symtab_shndx_section. (prep_headers): Set name for symtab_shndx_hdr. (_bfd_elf_assign_file_positions_for_relocs): Use elf_numsections. (_bfd_elf_write_object_contents): Likewise. Skip reserved sections. (_bfd_elf_section_from_bfd_section): Check bfd_{abs,com,und}_section first. Use elf_section_data if available. Use elf_numsections. Start scan at index 1. (copy_private_bfd_data ): Comment fixes. (MAP_ONESYMTAB): Define above SHN_HIOS. (MAP_DYNSYMTAB): Likewise. (MAP_STRTAB): Likewise. (MAP_SHSTRTAB): Likewise. (MAP_SYM_SHNDX): New define. (_bfd_elf_copy_private_symbol_data): Handle symtab_shndx_section. (swap_out_syms): Swap out SHT_SYMTAB_SHNDX section too. * elfcode.h (elf_swap_symbol_in): Add shndx param, and handle shndx extension. (elf_swap_symbol_out): Likewise. (elf_object_p): Set elf_numsections, and use instead of e_shnum. Initialialise reserved elf_elfsections to point at shdr[0]. Remove redundant bfd_release calls. (elf_slurp_symbol_table): Read symbol shndx extension, and use with elf_swap_symbol_in. Translate st_shndx for > SHN_HIRESERVE too. * elflink.h (elf_link_is_defined_archive_symbol): Read symbol shndx extension, and use with elf_swap_symbol_in. (elf_link_record_local_dynamic_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Also translate st_shndx for elf sections > SHN_HIRESERVE. (NAME(bfd_elf,size_dynamic_sections)): Adjust elf_swap_symbol_out call. (struct elf_final_link_info): Add locsym_shndx and symshndxbuf. (elf_bfd_final_link): Allocate the above, and tidy code allocating other buffers. Use elf_numsections instead of e_shnum. Adjust elf_swap_symbol_out calls. (elf_link_output_sym): Swap out symbol shndx extension too. (elf_link_flush_output_syms): And flush them to disk. (elf_link_output_extsym): Use SHN_BAD. Adjust elf_swap_symbol_out calls. (elf_gc_mark): Read symbol shndx extension, and use with elf_swap_symbol_in. (elf_link_input_bfd): Likewise, Translate st_shndx for elf sections > SHN_HIRESERVE too. Use SHN_BAD. (elf_reloc_symbol_deleted_p): Use symbol shndx extensions with elf_swap_symbol_in. Translate st_shndx > SHN_HIRESERVE too. (elf_bfd_discard_info): Read symbol shndx extension. Don't attempt to continue after a bfd error. * elf-m10200.c (mn10200_elf_relax_section): Only read local syms. Stash them immediately to symtab_hdr->contents rather than later in multiple places. Clean up afterwards. Read symbol shndx extension, and use with swap_symbol_in. Translate SHN_UNDEF, SHN_ABS, SHN_COMMON and elf sections > SHN_HIRESERVE to bfd sections too. Remove dead code. (mn10200_elf_relax_delete_bytes): Use symbol shndx extension when swapping in symbols. Tidy code adjusting global syms. Don't swap in global syms. (mn10200_elf_symbol_address_p): Likewise. Remove extsyms param. (mn10200_elf_get_relocated_section_contents): Read symbol shndx extension, and use with swap_symbol_in. Rename "size" -> "amt" to maximize code in common with other files. Translate st_shndx for > SHN_HIRESERVE too. Remove dead code. * elf-m10300.c (mn10300_elf_relax_section): Only read local syms. Stash them immediately to symtab_hdr->contents rather than later in multiple places. Clean up afterwards. Read symbol shndx extension, and use with swap_symbol_in. Remove dead code. (mn10300_elf_relax_delete_bytes): As for elf-m10200.c. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As for elf-m10300.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Read symbol shndx extension, and use with swap_symbol_in. * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Adjust call to bfd_elf32_swap_symbol_out. * elf32-m32r.c (m32r_elf_get_relocated_section_contents): Translate elf sections > SHN_HIRESERVE too. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Only read local syms. Read symbol shndx extension, and use with swap_symbol_in. * elf32-mips.c (_bfd_mips_elf_final_write_processing): Use elf_numsections rather than header e_shnum. * elf32-sh.c (sh_elf_relax_section): As for elf-m10300.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. Only read local symbols. * elf32-v850.c (v850_elf_symbol_processing): Use an unsigned int to hold section index. Use elf_numsections rather than e_shnum. Rename "index" -> "indx" to avoid shadowing warning. (v850_elf_add_symbol_hook): Likewise. * elf64-alpha.c (elf64_alpha_relax_section): Only read local syms. Read symbol shndx extension, and use with swap_symbol_in. * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. Translate SHN_COMMON and elf sections > SHN_HIRESERVE too. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. (elfNN_ia64_aix_add_symbol_hook): Use elf_numsections. * elf-m10300.c (mn10300_elf_gc_mark_hook): Remove unnecessary checks before calling bfd_section_from_elf_index on local syms. * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. * elf32-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. * elf64-mips.c (mips_elf64_gc_mark_hook): Likewise. * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. binutils/ChangeLog * readelf.c (symtab_shndx_hdr): New global. (SECTION_HEADER_INDEX): Define. (SECTION_HEADER_NUM): Define. (SECTION_HEADER): Define. (GET_ELF_SYMBOLS): Pass two params rather than three. (get_32bit_elf_symbols): Take file and section args. Read and use SHT_SYMTAB_SHNDX. (get_64bit_elf_symbols): Likewise. (dump_relocations): Use SECTION_HEADER to index "section_headers". (process_section_headers): Likewise. Use SECTION_HEADER_NUM too. Remember symtab_shdx_hdr. (process_program_headers): Scan from index 1 for segment map. (slurp_ia64_unwind_table): Use SECTION_HEADER to index "section_headers". (process_relocs): Likewise. Also adjust call to GET_ELF_SYMBOLS. (process_unwind): Likewise. (process_version_sections): Likewise. (process_symbol_table): Likewise. (display_debug_info): Likewise. (process_dynamic_segment): Fake up a symtab section for changed GET_ELF_SYMBOLS. (get_symbol_index_type): Check SHN_LOOS before SHN_LORESERVE. (process_program_headers): Kill signed/unsigned warning. (load_debug_str): Likewise. (display_debug_info): Likewise.
2001-12-17 01:52:35 +01:00
unsigned int highest_shndx;
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
Elf_Internal_Sym *local_syms = NULL;
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
/* We're done with the old cache of section index to section symbol
index information. Free it.
?!? Note we leak the last section_syms array. Presumably we
could free it in one of the later routines in this file. */
free (hppa_info->section_syms);
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
/* Read this BFD's local symbols. */
if (symtab_hdr->sh_info != 0)
{
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
local_syms = (Elf_Internal_Sym *) symtab_hdr->contents;
if (local_syms == NULL)
local_syms = bfd_elf_get_elf_syms (abfd, symtab_hdr,
symtab_hdr->sh_info, 0,
NULL, NULL, NULL);
if (local_syms == NULL)
return FALSE;
Support for more than 64k ELF sections. include/elf/ChangeLog * external.h (Elf_External_Sym_Shndx): Declare. * internal.h (struct elf_internal_sym <st_shndx>): Make it an unsigned int. * common.h (SHN_BAD): Define. bfd/ChangeLog * configure.in: Bump bfd version. * configure: Regenerate. * elf-bfd.h (elf_size_info <swap_symbol_out>): Add shndx param. (bfd_elf32_swap_symbol_in): Likewise. (bfd_elf32_swap_symbol_out): Likewise. (bfd_elf64_swap_symbol_in): Likewise. (bfd_elf64_swap_symbol_out): Likewise. (elf_reloc_cookie): Add locsym_shndx field. Make locsyms a PTR. (elf_obj_tdata): Add num_elf_sections, symtab_shndx_hdr and symtab_shndx_section. (elf_numsections): Define. (elf_symtab_shndx): Define. * elf.c (setup_group): Use elf_numsections rather than header e_shnum. (bfd_elf_find_section): Likewise. (bfd_section_from_elf_index): Likewise. (bfd_section_from_shdr): Likewise. Handle SHT_SYMTAB_SHNDX. (bfd_section_from_r_symndx): Read symbol shndx extension, and translate st_shndx for > SHN_HIRESERVE. (assign_section_numbers): Skip reserved sections. Assign symtab_shndx_section and elf_numsections. Exclude reserved sections from e_shnum. Set up symtab_shndx_hdr. (_bfd_elf_compute_section_file_positions): Handle symtab_shndx_hdr. (map_sections_to_segments): Don't map eh_frame_hdr unless required. (assign_file_positions_except_relocs): Use elf_numsections rather than header e_shnum. Skip reserved sections and symtab_shndx_section. (prep_headers): Set name for symtab_shndx_hdr. (_bfd_elf_assign_file_positions_for_relocs): Use elf_numsections. (_bfd_elf_write_object_contents): Likewise. Skip reserved sections. (_bfd_elf_section_from_bfd_section): Check bfd_{abs,com,und}_section first. Use elf_section_data if available. Use elf_numsections. Start scan at index 1. (copy_private_bfd_data ): Comment fixes. (MAP_ONESYMTAB): Define above SHN_HIOS. (MAP_DYNSYMTAB): Likewise. (MAP_STRTAB): Likewise. (MAP_SHSTRTAB): Likewise. (MAP_SYM_SHNDX): New define. (_bfd_elf_copy_private_symbol_data): Handle symtab_shndx_section. (swap_out_syms): Swap out SHT_SYMTAB_SHNDX section too. * elfcode.h (elf_swap_symbol_in): Add shndx param, and handle shndx extension. (elf_swap_symbol_out): Likewise. (elf_object_p): Set elf_numsections, and use instead of e_shnum. Initialialise reserved elf_elfsections to point at shdr[0]. Remove redundant bfd_release calls. (elf_slurp_symbol_table): Read symbol shndx extension, and use with elf_swap_symbol_in. Translate st_shndx for > SHN_HIRESERVE too. * elflink.h (elf_link_is_defined_archive_symbol): Read symbol shndx extension, and use with elf_swap_symbol_in. (elf_link_record_local_dynamic_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Also translate st_shndx for elf sections > SHN_HIRESERVE. (NAME(bfd_elf,size_dynamic_sections)): Adjust elf_swap_symbol_out call. (struct elf_final_link_info): Add locsym_shndx and symshndxbuf. (elf_bfd_final_link): Allocate the above, and tidy code allocating other buffers. Use elf_numsections instead of e_shnum. Adjust elf_swap_symbol_out calls. (elf_link_output_sym): Swap out symbol shndx extension too. (elf_link_flush_output_syms): And flush them to disk. (elf_link_output_extsym): Use SHN_BAD. Adjust elf_swap_symbol_out calls. (elf_gc_mark): Read symbol shndx extension, and use with elf_swap_symbol_in. (elf_link_input_bfd): Likewise, Translate st_shndx for elf sections > SHN_HIRESERVE too. Use SHN_BAD. (elf_reloc_symbol_deleted_p): Use symbol shndx extensions with elf_swap_symbol_in. Translate st_shndx > SHN_HIRESERVE too. (elf_bfd_discard_info): Read symbol shndx extension. Don't attempt to continue after a bfd error. * elf-m10200.c (mn10200_elf_relax_section): Only read local syms. Stash them immediately to symtab_hdr->contents rather than later in multiple places. Clean up afterwards. Read symbol shndx extension, and use with swap_symbol_in. Translate SHN_UNDEF, SHN_ABS, SHN_COMMON and elf sections > SHN_HIRESERVE to bfd sections too. Remove dead code. (mn10200_elf_relax_delete_bytes): Use symbol shndx extension when swapping in symbols. Tidy code adjusting global syms. Don't swap in global syms. (mn10200_elf_symbol_address_p): Likewise. Remove extsyms param. (mn10200_elf_get_relocated_section_contents): Read symbol shndx extension, and use with swap_symbol_in. Rename "size" -> "amt" to maximize code in common with other files. Translate st_shndx for > SHN_HIRESERVE too. Remove dead code. * elf-m10300.c (mn10300_elf_relax_section): Only read local syms. Stash them immediately to symtab_hdr->contents rather than later in multiple places. Clean up afterwards. Read symbol shndx extension, and use with swap_symbol_in. Remove dead code. (mn10300_elf_relax_delete_bytes): As for elf-m10200.c. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As for elf-m10300.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Read symbol shndx extension, and use with swap_symbol_in. * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Adjust call to bfd_elf32_swap_symbol_out. * elf32-m32r.c (m32r_elf_get_relocated_section_contents): Translate elf sections > SHN_HIRESERVE too. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Only read local syms. Read symbol shndx extension, and use with swap_symbol_in. * elf32-mips.c (_bfd_mips_elf_final_write_processing): Use elf_numsections rather than header e_shnum. * elf32-sh.c (sh_elf_relax_section): As for elf-m10300.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. Only read local symbols. * elf32-v850.c (v850_elf_symbol_processing): Use an unsigned int to hold section index. Use elf_numsections rather than e_shnum. Rename "index" -> "indx" to avoid shadowing warning. (v850_elf_add_symbol_hook): Likewise. * elf64-alpha.c (elf64_alpha_relax_section): Only read local syms. Read symbol shndx extension, and use with swap_symbol_in. * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. Translate SHN_COMMON and elf sections > SHN_HIRESERVE too. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. (elfNN_ia64_aix_add_symbol_hook): Use elf_numsections. * elf-m10300.c (mn10300_elf_gc_mark_hook): Remove unnecessary checks before calling bfd_section_from_elf_index on local syms. * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. * elf32-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. * elf64-mips.c (mips_elf64_gc_mark_hook): Likewise. * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. binutils/ChangeLog * readelf.c (symtab_shndx_hdr): New global. (SECTION_HEADER_INDEX): Define. (SECTION_HEADER_NUM): Define. (SECTION_HEADER): Define. (GET_ELF_SYMBOLS): Pass two params rather than three. (get_32bit_elf_symbols): Take file and section args. Read and use SHT_SYMTAB_SHNDX. (get_64bit_elf_symbols): Likewise. (dump_relocations): Use SECTION_HEADER to index "section_headers". (process_section_headers): Likewise. Use SECTION_HEADER_NUM too. Remember symtab_shdx_hdr. (process_program_headers): Scan from index 1 for segment map. (slurp_ia64_unwind_table): Use SECTION_HEADER to index "section_headers". (process_relocs): Likewise. Also adjust call to GET_ELF_SYMBOLS. (process_unwind): Likewise. (process_version_sections): Likewise. (process_symbol_table): Likewise. (display_debug_info): Likewise. (process_dynamic_segment): Fake up a symtab section for changed GET_ELF_SYMBOLS. (get_symbol_index_type): Check SHN_LOOS before SHN_LORESERVE. (process_program_headers): Kill signed/unsigned warning. (load_debug_str): Likewise. (display_debug_info): Likewise.
2001-12-17 01:52:35 +01:00
}
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
/* Record the highest section index referenced by the local symbols. */
highest_shndx = 0;
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
isymend = local_syms + symtab_hdr->sh_info;
for (isym = local_syms; isym < isymend; isym++)
{
include/elf/ PR 5900 * common.h (SHN_BAD): Delete. (SHN_LORESERVE .. SHN_HIRESERVE): Move to.. * external.h: ..here. * internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define. (SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define. (SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define. bfd/ PR 5900 * elf-bfd.h: Include elf/internal.h after elf/external.h. * elfcode.h (elf_swap_symbol_in): Map reserved shndx range. (elf_swap_symbol_out): Adjust SHN_XINDEX test. (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. (valid_section_index_p): Delete. (elf_object_p): Don't increment section numbers over reserved range. Simplify test for valid sh_link, sh_info and e_shstrndx fields. (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. Don't increment section numbers over reserved range. * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx. (bfd_section_from_shdr): Likewise. (group_signature): Range check before accessing elf_elfsections. (_bfd_elf_setup_sections): Likewise. (bfd_section_from_shdr): Likewise. (bfd_section_from_shdr): Don't increment section number over reserved sections. (assign_file_positions_for_non_load_sections): Likewise. (assign_file_positions_except_relocs): Likewise. (_bfd_elf_write_object_contents): Likewise. (assign_section_numbers): Likewise. Adjust for changed SHN_*. (prep_headers): Delete unused variable. * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust for changed SHN_* values. (check_dynsym, elf_link_input_bfd): Likewise. (bfd_elf_final_link): Likewise. Don't skip over reserved section range. (elf_fixup_link_order): Check that sh_link field is valid. * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned. * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before accesssing elf_elfsections. * elf32-avr.c (elf32_avr_size_stubs): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed SHN_* defines. Test for SHN_BAD return from _bfd_elf_section_from_bfd_section binutils/ PR 5900 * readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete. Remove use throughout file. (SECTION_HEADER): Likewise. (dump_relocations): Don't adjust st_shndx for reserved range. (process_file_header): Mask SHN_XINDEX to values seen in external elf structs. Simplify valid section index tests. (get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX. Map reserved st_shndx to internal form. (process_section_groups): Test that group symbol st_shndx is in range, not just non-zero. Delete reserved range check. (get_symbol_index_type): Mask "type" to 16 bits when printing PRC, OS or RSV. gdb/ PR 5900 * elfread.c (elf_symtab_read): Make shndx an unsigned int. * mipsread.c: Include elf/internal.h. (read_alphacoff_dynamic_symtab): Map external reserved sym_shndx to internal range. ld/testsuite/ PR 5900 * ld-elf/sec64k.exp: Update.
2008-03-12 09:37:09 +01:00
if (isym->st_shndx > highest_shndx
&& isym->st_shndx < SHN_LORESERVE)
highest_shndx = isym->st_shndx;
}
/* Allocate an array to hold the section index to section symbol index
mapping. Bump by one since we start counting at zero. */
highest_shndx++;
amt = highest_shndx;
amt *= sizeof (int);
hppa_info->section_syms = (int *) bfd_malloc (amt);
/* Now walk the local symbols again. If we find a section symbol,
record the index of the symbol into the section_syms array. */
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
for (i = 0, isym = local_syms; isym < isymend; i++, isym++)
{
if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
hppa_info->section_syms[isym->st_shndx] = i;
}
* elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, change type of locsyms. (bfd_elf_get_elf_syms): Declare. * elf.c (bfd_elf_get_elf_syms): New function. (group_signature): Use bfd_elf_get_elf_syms. (bfd_section_from_r_symndx): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. Reorganise to increase locality of various data structures. Properly free internal relocs. (elf_bfd_final_link): Properly free internal relocs. (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. Properly free internal relocs. (elf_gc_sweep): Properly free internal relocs. (elf_reloc_symbol_deleted_p): No need to swap syms in. (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free internal relocs. * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free possibly cached info. (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. (mn10200_elf_symbol_address_p): Pass in internal syms. Remove symbol swapping code. (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. (m32r_elf_relax_delete_bytes): Likewise. (m32r_elf_get_relocated_section_contents): Likewise. * elf32-sh.c (sh_elf_reloc_loop): Free section contents using elf_section_data to determine whether cached. (sh_elf_relax_section): As above for elf-m10200.c. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay reading of local syms. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. * elfxx-ia64.c (elfNN_ia64_relax_section): As above. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal relocs. * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly free internal relocs and section contents. Don't read symbols. * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. (elf32_hppa_size_stubs): Don't free local syms. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay reading of local syms. Use bfd_elf_get_elf_syms. Properly free possibly cached info. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and all_local_syms. (get_local_syms): Delete function. (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache on exit. (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
2002-07-07 11:10:41 +02:00
/* We are finished with the local symbols. */
if (local_syms != NULL
&& symtab_hdr->contents != (unsigned char *) local_syms)
{
if (! info->keep_memory)
free (local_syms);
else
{
/* Cache the symbols for elf_link_input_bfd. */
symtab_hdr->contents = (unsigned char *) local_syms;
}
}
/* Record which BFD we built the section_syms mapping for. */
hppa_info->section_syms_bfd = abfd;
}
/* Record the symbol index for this input section. We may need it for
relocations when building shared libraries. When not building shared
libraries this value is never really used, but assign it to zero to
prevent out of bounds memory accesses in other routines. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info))
{
sec_symndx = _bfd_elf_section_from_bfd_section (abfd, sec);
/* If we did not find a section symbol for this section, then
something went terribly wrong above. */
include/elf/ PR 5900 * common.h (SHN_BAD): Delete. (SHN_LORESERVE .. SHN_HIRESERVE): Move to.. * external.h: ..here. * internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define. (SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define. (SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define. bfd/ PR 5900 * elf-bfd.h: Include elf/internal.h after elf/external.h. * elfcode.h (elf_swap_symbol_in): Map reserved shndx range. (elf_swap_symbol_out): Adjust SHN_XINDEX test. (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. (valid_section_index_p): Delete. (elf_object_p): Don't increment section numbers over reserved range. Simplify test for valid sh_link, sh_info and e_shstrndx fields. (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. Don't increment section numbers over reserved range. * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx. (bfd_section_from_shdr): Likewise. (group_signature): Range check before accessing elf_elfsections. (_bfd_elf_setup_sections): Likewise. (bfd_section_from_shdr): Likewise. (bfd_section_from_shdr): Don't increment section number over reserved sections. (assign_file_positions_for_non_load_sections): Likewise. (assign_file_positions_except_relocs): Likewise. (_bfd_elf_write_object_contents): Likewise. (assign_section_numbers): Likewise. Adjust for changed SHN_*. (prep_headers): Delete unused variable. * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust for changed SHN_* values. (check_dynsym, elf_link_input_bfd): Likewise. (bfd_elf_final_link): Likewise. Don't skip over reserved section range. (elf_fixup_link_order): Check that sh_link field is valid. * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned. * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before accesssing elf_elfsections. * elf32-avr.c (elf32_avr_size_stubs): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed SHN_* defines. Test for SHN_BAD return from _bfd_elf_section_from_bfd_section binutils/ PR 5900 * readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete. Remove use throughout file. (SECTION_HEADER): Likewise. (dump_relocations): Don't adjust st_shndx for reserved range. (process_file_header): Mask SHN_XINDEX to values seen in external elf structs. Simplify valid section index tests. (get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX. Map reserved st_shndx to internal form. (process_section_groups): Test that group symbol st_shndx is in range, not just non-zero. Delete reserved range check. (get_symbol_index_type): Mask "type" to 16 bits when printing PRC, OS or RSV. gdb/ PR 5900 * elfread.c (elf_symtab_read): Make shndx an unsigned int. * mipsread.c: Include elf/internal.h. (read_alphacoff_dynamic_symtab): Map external reserved sym_shndx to internal range. ld/testsuite/ PR 5900 * ld-elf/sec64k.exp: Update.
2008-03-12 09:37:09 +01:00
if (sec_symndx == SHN_BAD)
return FALSE;
include/elf/ PR 5900 * common.h (SHN_BAD): Delete. (SHN_LORESERVE .. SHN_HIRESERVE): Move to.. * external.h: ..here. * internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define. (SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define. (SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define. bfd/ PR 5900 * elf-bfd.h: Include elf/internal.h after elf/external.h. * elfcode.h (elf_swap_symbol_in): Map reserved shndx range. (elf_swap_symbol_out): Adjust SHN_XINDEX test. (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. (valid_section_index_p): Delete. (elf_object_p): Don't increment section numbers over reserved range. Simplify test for valid sh_link, sh_info and e_shstrndx fields. (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. Don't increment section numbers over reserved range. * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx. (bfd_section_from_shdr): Likewise. (group_signature): Range check before accessing elf_elfsections. (_bfd_elf_setup_sections): Likewise. (bfd_section_from_shdr): Likewise. (bfd_section_from_shdr): Don't increment section number over reserved sections. (assign_file_positions_for_non_load_sections): Likewise. (assign_file_positions_except_relocs): Likewise. (_bfd_elf_write_object_contents): Likewise. (assign_section_numbers): Likewise. Adjust for changed SHN_*. (prep_headers): Delete unused variable. * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust for changed SHN_* values. (check_dynsym, elf_link_input_bfd): Likewise. (bfd_elf_final_link): Likewise. Don't skip over reserved section range. (elf_fixup_link_order): Check that sh_link field is valid. * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned. * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before accesssing elf_elfsections. * elf32-avr.c (elf32_avr_size_stubs): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed SHN_* defines. Test for SHN_BAD return from _bfd_elf_section_from_bfd_section binutils/ PR 5900 * readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete. Remove use throughout file. (SECTION_HEADER): Likewise. (dump_relocations): Don't adjust st_shndx for reserved range. (process_file_header): Mask SHN_XINDEX to values seen in external elf structs. Simplify valid section index tests. (get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX. Map reserved st_shndx to internal form. (process_section_groups): Test that group symbol st_shndx is in range, not just non-zero. Delete reserved range check. (get_symbol_index_type): Mask "type" to 16 bits when printing PRC, OS or RSV. gdb/ PR 5900 * elfread.c (elf_symtab_read): Make shndx an unsigned int. * mipsread.c: Include elf/internal.h. (read_alphacoff_dynamic_symtab): Map external reserved sym_shndx to internal range. ld/testsuite/ PR 5900 * ld-elf/sec64k.exp: Update.
2008-03-12 09:37:09 +01:00
if (sec_symndx < SHN_LORESERVE)
sec_symndx = hppa_info->section_syms[sec_symndx];
else
sec_symndx = 0;
}
else
sec_symndx = 0;
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; ++rel)
{
2003-08-20 10:37:19 +02:00
enum
{
NEED_DLT = 1,
NEED_PLT = 2,
NEED_STUB = 4,
NEED_OPD = 8,
NEED_DYNREL = 16,
};
unsigned long r_symndx = ELF64_R_SYM (rel->r_info);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh;
int need_entry;
bfd_boolean maybe_dynamic;
int dynrel_type = R_PARISC_NONE;
static reloc_howto_type *howto;
if (r_symndx >= symtab_hdr->sh_info)
{
/* We're dealing with a global symbol -- find its hash entry
and mark it as being referenced. */
long indx = r_symndx - symtab_hdr->sh_info;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh = hppa_elf_hash_entry (elf_sym_hashes (abfd)[indx]);
while (hh->eh.root.type == bfd_link_hash_indirect
|| hh->eh.root.type == bfd_link_hash_warning)
hh = hppa_elf_hash_entry (hh->eh.root.u.i.link);
PR ld/15323 bfd/ * elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for global symbols referenced by relocs. * elf32-arm.c (elf32_arm_check_relocs): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. * elf32-cr16.c (cr16_elf_check_relocs): Likewise. * elf32-cris.c (cris_elf_check_relocs): Likewise. * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. * elf32-fr30.c (fr30_elf_check_relocs): Likewise. * elf32-frv.c (elf32_frv_check_relocs): Likewise. * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. * elf32-i370.c (i370_elf_check_relocs): Likewise. * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. * elf32-lm32.c (lm32_elf_check_relocs): Likewise. * elf32-m32c.c (m32c_elf_check_relocs): Likewise. * elf32-m32r.c (m32r_elf_check_relocs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_check_relocs): Likewise. * elf32-mcore.c (mcore_elf_check_relocs): Likewise. * elf32-metag.c (elf_metag_check_relocs): Likewise. * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise. * elf32-moxie.c (moxie_elf_check_relocs): Likewise. * elf32-msp430.c (elf32_msp430_check_relocs): Likewise. * elf32-mt.c (mt_elf_check_relocs): Likewise. * elf32-nios2.c (nios2_elf32_check_relocs): Likewise. * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise. * elf32-ppc.c (ppc_elf_check_relocs): Likewise. * elf32-rl78.c (rl78_elf_check_relocs): Likewise. * elf32-s390.c (elf_s390_check_relocs): Likewise. * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise. * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise. * elf32-sh.c (sh_elf_check_relocs): Likewise. * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise. * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise. * elf32-v850.c (v850_elf_check_relocs): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise. * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise. * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise. * elf64-mmix.c (mmix_elf_check_relocs): Likewise. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. * elf64-s390.c (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_check_relocs): Likewise. * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. Don't test indirect/warning links for NULL. ld/testsuite/ * ld-plugin/lto.exp (pr15323a.c): Compile without -flto rather than using -r to effectively strip out lto info.
2013-03-30 11:14:15 +01:00
/* PR15323, ref flags aren't set for references in the same
object. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->eh.ref_regular = 1;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
else
hh = NULL;
/* We can only get preliminary data on whether a symbol is
locally or externally defined, as not all of the input files
have yet been processed. Do something with what we know, as
this may help reduce memory usage and processing time later. */
maybe_dynamic = FALSE;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (hh && ((bfd_link_pic (info)
2004-09-16 16:52:12 +02:00
&& (!info->symbolic
|| info->unresolved_syms_in_shared_libs == RM_IGNORE))
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
|| !hh->eh.def_regular
|| hh->eh.root.type == bfd_link_hash_defweak))
maybe_dynamic = TRUE;
howto = elf_hppa_howto_table + ELF64_R_TYPE (rel->r_info);
need_entry = 0;
switch (howto->type)
{
/* These are simple indirect references to symbols through the
DLT. We need to create a DLT entry for any symbols which
appears in a DLTIND relocation. */
case R_PARISC_DLTIND21L:
case R_PARISC_DLTIND14R:
case R_PARISC_DLTIND14F:
case R_PARISC_DLTIND14WR:
case R_PARISC_DLTIND14DR:
need_entry = NEED_DLT;
break;
/* ?!? These need a DLT entry. But I have no idea what to do with
the "link time TP value. */
case R_PARISC_LTOFF_TP21L:
case R_PARISC_LTOFF_TP14R:
case R_PARISC_LTOFF_TP14F:
case R_PARISC_LTOFF_TP64:
case R_PARISC_LTOFF_TP14WR:
case R_PARISC_LTOFF_TP14DR:
case R_PARISC_LTOFF_TP16F:
case R_PARISC_LTOFF_TP16WF:
case R_PARISC_LTOFF_TP16DF:
need_entry = NEED_DLT;
break;
/* These are function calls. Depending on their precise target we
may need to make a stub for them. The stub uses the PLT, so we
need to create PLT entries for these symbols too. */
case R_PARISC_PCREL12F:
case R_PARISC_PCREL17F:
case R_PARISC_PCREL22F:
case R_PARISC_PCREL32:
case R_PARISC_PCREL64:
case R_PARISC_PCREL21L:
case R_PARISC_PCREL17R:
case R_PARISC_PCREL17C:
case R_PARISC_PCREL14R:
case R_PARISC_PCREL14F:
case R_PARISC_PCREL22C:
case R_PARISC_PCREL14WR:
case R_PARISC_PCREL14DR:
case R_PARISC_PCREL16F:
case R_PARISC_PCREL16WF:
case R_PARISC_PCREL16DF:
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Function calls might need to go through the .plt, and
might need a long branch stub. */
if (hh != NULL && hh->eh.type != STT_PARISC_MILLI)
need_entry = (NEED_PLT | NEED_STUB);
else
need_entry = 0;
break;
case R_PARISC_PLTOFF21L:
case R_PARISC_PLTOFF14R:
case R_PARISC_PLTOFF14F:
case R_PARISC_PLTOFF14WR:
case R_PARISC_PLTOFF14DR:
case R_PARISC_PLTOFF16F:
case R_PARISC_PLTOFF16WF:
case R_PARISC_PLTOFF16DF:
need_entry = (NEED_PLT);
break;
case R_PARISC_DIR64:
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) || maybe_dynamic)
need_entry = (NEED_DYNREL);
dynrel_type = R_PARISC_DIR64;
break;
/* This is an indirect reference through the DLT to get the address
of a OPD descriptor. Thus we need to make a DLT entry that points
to an OPD entry. */
case R_PARISC_LTOFF_FPTR21L:
case R_PARISC_LTOFF_FPTR14R:
case R_PARISC_LTOFF_FPTR14WR:
case R_PARISC_LTOFF_FPTR14DR:
case R_PARISC_LTOFF_FPTR32:
case R_PARISC_LTOFF_FPTR64:
case R_PARISC_LTOFF_FPTR16F:
case R_PARISC_LTOFF_FPTR16WF:
case R_PARISC_LTOFF_FPTR16DF:
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) || maybe_dynamic)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
need_entry = (NEED_DLT | NEED_OPD | NEED_PLT);
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
need_entry = (NEED_DLT | NEED_OPD | NEED_PLT);
dynrel_type = R_PARISC_FPTR64;
break;
/* This is a simple OPD entry. */
case R_PARISC_FPTR64:
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) || maybe_dynamic)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
need_entry = (NEED_OPD | NEED_PLT | NEED_DYNREL);
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
need_entry = (NEED_OPD | NEED_PLT);
dynrel_type = R_PARISC_FPTR64;
break;
/* Add more cases as needed. */
}
if (!need_entry)
continue;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh)
{
/* Stash away enough information to be able to find this symbol
regardless of whether or not it is local or global. */
hh->owner = abfd;
hh->sym_indx = r_symndx;
}
/* Create what's needed. */
if (need_entry & NEED_DLT)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Allocate space for a DLT entry, as well as a dynamic
relocation for this entry. */
if (! hppa_info->dlt_sec
&& ! get_dlt (abfd, info, hppa_info))
goto err_out;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh != NULL)
{
hh->want_dlt = 1;
hh->eh.got.refcount += 1;
}
else
{
bfd_signed_vma *local_dlt_refcounts;
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* This is a DLT entry for a local symbol. */
local_dlt_refcounts = hppa64_elf_local_refcounts (abfd);
if (local_dlt_refcounts == NULL)
return FALSE;
local_dlt_refcounts[r_symndx] += 1;
}
}
if (need_entry & NEED_PLT)
{
if (! hppa_info->root.splt
&& ! get_plt (abfd, info, hppa_info))
goto err_out;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh != NULL)
{
hh->want_plt = 1;
hh->eh.needs_plt = 1;
hh->eh.plt.refcount += 1;
}
else
{
bfd_signed_vma *local_dlt_refcounts;
bfd_signed_vma *local_plt_refcounts;
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* This is a PLT entry for a local symbol. */
local_dlt_refcounts = hppa64_elf_local_refcounts (abfd);
if (local_dlt_refcounts == NULL)
return FALSE;
local_plt_refcounts = local_dlt_refcounts + symtab_hdr->sh_info;
local_plt_refcounts[r_symndx] += 1;
}
}
if (need_entry & NEED_STUB)
{
if (! hppa_info->stub_sec
&& ! get_stub (abfd, info, hppa_info))
goto err_out;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh)
hh->want_stub = 1;
}
if (need_entry & NEED_OPD)
{
if (! hppa_info->opd_sec
&& ! get_opd (abfd, info, hppa_info))
goto err_out;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* FPTRs are not allocated by the dynamic linker for PA64,
though it is possible that will change in the future. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh != NULL)
hh->want_opd = 1;
else
{
bfd_signed_vma *local_dlt_refcounts;
bfd_signed_vma *local_opd_refcounts;
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* This is a OPD for a local symbol. */
local_dlt_refcounts = hppa64_elf_local_refcounts (abfd);
if (local_dlt_refcounts == NULL)
return FALSE;
local_opd_refcounts = (local_dlt_refcounts
+ 2 * symtab_hdr->sh_info);
local_opd_refcounts[r_symndx] += 1;
}
}
/* Add a new dynamic relocation to the chain of dynamic
relocations for this symbol. */
if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
{
if (! hppa_info->other_rel_sec
&& ! get_reloc_section (abfd, hppa_info, sec))
goto err_out;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
/* Count dynamic relocations against global symbols. */
if (hh != NULL
&& !count_dyn_reloc (abfd, hh, dynrel_type, sec,
sec_symndx, rel->r_offset, rel->r_addend))
goto err_out;
/* If we are building a shared library and we just recorded
a dynamic R_PARISC_FPTR64 relocation, then make sure the
section symbol for this section ends up in the dynamic
symbol table. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) && dynrel_type == R_PARISC_FPTR64
* Makefile.am: Remove all mention of elflink.h. * Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-27 11:58:09 +01:00
&& ! (bfd_elf_link_record_local_dynamic_symbol
(info, abfd, sec_symndx)))
return FALSE;
}
}
return TRUE;
err_out:
return FALSE;
}
struct elf64_hppa_allocate_data
{
struct bfd_link_info *info;
bfd_size_type ofs;
};
/* Should we do dynamic things to this symbol? */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_dynamic_symbol_p (struct elf_link_hash_entry *eh,
struct bfd_link_info *info)
{
/* ??? What, if anything, needs to happen wrt STV_PROTECTED symbols
and relocations that retrieve a function descriptor? Assume the
worst for now. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (_bfd_elf_dynamic_symbol_p (eh, info, 1))
{
/* ??? Why is this here and not elsewhere is_local_label_name. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh->root.root.string[0] == '$' && eh->root.root.string[1] == '$')
return FALSE;
return TRUE;
}
else
return FALSE;
}
/* Mark all functions exported by this file so that we can later allocate
entries in .opd for them. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_mark_exported_functions (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct bfd_link_info *info = (struct bfd_link_info *)data;
struct elf64_hppa_link_hash_table *hppa_info;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh
&& (eh->root.type == bfd_link_hash_defined
|| eh->root.type == bfd_link_hash_defweak)
&& eh->root.u.def.section->output_section != NULL
&& eh->type == STT_FUNC)
{
if (! hppa_info->opd_sec
&& ! get_opd (hppa_info->root.dynobj, info, hppa_info))
return FALSE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->want_opd = 1;
/* Put a flag here for output_symbol_hook. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->st_shndx = -1;
eh->needs_plt = 1;
}
return TRUE;
}
/* Allocate space for a DLT entry. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_dlt (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_dlt)
{
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (x->info))
{
/* Possibly add the symbol to the local dynamic symbol
table since we might need to create a dynamic relocation
against it. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh->dynindx == -1 && eh->type != STT_PARISC_MILLI)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd *owner = eh->root.u.def.section->owner;
* Makefile.am: Remove all mention of elflink.h. * Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-27 11:58:09 +01:00
if (! (bfd_elf_link_record_local_dynamic_symbol
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(x->info, owner, hh->sym_indx)))
return FALSE;
}
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->dlt_offset = x->ofs;
x->ofs += DLT_ENTRY_SIZE;
}
return TRUE;
}
/* Allocate space for a DLT.PLT entry. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_plt (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *) data;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_plt
&& elf64_hppa_dynamic_symbol_p (eh, x->info)
&& !((eh->root.type == bfd_link_hash_defined
|| eh->root.type == bfd_link_hash_defweak)
&& eh->root.u.def.section->output_section != NULL))
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->plt_offset = x->ofs;
x->ofs += PLT_ENTRY_SIZE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->plt_offset < 0x2000)
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
{
struct elf64_hppa_link_hash_table *hppa_info;
hppa_info = hppa_link_hash_table (x->info);
if (hppa_info == NULL)
return FALSE;
hppa_info->gp_offset = hh->plt_offset;
}
}
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->want_plt = 0;
return TRUE;
}
/* Allocate space for a STUB entry. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_stub (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_stub
&& elf64_hppa_dynamic_symbol_p (eh, x->info)
&& !((eh->root.type == bfd_link_hash_defined
|| eh->root.type == bfd_link_hash_defweak)
&& eh->root.u.def.section->output_section != NULL))
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->stub_offset = x->ofs;
x->ofs += sizeof (plt_stub);
}
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->want_stub = 0;
return TRUE;
}
/* Allocate space for a FPTR entry. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_opd (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh && hh->want_opd)
{
/* We never need an opd entry for a symbol which is not
defined by this output file. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh && (hh->eh.root.type == bfd_link_hash_undefined
|| hh->eh.root.type == bfd_link_hash_undefweak
|| hh->eh.root.u.def.section->output_section == NULL))
hh->want_opd = 0;
/* If we are creating a shared library, took the address of a local
function or might export this function from this object file, then
we have to create an opd descriptor. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
else if (bfd_link_pic (x->info)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
|| hh == NULL
|| (hh->eh.dynindx == -1 && hh->eh.type != STT_PARISC_MILLI)
|| (hh->eh.root.type == bfd_link_hash_defined
|| hh->eh.root.type == bfd_link_hash_defweak))
{
/* If we are creating a shared library, then we will have to
create a runtime relocation for the symbol to properly
initialize the .opd entry. Make sure the symbol gets
added to the dynamic symbol table. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (x->info)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
&& (hh == NULL || (hh->eh.dynindx == -1)))
{
bfd *owner;
/* PR 6511: Default to using the dynamic symbol table. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
owner = (hh->owner ? hh->owner: eh->root.u.def.section->owner);
* Makefile.am: Remove all mention of elflink.h. * Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-27 11:58:09 +01:00
if (!bfd_elf_link_record_local_dynamic_symbol
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(x->info, owner, hh->sym_indx))
return FALSE;
}
/* This may not be necessary or desirable anymore now that
we have some support for dealing with section symbols
in dynamic relocs. But name munging does make the result
much easier to debug. ie, the EPLT reloc will reference
a symbol like .foobar, instead of .text + offset. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (x->info) && eh)
{
char *new_name;
struct elf_link_hash_entry *nh;
new_name = concat (".", eh->root.root.string, NULL);
nh = elf_link_hash_lookup (elf_hash_table (x->info),
new_name, TRUE, TRUE, TRUE);
free (new_name);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
nh->root.type = eh->root.type;
nh->root.u.def.value = eh->root.u.def.value;
nh->root.u.def.section = eh->root.u.def.section;
* Makefile.am: Remove all mention of elflink.h. * Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-27 11:58:09 +01:00
if (! bfd_elf_link_record_dynamic_symbol (x->info, nh))
return FALSE;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->opd_offset = x->ofs;
x->ofs += OPD_ENTRY_SIZE;
}
/* Otherwise we do not need an opd entry. */
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->want_opd = 0;
}
return TRUE;
}
/* HP requires the EI_OSABI field to be filled in. The assignment to
EI_ABIVERSION may not be strictly necessary. */
elf_backend_init_file_header This patch renames elf_backend_post_process_headers and moves the prep_headers code into the new function. Naming the backend functions elf_backend_init_file_header and elf_backend_modify_headers makes it clear which function is called first. * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): Rename from elf_backend_post_process_headers. (_bfd_elf_post_process_headers): Delete. (_bfd_elf_init_file_header): Declare. * elf.c (_bfd_elf_compute_section_file_positions): Call new function in place of prep_headers and elf_backend_post_process_headers. (_bfd_elf_init_file_header): Renamed from prep_headers with updated args and made global. Delete dead code. (_bfd_elf_post_process_headers): Delete. * elf32-arm.c (elf32_arm_init_file_header): Rename from elf32_arm_post_process_headers and call _bfd_elf_init_file_header. Return status. (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. * elf32-metag.c (elf_metag_init_file_header): Similarly. * elf32-spu.c (spu_elf_init_file_header * elf32-visium.c (visium_elf_init_file_header * elf64-alpha.c (elf64_alpha_fbsd_init_file_header * elf64-hppa.c (elf64_hppa_init_file_header * elf64-ia64-vms.c (elf64_vms_init_file_header * elfnn-aarch64.c (elfNN_aarch64_init_file_header * elfnn-ia64.c (elfNN_hpux_init_file_header * elfxx-mips.c (_bfd_mips_init_file_header * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. (_bfd_mips_init_file_header): Declare. (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define. * elfxx-target.h (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define and use. * elf32-m68hc12.c (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. (elf32_m68hc11_init_file_header): Declare. * elf32-ppc.c (elf_backend_post_process_headers): Remove unnecessary undef.
2019-11-18 07:39:40 +01:00
static bfd_boolean
elf64_hppa_init_file_header (bfd *abfd, struct bfd_link_info *info)
{
elf_backend_init_file_header This patch renames elf_backend_post_process_headers and moves the prep_headers code into the new function. Naming the backend functions elf_backend_init_file_header and elf_backend_modify_headers makes it clear which function is called first. * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): Rename from elf_backend_post_process_headers. (_bfd_elf_post_process_headers): Delete. (_bfd_elf_init_file_header): Declare. * elf.c (_bfd_elf_compute_section_file_positions): Call new function in place of prep_headers and elf_backend_post_process_headers. (_bfd_elf_init_file_header): Renamed from prep_headers with updated args and made global. Delete dead code. (_bfd_elf_post_process_headers): Delete. * elf32-arm.c (elf32_arm_init_file_header): Rename from elf32_arm_post_process_headers and call _bfd_elf_init_file_header. Return status. (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. * elf32-metag.c (elf_metag_init_file_header): Similarly. * elf32-spu.c (spu_elf_init_file_header * elf32-visium.c (visium_elf_init_file_header * elf64-alpha.c (elf64_alpha_fbsd_init_file_header * elf64-hppa.c (elf64_hppa_init_file_header * elf64-ia64-vms.c (elf64_vms_init_file_header * elfnn-aarch64.c (elfNN_aarch64_init_file_header * elfnn-ia64.c (elfNN_hpux_init_file_header * elfxx-mips.c (_bfd_mips_init_file_header * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. (_bfd_mips_init_file_header): Declare. (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define. * elfxx-target.h (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define and use. * elf32-m68hc12.c (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. (elf32_m68hc11_init_file_header): Declare. * elf32-ppc.c (elf_backend_post_process_headers): Remove unnecessary undef.
2019-11-18 07:39:40 +01:00
Elf_Internal_Ehdr *i_ehdrp;
elf_backend_init_file_header This patch renames elf_backend_post_process_headers and moves the prep_headers code into the new function. Naming the backend functions elf_backend_init_file_header and elf_backend_modify_headers makes it clear which function is called first. * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): Rename from elf_backend_post_process_headers. (_bfd_elf_post_process_headers): Delete. (_bfd_elf_init_file_header): Declare. * elf.c (_bfd_elf_compute_section_file_positions): Call new function in place of prep_headers and elf_backend_post_process_headers. (_bfd_elf_init_file_header): Renamed from prep_headers with updated args and made global. Delete dead code. (_bfd_elf_post_process_headers): Delete. * elf32-arm.c (elf32_arm_init_file_header): Rename from elf32_arm_post_process_headers and call _bfd_elf_init_file_header. Return status. (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. * elf32-metag.c (elf_metag_init_file_header): Similarly. * elf32-spu.c (spu_elf_init_file_header * elf32-visium.c (visium_elf_init_file_header * elf64-alpha.c (elf64_alpha_fbsd_init_file_header * elf64-hppa.c (elf64_hppa_init_file_header * elf64-ia64-vms.c (elf64_vms_init_file_header * elfnn-aarch64.c (elfNN_aarch64_init_file_header * elfnn-ia64.c (elfNN_hpux_init_file_header * elfxx-mips.c (_bfd_mips_init_file_header * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. (_bfd_mips_init_file_header): Declare. (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define. * elfxx-target.h (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define and use. * elf32-m68hc12.c (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. (elf32_m68hc11_init_file_header): Declare. * elf32-ppc.c (elf_backend_post_process_headers): Remove unnecessary undef.
2019-11-18 07:39:40 +01:00
if (!_bfd_elf_init_file_header (abfd, info))
return FALSE;
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
elf_backend_init_file_header This patch renames elf_backend_post_process_headers and moves the prep_headers code into the new function. Naming the backend functions elf_backend_init_file_header and elf_backend_modify_headers makes it clear which function is called first. * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): Rename from elf_backend_post_process_headers. (_bfd_elf_post_process_headers): Delete. (_bfd_elf_init_file_header): Declare. * elf.c (_bfd_elf_compute_section_file_positions): Call new function in place of prep_headers and elf_backend_post_process_headers. (_bfd_elf_init_file_header): Renamed from prep_headers with updated args and made global. Delete dead code. (_bfd_elf_post_process_headers): Delete. * elf32-arm.c (elf32_arm_init_file_header): Rename from elf32_arm_post_process_headers and call _bfd_elf_init_file_header. Return status. (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. * elf32-metag.c (elf_metag_init_file_header): Similarly. * elf32-spu.c (spu_elf_init_file_header * elf32-visium.c (visium_elf_init_file_header * elf64-alpha.c (elf64_alpha_fbsd_init_file_header * elf64-hppa.c (elf64_hppa_init_file_header * elf64-ia64-vms.c (elf64_vms_init_file_header * elfnn-aarch64.c (elfNN_aarch64_init_file_header * elfnn-ia64.c (elfNN_hpux_init_file_header * elfxx-mips.c (_bfd_mips_init_file_header * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. (_bfd_mips_init_file_header): Declare. (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define. * elfxx-target.h (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define and use. * elf32-m68hc12.c (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. (elf32_m68hc11_init_file_header): Declare. * elf32-ppc.c (elf_backend_post_process_headers): Remove unnecessary undef.
2019-11-18 07:39:40 +01:00
i_ehdrp = elf_elfheader (abfd);
2007-03-13 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3826 * elf-bfd.h (elf_backend_data): Add elf_osabi. (_bfd_elf_set_osabi): New. * elf.c (_bfd_elf_set_osabi): New. * elf32-hppa.c (elf32_hppa_post_process_headers): Removed. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. (ELF_OSABI): Properly defined for each target. * elf32-i370.c (i370_elf_post_process_headers): Removed. (ELF_OSABI): Defined. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi. * elf32-msp430.c (elf32_msp430_post_process_headers): Removed. (ELF_OSABI): Defined. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with elf_osabi. * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI with elf_osabi. (ELF_OSABI): Properly defined for each target. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi for Linux. * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed. (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed. (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target with any ELF target of the compatible machine for which we do not have a specific backend. * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI with elf_osabi. * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE. (elfNN_bed): Initialize elf_osabi with ELF_OSABI.
2007-03-14 03:56:45 +01:00
i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
i_ehdrp->e_ident[EI_ABIVERSION] = 1;
elf_backend_init_file_header This patch renames elf_backend_post_process_headers and moves the prep_headers code into the new function. Naming the backend functions elf_backend_init_file_header and elf_backend_modify_headers makes it clear which function is called first. * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): Rename from elf_backend_post_process_headers. (_bfd_elf_post_process_headers): Delete. (_bfd_elf_init_file_header): Declare. * elf.c (_bfd_elf_compute_section_file_positions): Call new function in place of prep_headers and elf_backend_post_process_headers. (_bfd_elf_init_file_header): Renamed from prep_headers with updated args and made global. Delete dead code. (_bfd_elf_post_process_headers): Delete. * elf32-arm.c (elf32_arm_init_file_header): Rename from elf32_arm_post_process_headers and call _bfd_elf_init_file_header. Return status. (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. * elf32-metag.c (elf_metag_init_file_header): Similarly. * elf32-spu.c (spu_elf_init_file_header * elf32-visium.c (visium_elf_init_file_header * elf64-alpha.c (elf64_alpha_fbsd_init_file_header * elf64-hppa.c (elf64_hppa_init_file_header * elf64-ia64-vms.c (elf64_vms_init_file_header * elfnn-aarch64.c (elfNN_aarch64_init_file_header * elfnn-ia64.c (elfNN_hpux_init_file_header * elfxx-mips.c (_bfd_mips_init_file_header * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. (_bfd_mips_init_file_header): Declare. (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define. * elfxx-target.h (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define and use. * elf32-m68hc12.c (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. (elf32_m68hc11_init_file_header): Declare. * elf32-ppc.c (elf_backend_post_process_headers): Remove unnecessary undef.
2019-11-18 07:39:40 +01:00
return TRUE;
}
/* Create function descriptor section (.opd). This section is called .opd
because it contains "official procedure descriptors". The "official"
refers to the fact that these descriptors are used when taking the address
of a procedure, thus ensuring a unique address for each procedure. */
static bfd_boolean
get_opd (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct elf64_hppa_link_hash_table *hppa_info)
{
asection *opd;
bfd *dynobj;
opd = hppa_info->opd_sec;
if (!opd)
{
dynobj = hppa_info->root.dynobj;
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
2012-06-29 16:46:03 +02:00
opd = bfd_make_section_anyway_with_flags (dynobj, ".opd",
(SEC_ALLOC
| SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (!opd
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (opd, 3))
{
BFD_ASSERT (0);
return FALSE;
}
hppa_info->opd_sec = opd;
}
return TRUE;
}
/* Create the PLT section. */
static bfd_boolean
get_plt (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct elf64_hppa_link_hash_table *hppa_info)
{
asection *plt;
bfd *dynobj;
plt = hppa_info->root.splt;
if (!plt)
{
dynobj = hppa_info->root.dynobj;
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
2012-06-29 16:46:03 +02:00
plt = bfd_make_section_anyway_with_flags (dynobj, ".plt",
(SEC_ALLOC
| SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (!plt
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (plt, 3))
{
BFD_ASSERT (0);
return FALSE;
}
hppa_info->root.splt = plt;
}
return TRUE;
}
/* Create the DLT section. */
static bfd_boolean
get_dlt (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct elf64_hppa_link_hash_table *hppa_info)
{
asection *dlt;
bfd *dynobj;
dlt = hppa_info->dlt_sec;
if (!dlt)
{
dynobj = hppa_info->root.dynobj;
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
2012-06-29 16:46:03 +02:00
dlt = bfd_make_section_anyway_with_flags (dynobj, ".dlt",
(SEC_ALLOC
| SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (!dlt
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (dlt, 3))
{
BFD_ASSERT (0);
return FALSE;
}
hppa_info->dlt_sec = dlt;
}
return TRUE;
}
/* Create the stubs section. */
static bfd_boolean
get_stub (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct elf64_hppa_link_hash_table *hppa_info)
{
asection *stub;
bfd *dynobj;
stub = hppa_info->stub_sec;
if (!stub)
{
dynobj = hppa_info->root.dynobj;
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
2012-06-29 16:46:03 +02:00
stub = bfd_make_section_anyway_with_flags (dynobj, ".stub",
(SEC_ALLOC | SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_READONLY
| SEC_LINKER_CREATED));
if (!stub
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (stub, 3))
{
BFD_ASSERT (0);
return FALSE;
}
hppa_info->stub_sec = stub;
}
return TRUE;
}
/* Create sections necessary for dynamic linking. This is only a rough
cut and will likely change as we learn more about the somewhat
unusual dynamic linking scheme HP uses.
.stub:
Contains code to implement cross-space calls. The first time one
of the stubs is used it will call into the dynamic linker, later
calls will go straight to the target.
The only stub we support right now looks like
ldd OFFSET(%dp),%r1
bve %r0(%r1)
ldd OFFSET+8(%dp),%dp
Other stubs may be needed in the future. We may want the remove
the break/nop instruction. It is only used right now to keep the
offset of a .plt entry and a .stub entry in sync.
.dlt:
This is what most people call the .got. HP used a different name.
Losers.
.rela.dlt:
Relocations for the DLT.
.plt:
Function pointers as address,gp pairs.
.rela.plt:
Should contain dynamic IPLT (and EPLT?) relocations.
.opd:
FPTRS
.rela.opd:
EPLT relocations for symbols exported from shared libraries. */
static bfd_boolean
elf64_hppa_create_dynamic_sections (bfd *abfd,
struct bfd_link_info *info)
{
asection *s;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
struct elf64_hppa_link_hash_table *hppa_info;
hppa_info = hppa_link_hash_table (info);
if (hppa_info == NULL)
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (! get_stub (abfd, info, hppa_info))
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (! get_dlt (abfd, info, hppa_info))
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (! get_plt (abfd, info, hppa_info))
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (! get_opd (abfd, info, hppa_info))
return FALSE;
2012-06-29 16:46:03 +02:00
s = bfd_make_section_anyway_with_flags (abfd, ".rela.dlt",
(SEC_ALLOC | SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (s, 3))
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
hppa_info->dlt_rel_sec = s;
2012-06-29 16:46:03 +02:00
s = bfd_make_section_anyway_with_flags (abfd, ".rela.plt",
(SEC_ALLOC | SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (s, 3))
return FALSE;
hppa_info->root.srelplt = s;
2012-06-29 16:46:03 +02:00
s = bfd_make_section_anyway_with_flags (abfd, ".rela.data",
(SEC_ALLOC | SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (s, 3))
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
hppa_info->other_rel_sec = s;
2012-06-29 16:46:03 +02:00
s = bfd_make_section_anyway_with_flags (abfd, ".rela.opd",
(SEC_ALLOC | SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
|| !bfd_set_section_alignment (s, 3))
return FALSE;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
hppa_info->opd_rel_sec = s;
return TRUE;
}
/* Allocate dynamic relocations for those symbols that turned out
to be dynamic. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_dynrel_entries (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
struct elf64_hppa_link_hash_table *hppa_info;
struct elf64_hppa_dyn_reloc_entry *rent;
bfd_boolean dynamic_symbol, shared;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (x->info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
dynamic_symbol = elf64_hppa_dynamic_symbol_p (eh, x->info);
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
shared = bfd_link_pic (x->info);
/* We may need to allocate relocations for a non-dynamic symbol
when creating a shared library. */
if (!dynamic_symbol && !shared)
return TRUE;
/* Take care of the normal data relocations. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
for (rent = hh->reloc_entries; rent; rent = rent->next)
{
/* Allocate one iff we are building a shared library, the relocation
isn't a R_PARISC_FPTR64, or we don't want an opd entry. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (!shared && rent->type == R_PARISC_FPTR64 && hh->want_opd)
continue;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
hppa_info->other_rel_sec->size += sizeof (Elf64_External_Rela);
/* Make sure this symbol gets into the dynamic symbol table if it is
not already recorded. ?!? This should not be in the loop since
the symbol need only be added once. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh->dynindx == -1 && eh->type != STT_PARISC_MILLI)
* Makefile.am: Remove all mention of elflink.h. * Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-27 11:58:09 +01:00
if (!bfd_elf_link_record_local_dynamic_symbol
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
(x->info, rent->sec->owner, hh->sym_indx))
return FALSE;
}
/* Take care of the GOT and PLT relocations. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if ((dynamic_symbol || shared) && hh->want_dlt)
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
hppa_info->dlt_rel_sec->size += sizeof (Elf64_External_Rela);
/* If we are building a shared library, then every symbol that has an
opd entry will need an EPLT relocation to relocate the symbol's address
and __gp value based on the runtime load address. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (shared && hh->want_opd)
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
hppa_info->opd_rel_sec->size += sizeof (Elf64_External_Rela);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_plt && dynamic_symbol)
{
bfd_size_type t = 0;
/* Dynamic symbols get one IPLT relocation. Local symbols in
shared libraries get two REL relocations. Local symbols in
main applications get nothing. */
if (dynamic_symbol)
t = sizeof (Elf64_External_Rela);
else if (shared)
t = 2 * sizeof (Elf64_External_Rela);
hppa_info->root.srelplt->size += t;
}
return TRUE;
}
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. */
static bfd_boolean
elf64_hppa_adjust_dynamic_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf_link_hash_entry *eh)
{
/* ??? Undefined symbols with PLT entries should be re-defined
to be the PLT entry. */
/* If this is a weak symbol, and there is a real definition, the
processor independent code will have arranged for us to see the
real definition first, and we can just use the same value. */
Rename u.weakdef and make it a circular list This makes the elf_link_hash_entry weakdef field, currently used to point from a weak symbol to a strong alias, a circular list so that all aliases can be found from any of them. A new flag, is_weakalias, distinguishes the weak symbol from a strong alias, and is used in all places where we currently test u.weakdef != NULL. With the original u.weakdef handling it was possible to have two or more weak symbols pointing via u.weakdef to a strong definition. Obviously that situation can't map to a circular list; One or more of the weak symbols must point at another weak alias rather than the strong definition. To handle that, I've added an accessor function to return the strong definition. * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias. Rename u.weakdef to u.alias and update comment. (weakdef): New static inline function. * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias rather than u.weakdef != NULL, and use weakdef function. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on all aliases if def has been overridden in a regular object, not u.weakdef. (elf_link_add_object_symbols): Delete new_weakdef flag. Test is_weakalias and use weakdef. Set is_weakalias and circular u.alias. Update comments. (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than u.weakdef != NULL and use weakdef function. * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test is_weakalias rather than u.weakdef != NULL and use weakdef function. Assert that def is strong defined. * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise. * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise. (bfin_adjust_dynamic_symbol): Likewise. * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise. * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise. * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise. * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise. * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise. * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise. * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise. * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise. * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise. (tilepro_elf_adjust_dynamic_symbol): Likewise. * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise. * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise. * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise. * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. (ppc64_elf_adjust_dynamic_symbol): Likewise. * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise. * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise. * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise. * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise. (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise. (tilegx_elf_adjust_dynamic_symbol): Likewise. * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2017-11-22 08:00:55 +01:00
if (eh->is_weakalias)
{
Rename u.weakdef and make it a circular list This makes the elf_link_hash_entry weakdef field, currently used to point from a weak symbol to a strong alias, a circular list so that all aliases can be found from any of them. A new flag, is_weakalias, distinguishes the weak symbol from a strong alias, and is used in all places where we currently test u.weakdef != NULL. With the original u.weakdef handling it was possible to have two or more weak symbols pointing via u.weakdef to a strong definition. Obviously that situation can't map to a circular list; One or more of the weak symbols must point at another weak alias rather than the strong definition. To handle that, I've added an accessor function to return the strong definition. * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias. Rename u.weakdef to u.alias and update comment. (weakdef): New static inline function. * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias rather than u.weakdef != NULL, and use weakdef function. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on all aliases if def has been overridden in a regular object, not u.weakdef. (elf_link_add_object_symbols): Delete new_weakdef flag. Test is_weakalias and use weakdef. Set is_weakalias and circular u.alias. Update comments. (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than u.weakdef != NULL and use weakdef function. * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test is_weakalias rather than u.weakdef != NULL and use weakdef function. Assert that def is strong defined. * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise. * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise. (bfin_adjust_dynamic_symbol): Likewise. * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise. * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise. * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise. * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise. * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise. * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise. * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise. * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise. * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise. (tilepro_elf_adjust_dynamic_symbol): Likewise. * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise. * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise. * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise. * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. (ppc64_elf_adjust_dynamic_symbol): Likewise. * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise. * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise. * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise. * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise. (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise. (tilegx_elf_adjust_dynamic_symbol): Likewise. * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2017-11-22 08:00:55 +01:00
struct elf_link_hash_entry *def = weakdef (eh);
BFD_ASSERT (def->root.type == bfd_link_hash_defined);
eh->root.u.def.section = def->root.u.def.section;
eh->root.u.def.value = def->root.u.def.value;
return TRUE;
}
/* If this is a reference to a symbol defined by a dynamic object which
is not a function, we might allocate the symbol in our .dynbss section
and allocate a COPY dynamic relocation.
But PA64 code is canonically PIC, so as a rule we can avoid this sort
of hackery. */
return TRUE;
}
/* This function is called via elf_link_hash_traverse to mark millicode
symbols with a dynindx of -1 and to remove the string table reference
from the dynamic symbol table. If the symbol is not a millicode symbol,
elf64_hppa_mark_exported_functions is called. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_mark_milli_and_exported_functions (struct elf_link_hash_entry *eh,
void *data)
{
* linker.c (bfd_link_hash_traverse): Follow warning symbol link. (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle warning symbols here. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.c (allocate_dynrelocs_for_symbol, elf32_arm_readonly_dynrelocs): Likewise. * elf32-bfin.c (bfin_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): Likewise. * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, clobber_millicode_symbols, readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-i386.c (elf_i386_allocate_dynrelocs, elf_i386_readonly_dynrelocs): Likewise. * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-microblaze.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-score.c (score_elf_sort_hash_table_f): Likewise. * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, elf32_tic6x_readonly_dynrelocs): Likewise. * elf32-vax.c (elf_vax_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check, xstormy16_relax_plt_realloc): Likewise. * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions, allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, elf_hppa_unmark_useless_dynamic_symbols, elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, readonly_dynrelocs, merge_global_got, reallocate_got, undo_symbol_twiddle): Likewise. * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, elf_x86_64_readonly_dynrelocs): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms, elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, elf_collect_hash_codes, elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, elf_gc_propagate_vtable_entries_used, elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, elf_gc_allocate_got_offsets): Likewise. * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, elfNN_ia64_global_dyn_sym_thunk): Likewise. * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_post_gc_symbol): Likewise. * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse function. Update all callers. * aoutx.h (aout_link_write_other_symbol): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * ecoff.c (ecoff_link_write_external): Likewise. * xcofflink.c (xcoff_write_global_symbol): Likewise. * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle warning symbols. * ecoff.c (ecoff_link_hash_traverse): Delete. * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for _bfd_coff_write_global_sym. * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. * libcoff.h: Regenerate.
2011-06-13 02:59:15 +02:00
struct bfd_link_info *info = (struct bfd_link_info *) data;
* linker.c (bfd_link_hash_traverse): Follow warning symbol link. (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle warning symbols here. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.c (allocate_dynrelocs_for_symbol, elf32_arm_readonly_dynrelocs): Likewise. * elf32-bfin.c (bfin_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): Likewise. * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, clobber_millicode_symbols, readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-i386.c (elf_i386_allocate_dynrelocs, elf_i386_readonly_dynrelocs): Likewise. * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-microblaze.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-score.c (score_elf_sort_hash_table_f): Likewise. * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, elf32_tic6x_readonly_dynrelocs): Likewise. * elf32-vax.c (elf_vax_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check, xstormy16_relax_plt_realloc): Likewise. * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions, allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, elf_hppa_unmark_useless_dynamic_symbols, elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, readonly_dynrelocs, merge_global_got, reallocate_got, undo_symbol_twiddle): Likewise. * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, elf_x86_64_readonly_dynrelocs): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms, elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, elf_collect_hash_codes, elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, elf_gc_propagate_vtable_entries_used, elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, elf_gc_allocate_got_offsets): Likewise. * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, elfNN_ia64_global_dyn_sym_thunk): Likewise. * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_post_gc_symbol): Likewise. * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse function. Update all callers. * aoutx.h (aout_link_write_other_symbol): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * ecoff.c (ecoff_link_write_external): Likewise. * xcofflink.c (xcoff_write_global_symbol): Likewise. * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle warning symbols. * ecoff.c (ecoff_link_hash_traverse): Delete. * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for _bfd_coff_write_global_sym. * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. * libcoff.h: Regenerate.
2011-06-13 02:59:15 +02:00
if (eh->type == STT_PARISC_MILLI)
{
* linker.c (bfd_link_hash_traverse): Follow warning symbol link. (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle warning symbols here. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.c (allocate_dynrelocs_for_symbol, elf32_arm_readonly_dynrelocs): Likewise. * elf32-bfin.c (bfin_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): Likewise. * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, clobber_millicode_symbols, readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-i386.c (elf_i386_allocate_dynrelocs, elf_i386_readonly_dynrelocs): Likewise. * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-microblaze.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-score.c (score_elf_sort_hash_table_f): Likewise. * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, elf32_tic6x_readonly_dynrelocs): Likewise. * elf32-vax.c (elf_vax_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check, xstormy16_relax_plt_realloc): Likewise. * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions, allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, elf_hppa_unmark_useless_dynamic_symbols, elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, readonly_dynrelocs, merge_global_got, reallocate_got, undo_symbol_twiddle): Likewise. * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, elf_x86_64_readonly_dynrelocs): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms, elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, elf_collect_hash_codes, elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, elf_gc_propagate_vtable_entries_used, elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, elf_gc_allocate_got_offsets): Likewise. * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, elfNN_ia64_global_dyn_sym_thunk): Likewise. * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_post_gc_symbol): Likewise. * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse function. Update all callers. * aoutx.h (aout_link_write_other_symbol): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * ecoff.c (ecoff_link_write_external): Likewise. * xcofflink.c (xcoff_write_global_symbol): Likewise. * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle warning symbols. * ecoff.c (ecoff_link_hash_traverse): Delete. * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for _bfd_coff_write_global_sym. * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. * libcoff.h: Regenerate.
2011-06-13 02:59:15 +02:00
if (eh->dynindx != -1)
{
* linker.c (bfd_link_hash_traverse): Follow warning symbol link. (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle warning symbols here. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.c (allocate_dynrelocs_for_symbol, elf32_arm_readonly_dynrelocs): Likewise. * elf32-bfin.c (bfin_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): Likewise. * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, clobber_millicode_symbols, readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-i386.c (elf_i386_allocate_dynrelocs, elf_i386_readonly_dynrelocs): Likewise. * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-microblaze.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-score.c (score_elf_sort_hash_table_f): Likewise. * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, elf32_tic6x_readonly_dynrelocs): Likewise. * elf32-vax.c (elf_vax_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check, xstormy16_relax_plt_realloc): Likewise. * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions, allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, elf_hppa_unmark_useless_dynamic_symbols, elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, readonly_dynrelocs, merge_global_got, reallocate_got, undo_symbol_twiddle): Likewise. * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, elf_x86_64_readonly_dynrelocs): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms, elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, elf_collect_hash_codes, elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, elf_gc_propagate_vtable_entries_used, elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, elf_gc_allocate_got_offsets): Likewise. * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, elfNN_ia64_global_dyn_sym_thunk): Likewise. * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_post_gc_symbol): Likewise. * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse function. Update all callers. * aoutx.h (aout_link_write_other_symbol): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * ecoff.c (ecoff_link_write_external): Likewise. * xcofflink.c (xcoff_write_global_symbol): Likewise. * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle warning symbols. * ecoff.c (ecoff_link_hash_traverse): Delete. * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for _bfd_coff_write_global_sym. * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. * libcoff.h: Regenerate.
2011-06-13 02:59:15 +02:00
eh->dynindx = -1;
_bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
* linker.c (bfd_link_hash_traverse): Follow warning symbol link. (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle warning symbols here. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.c (allocate_dynrelocs_for_symbol, elf32_arm_readonly_dynrelocs): Likewise. * elf32-bfin.c (bfin_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): Likewise. * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, clobber_millicode_symbols, readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-i386.c (elf_i386_allocate_dynrelocs, elf_i386_readonly_dynrelocs): Likewise. * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-microblaze.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-score.c (score_elf_sort_hash_table_f): Likewise. * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, elf32_tic6x_readonly_dynrelocs): Likewise. * elf32-vax.c (elf_vax_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check, xstormy16_relax_plt_realloc): Likewise. * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions, allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, elf_hppa_unmark_useless_dynamic_symbols, elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, readonly_dynrelocs, merge_global_got, reallocate_got, undo_symbol_twiddle): Likewise. * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, elf_x86_64_readonly_dynrelocs): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms, elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, elf_collect_hash_codes, elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, elf_gc_propagate_vtable_entries_used, elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, elf_gc_allocate_got_offsets): Likewise. * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, elfNN_ia64_global_dyn_sym_thunk): Likewise. * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_post_gc_symbol): Likewise. * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse function. Update all callers. * aoutx.h (aout_link_write_other_symbol): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * ecoff.c (ecoff_link_write_external): Likewise. * xcofflink.c (xcoff_write_global_symbol): Likewise. * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle warning symbols. * ecoff.c (ecoff_link_hash_traverse): Delete. * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for _bfd_coff_write_global_sym. * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. * libcoff.h: Regenerate.
2011-06-13 02:59:15 +02:00
eh->dynstr_index);
}
return TRUE;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
return elf64_hppa_mark_exported_functions (eh, data);
}
/* Set the final sizes of the dynamic sections and allocate memory for
the contents of our special sections. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_table *hppa_info;
struct elf64_hppa_allocate_data data;
bfd *dynobj;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd *ibfd;
asection *sec;
bfd_boolean relocs;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
dynobj = hppa_info->root.dynobj;
BFD_ASSERT (dynobj != NULL);
/* Mark each function this program exports so that we will allocate
space in the .opd section for each function's FPTR. If we are
creating dynamic sections, change the dynamic index of millicode
symbols to -1 and remove them from the string table for .dynstr.
We have to traverse the main linker hash table since we have to
find functions which may not have been mentioned in any relocs. */
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
elf_link_hash_traverse (&hppa_info->root,
(hppa_info->root.dynamic_sections_created
? elf64_hppa_mark_milli_and_exported_functions
: elf64_hppa_mark_exported_functions),
info);
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
if (hppa_info->root.dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
Add --no-dynamic-linker option to ld, for static PIE use Inhibits output of .interp section in ELF executables. include/ * bfdlink.h (struct bfd_link_info): Add "nointerp" field. bfd/ * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create .interp when info->nointerp. (bfd_elf_size_dynamic_sections): Adjust assert. * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't size .interp when info->nointerp. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-metag.c (elf_metag_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise. * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. ld/ * ld.texinfo (--no-dynamic-linker): Document. * ldlex.h (enum option_values): Add OPTION_NO_DYNAMIC_LINKER. * lexsup.c (ld_options, parse_args): Handle --no-dynamic-linker.
2015-09-20 04:50:19 +02:00
if (bfd_link_executable (info) && !info->nointerp)
{
2012-06-29 16:46:03 +02:00
sec = bfd_get_linker_section (dynobj, ".interp");
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
BFD_ASSERT (sec != NULL);
sec->size = sizeof ELF_DYNAMIC_INTERPRETER;
sec->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
}
}
else
{
/* We may have created entries in the .rela.got section.
However, if we are not creating the dynamic sections, we will
not actually use these entries. Reset the size of .rela.dlt,
which will cause it to get stripped from the output file
below. */
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
sec = hppa_info->dlt_rel_sec;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (sec != NULL)
sec->size = 0;
}
/* Set up DLT, PLT and OPD offsets for local syms, and space for local
dynamic relocs. */
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
{
bfd_signed_vma *local_dlt;
bfd_signed_vma *end_local_dlt;
bfd_signed_vma *local_plt;
bfd_signed_vma *end_local_plt;
bfd_signed_vma *local_opd;
bfd_signed_vma *end_local_opd;
bfd_size_type locsymcount;
Elf_Internal_Shdr *symtab_hdr;
asection *srel;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
continue;
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
struct elf64_hppa_dyn_reloc_entry *hdh_p;
for (hdh_p = ((struct elf64_hppa_dyn_reloc_entry *)
elf_section_data (sec)->local_dynrel);
hdh_p != NULL;
hdh_p = hdh_p->next)
{
if (!bfd_is_abs_section (hdh_p->sec)
&& bfd_is_abs_section (hdh_p->sec->output_section))
{
/* Input section has been discarded, either because
it is a copy of a linkonce section or due to
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
else if (hdh_p->count != 0)
{
srel = elf_section_data (hdh_p->sec)->sreloc;
srel->size += hdh_p->count * sizeof (Elf64_External_Rela);
if ((hdh_p->sec->output_section->flags & SEC_READONLY) != 0)
info->flags |= DF_TEXTREL;
}
}
}
local_dlt = elf_local_got_refcounts (ibfd);
if (!local_dlt)
continue;
symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
locsymcount = symtab_hdr->sh_info;
end_local_dlt = local_dlt + locsymcount;
sec = hppa_info->dlt_sec;
srel = hppa_info->dlt_rel_sec;
for (; local_dlt < end_local_dlt; ++local_dlt)
{
if (*local_dlt > 0)
{
*local_dlt = sec->size;
sec->size += DLT_ENTRY_SIZE;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info))
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
srel->size += sizeof (Elf64_External_Rela);
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
}
else
*local_dlt = (bfd_vma) -1;
}
local_plt = end_local_dlt;
end_local_plt = local_plt + locsymcount;
if (! hppa_info->root.dynamic_sections_created)
{
/* Won't be used, but be safe. */
for (; local_plt < end_local_plt; ++local_plt)
*local_plt = (bfd_vma) -1;
}
else
{
sec = hppa_info->root.splt;
srel = hppa_info->root.srelplt;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
for (; local_plt < end_local_plt; ++local_plt)
{
if (*local_plt > 0)
{
*local_plt = sec->size;
sec->size += PLT_ENTRY_SIZE;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info))
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
srel->size += sizeof (Elf64_External_Rela);
}
else
*local_plt = (bfd_vma) -1;
}
}
local_opd = end_local_plt;
end_local_opd = local_opd + locsymcount;
if (! hppa_info->root.dynamic_sections_created)
{
/* Won't be used, but be safe. */
for (; local_opd < end_local_opd; ++local_opd)
*local_opd = (bfd_vma) -1;
}
else
{
sec = hppa_info->opd_sec;
srel = hppa_info->opd_rel_sec;
for (; local_opd < end_local_opd; ++local_opd)
{
if (*local_opd > 0)
{
*local_opd = sec->size;
sec->size += OPD_ENTRY_SIZE;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info))
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
srel->size += sizeof (Elf64_External_Rela);
}
else
*local_opd = (bfd_vma) -1;
}
}
}
/* Allocate the GOT entries. */
data.info = info;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hppa_info->dlt_sec)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
data.ofs = hppa_info->dlt_sec->size;
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
elf_link_hash_traverse (&hppa_info->root,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_dlt, &data);
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
hppa_info->dlt_sec->size = data.ofs;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
}
if (hppa_info->root.splt)
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
{
data.ofs = hppa_info->root.splt->size;
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
elf_link_hash_traverse (&hppa_info->root,
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
allocate_global_data_plt, &data);
hppa_info->root.splt->size = data.ofs;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hppa_info->stub_sec)
{
data.ofs = 0x0;
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
elf_link_hash_traverse (&hppa_info->root,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_stub, &data);
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
hppa_info->stub_sec->size = data.ofs;
}
/* Allocate space for entries in the .opd section. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hppa_info->opd_sec)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
data.ofs = hppa_info->opd_sec->size;
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
elf_link_hash_traverse (&hppa_info->root,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_global_data_opd, &data);
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
hppa_info->opd_sec->size = data.ofs;
}
/* Now allocate space for dynamic relocations, if necessary. */
if (hppa_info->root.dynamic_sections_created)
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
elf_link_hash_traverse (&hppa_info->root,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
allocate_dynrel_entries, &data);
/* The sizes of all the sections are set. Allocate memory for them. */
relocs = FALSE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
for (sec = dynobj->sections; sec != NULL; sec = sec->next)
{
const char *name;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if ((sec->flags & SEC_LINKER_CREATED) == 0)
continue;
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
name = bfd_section_name (sec);
if (strcmp (name, ".plt") == 0)
{
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none of the usual sections are found. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. Strip .dynbss if it is zero size. * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and .dynsbss. (i370_elf_finish_dynamic_sections): Don't attempt to write .got when it is zero size. * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling of .dynbss and zero size sections. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if it is zero size. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss too. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip .plt.* and .got.plt.* if zero size. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip .got* and .dynbss if zero size. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip * elf64-ppc.c (create_linkage_sections): Create branch lookup table in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated reloc section. (create_got_section): Always create new .got and .rela.got sections. (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle dynamic bss sections correctly. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size.
2005-07-08 08:20:06 +02:00
/* Remember whether there is a PLT. */
ELF: Add _bfd_elf_add_dynamic_tags All ELF backends with shared library support need to add dynamic tags. Add dt_pltgot_required and dt_jmprel_required to elf_link_hash_table to indicate that DT_PLTGOT and DT_JMPREL are required dynamic tags. 1. Add _bfd_elf_add_dynamic_tags to add common dynamic tags. 2. Add _bfd_elf_maybe_vxworks_add_dynamic_tags to add common VxWorks dynamic tags. * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and dt_jmprel_required. (_bfd_elf_add_dynamic_tags): New. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. * elf32-arm.c (elf32_arm_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc, dt_reloc_sz and dt_reloc_ent. * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New. * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set etab.dt_pltgot_required. (elf32_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-metag.c (elf_metag_link_hash_table_create): Set etab.dt_pltgot_required. (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-sh.c (sh_elf_link_hash_table_create): Set root.dt_pltgot_required for FDPIC output. (sh_elf_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set elf.dt_pltgot_required. (elf_xtensa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf64-hppa.c (elf64_hppa_hash_table_create): Set root.dt_pltgot_required. (elf64_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set root.dt_pltgot_required. (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags. * elflink.c (_bfd_elf_add_dynamic_tags): New.
2020-06-23 14:07:31 +02:00
;
}
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none of the usual sections are found. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. Strip .dynbss if it is zero size. * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and .dynsbss. (i370_elf_finish_dynamic_sections): Don't attempt to write .got when it is zero size. * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling of .dynbss and zero size sections. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if it is zero size. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss too. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip .plt.* and .got.plt.* if zero size. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip .got* and .dynbss if zero size. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip * elf64-ppc.c (create_linkage_sections): Create branch lookup table in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated reloc section. (create_got_section): Always create new .got and .rela.got sections. (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle dynamic bss sections correctly. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size.
2005-07-08 08:20:06 +02:00
else if (strcmp (name, ".opd") == 0
|| CONST_STRNEQ (name, ".dlt")
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none of the usual sections are found. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. Strip .dynbss if it is zero size. * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and .dynsbss. (i370_elf_finish_dynamic_sections): Don't attempt to write .got when it is zero size. * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling of .dynbss and zero size sections. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if it is zero size. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss too. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip .plt.* and .got.plt.* if zero size. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip .got* and .dynbss if zero size. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip * elf64-ppc.c (create_linkage_sections): Create branch lookup table in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated reloc section. (create_got_section): Always create new .got and .rela.got sections. (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle dynamic bss sections correctly. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size.
2005-07-08 08:20:06 +02:00
|| strcmp (name, ".stub") == 0
|| strcmp (name, ".got") == 0)
{
/* Strip this section if we don't need it; see the comment below. */
}
else if (CONST_STRNEQ (name, ".rela"))
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (sec->size != 0)
{
/* Remember whether there are any reloc sections other
than .rela.plt. */
if (strcmp (name, ".rela.plt") != 0)
ELF: Add _bfd_elf_add_dynamic_tags All ELF backends with shared library support need to add dynamic tags. Add dt_pltgot_required and dt_jmprel_required to elf_link_hash_table to indicate that DT_PLTGOT and DT_JMPREL are required dynamic tags. 1. Add _bfd_elf_add_dynamic_tags to add common dynamic tags. 2. Add _bfd_elf_maybe_vxworks_add_dynamic_tags to add common VxWorks dynamic tags. * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and dt_jmprel_required. (_bfd_elf_add_dynamic_tags): New. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. * elf32-arm.c (elf32_arm_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc, dt_reloc_sz and dt_reloc_ent. * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New. * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set etab.dt_pltgot_required. (elf32_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-metag.c (elf_metag_link_hash_table_create): Set etab.dt_pltgot_required. (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-sh.c (sh_elf_link_hash_table_create): Set root.dt_pltgot_required for FDPIC output. (sh_elf_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set elf.dt_pltgot_required. (elf_xtensa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf64-hppa.c (elf64_hppa_hash_table_create): Set root.dt_pltgot_required. (elf64_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set root.dt_pltgot_required. (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags. * elflink.c (_bfd_elf_add_dynamic_tags): New.
2020-06-23 14:07:31 +02:00
relocs = TRUE;
/* We use the reloc_count field as a counter if we need
to copy relocs into the output file. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
sec->reloc_count = 0;
}
}
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none of the usual sections are found. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. Strip .dynbss if it is zero size. * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and .dynsbss. (i370_elf_finish_dynamic_sections): Don't attempt to write .got when it is zero size. * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling of .dynbss and zero size sections. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if it is zero size. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss too. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip .plt.* and .got.plt.* if zero size. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip .got* and .dynbss if zero size. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip * elf64-ppc.c (create_linkage_sections): Create branch lookup table in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated reloc section. (create_got_section): Always create new .got and .rela.got sections. (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle dynamic bss sections correctly. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size.
2005-07-08 08:20:06 +02:00
else
{
/* It's not one of our sections, so don't allocate space. */
continue;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (sec->size == 0)
{
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none of the usual sections are found. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. Strip .dynbss if it is zero size. * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and .dynsbss. (i370_elf_finish_dynamic_sections): Don't attempt to write .got when it is zero size. * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling of .dynbss and zero size sections. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if it is zero size. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss too. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip .plt.* and .got.plt.* if zero size. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip .got* and .dynbss if zero size. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip * elf64-ppc.c (create_linkage_sections): Create branch lookup table in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated reloc section. (create_got_section): Always create new .got and .rela.got sections. (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle dynamic bss sections correctly. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size.
2005-07-08 08:20:06 +02:00
/* If we don't need this section, strip it from the
output file. This is mostly to handle .rela.bss and
.rela.plt. We must create both sections in
create_dynamic_sections, because they must be created
before the linker maps input sections to output
sections. The linker does that before
adjust_dynamic_symbol is called, and it is that
function which decides whether anything needs to go
into these sections. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
sec->flags |= SEC_EXCLUDE;
continue;
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if ((sec->flags & SEC_HAS_CONTENTS) == 0)
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none of the usual sections are found. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. Strip .dynbss if it is zero size. * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and .dynsbss. (i370_elf_finish_dynamic_sections): Don't attempt to write .got when it is zero size. * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling of .dynbss and zero size sections. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if it is zero size. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss too. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip .plt.* and .got.plt.* if zero size. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip .got* and .dynbss if zero size. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip * elf64-ppc.c (create_linkage_sections): Create branch lookup table in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated reloc section. (create_got_section): Always create new .got and .rela.got sections. (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle dynamic bss sections correctly. * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size.
2005-07-08 08:20:06 +02:00
continue;
/* Allocate memory for the section contents if it has not
been allocated already. We use bfd_zalloc here in case
unused entries are not reclaimed before the section's
contents are written out. This should not happen, but this
way if it does, we get a R_PARISC_NONE reloc instead of
garbage. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (sec->contents == NULL)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
sec->contents = (bfd_byte *) bfd_zalloc (dynobj, sec->size);
if (sec->contents == NULL)
return FALSE;
}
}
Delete duplicate target short-cuts to dynamic sections We'd like to have the elf_link_hash_table srelplt field rather than some private target field used to save short-cuts to a PLT relocation section. This save a little space but mainly is so that the generic ELF code can access the field. Ditto for other dynamic sections. * elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (mn10300_elf_final_link_relocate): Likewise. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. (bfin_relocate_section): Likewise. (bfin_gc_sweep_hook): Likewise. (struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (bfinfdpic_got_section, bfinfdpic_gotrel_section, bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf shortcut sections. (_bfin_create_got_section): Use elf htab shortcuts to dyn sections. Delete dead code. (bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections. (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise. (cr16_elf_check_relocs): Likewise. (cr16_elf_final_link_relocate): Likewise. (_bfd_cr16_elf_create_dynamic_sections): Likewise. (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. (_bfd_cr16_elf_size_dynamic_sections): Likewise. (_bfd_cr16_elf_finish_dynamic_symbol): Likewise. (_bfd_cr16_elf_finish_dynamic_sections): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_finish_dynamic_symbol): Likewise. (elf_cris_finish_dynamic_sections): Likewise. (cris_elf_gc_sweep_hook): Likewise. (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_adjust_dynamic_symbol): Likewise. (cris_elf_check_relocs): Likewise. Delete dead code. (elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_cris_discard_excess_program_dynamics): Likewise. * elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt and spltrel. (frvfdpic_got_section, frvfdpic_gotrel_section, frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf shortcut sections. (_frv_create_got_section): Likewise. * elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot, srelgot, splt and srelplt. (hppa_build_one_stub): Use elf htab shortcuts to dynamic sections. (elf32_hppa_create_dynamic_sections): Likewise. (elf32_hppa_check_relocs): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (elf32_hppa_size_dynamic_sections): Likewise. (elf32_hppa_relocate_section): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (elf32_hppa_finish_dynamic_sections): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf shortcut sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections. (lm32_elf_check_relocs): Likewise. (lm32_elf_finish_dynamic_sections): Likewise. (lm32_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (lm32_elf_size_dynamic_sections): Likewise. (lm32_elf_create_dynamic_sections): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. (m32c_elf_check_relocs): Likewise. (m32c_elf_finish_dynamic_sections): Likewise. (m32c_elf_always_size_sections): Likewise. * elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_finish_dynamic_sections): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_partition_multi_got): Likewise. (elf_m68k_check_relocs): Likewise. (elf_m68k_adjust_dynamic_symbol): Likewise. (elf_m68k_size_dynamic_sections): Likewise. (elf_m68k_relocate_section): Likewise. (elf_m68k_finish_dynamic_symbol): Likewise. (elf_m68k_finish_dynamic_sections): Likewise. * elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_metag_relocate_section): Use elf htab shortcuts to dynamic sections. (elf_metag_create_dynamic_sections): Likewise. Allocate got header here in .got. (elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (elf_metag_size_dynamic_sections): Likewise. (elf_metag_finish_dynamic_symbol): Likewise. (elf_metag_finish_dynamic_sections): Likewise. (elf_metag_size_stubs): Likewise. (elf_backend_got_header_size): Don't define. (elf_backend_want_got_plt): Define. * elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelpl. (microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections. (microblaze_elf_create_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. (microblaze_elf_size_dynamic_sections): Likewise. (microblaze_elf_finish_dynamic_symbol): Likewise. (microblaze_elf_finish_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL already zero fields. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (nds32_elf_size_dynamic_sections): Likewise. (nds32_elf_relocate_section): Likewise. (nds32_elf_finish_dynamic_symbol): Likewise. (nds32_elf_finish_dynamic_sections): Likewise. (nds32_elf_check_relocs): Likewise. (calculate_plt_memory_address): Likewise. (calculate_got_memory_address): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. * elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise. (or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections. (create_got_section): Delete. Use _bfd_elf_create_got_section instead. (or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections. (or1k_elf_finish_dynamic_sections): Likewise. (or1k_elf_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (or1k_elf_size_dynamic_sections): Likewise. (or1k_elf_create_dynamic_sections): Likewise. * elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot, plt, relplt, iplt, reliplt and sgotplt. (ppc_elf_create_got): Use elf htab shortcuts to dynamic sections. (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_select_plt_layout): Likewise. (ppc_elf_tls_setup): Likewise. (allocate_got): Likewise. (allocate_dynrelocs): Likewise. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relax_section): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_reloc_type_class): Likewise. (ppc_elf_finish_dynamic_sections): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. (rl78_elf_check_relocs): Likewise. (rl78_elf_finish_dynamic_sections): Likewise. (rl78_elf_always_size_sections): Likewise. * elf32-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf32-score.c (score_elf_create_got_section): Set elf shortcuts. (s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts. * elf32-score7.c (score_elf_create_got_section): As above. (s7_bfd_score_elf_finish_dynamic_sections): As above. * elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (create_got_section): Don't set them. (sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (allocate_dynrelocs): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_add_rofixup): Likewise. (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (sh_elf_finish_dynamic_sections): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_create_got_section): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_adjust_dynamic_symbol): Likewise. (elf_vax_always_size_sections): Likewise. (elf_vax_instantiate_got_entries): Likewise. (elf_vax_relocate_section): Likewise. (elf_vax_finish_dynamic_symbol): Likewise. (elf_vax_finish_dynamic_sections): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. (xstormy16_elf_always_size_sections): Likewise. (xstormy16_elf_relocate_section): Likewise. (xstormy16_elf_finish_dynamic_sections): Likewise. * elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot, sgotplt, srelgot, splt and srelplt. (elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to dynamic sections. (elf_xtensa_allocate_dynrelocs): Likewise. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_size_dynamic_sections): Likewise. (elf_xtensa_relocate_section): Likewise. (elf_xtensa_finish_dynamic_sections): Likewise. (shrink_dynamic_reloc_sections): Likewise. (elf_xtensa_get_plt_section): Likewise. (elf_xtensa_get_gotplt_section): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab shortcuts to dynamic sections. (elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to dynamic sections. (elf64_alpha_size_plt_section): Likewise. (elf64_alpha_size_rela_got_1): Likewise. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_finish_dynamic_symbol): Likewise. (elf64_alpha_finish_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Delete. (elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section. (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to dynamic sections. (sh_elf64_check_relocs): Likewise. (sh64_elf64_adjust_dynamic_symbol): Likewise. (sh64_elf64_size_dynamic_sections): Likewise. (sh64_elf64_finish_dynamic_symbol): Likewise. (sh64_elf64_finish_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. * elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise. * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_finish_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_create_got_section): Likewise. * elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt, sgotplt, splt and sgot. (mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic sections. (mips_elf_gotplt_index): Likewise. (mips_elf_primary_global_got_index): Likewise. (mips_elf_global_got_index): Likewise. (mips_elf_got_offset_from_index): Likewise. (mips_elf_create_local_got_entry): Likewise. (mips_elf_create_got_section): Likewise. (mips_elf_calculate_relocation): Likewise. (_bfd_mips_elf_create_dynamic_sections): Likewise. (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. (mips_elf_lay_out_got): Likewise. (mips_elf_set_plt_sym_value): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (mips_finish_exec_plt): Likewise. (mips_vxworks_finish_exec_plt): Likewise. (mips_vxworks_finish_shared_plt): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. * elfxx-sparc.c (sparc_finish_dyn): Likewise. * elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
2016-11-23 05:36:34 +01:00
if (hppa_info->root.dynamic_sections_created)
{
/* Always create a DT_PLTGOT. It actually has nothing to do with
the PLT, it is how we communicate the __gp value of a load
module to the dynamic linker. */
#define add_dynamic_entry(TAG, VAL) \
bfd/ * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed and chained shared libs only if dynsym. Clear dynsym on forced-local. * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare. (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete. (_bfd_elf_add_dt_needed_tag): Declare. (_bfd_elf_sort_symbol): Declare. (_bfd_elf_finalize_dynstr): Declare. (RELOC_FOR_GLOBAL_SYM): Formatting. * elfcode.h (elf_add_dynamic_entry): Delete. * elflink.c (_bfd_elf_add_dynamic_entry): New function. Corresponding elflink.h function converted to use elf_size_info. (_bfd_elf_add_dt_needed_tag): Likewise. (_bfd_elf_sort_symbol): Likewise. (_bfd_elf_finalize_dynstr): Likewise. (compute_bucket_count): Likewise. (bfd_elf_size_dynamic_sections): Likewise. Check result of _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref. (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from.. * elflink.h: ..here. (sort_symbol, add_dt_needed_tag): Delete. (elf_add_dynamic_entry, elf_finalize_dynstr): Delete. (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete. Update all users. * elf32-arm.h (add_dynamic_entry): Update. Remove casts. * elf32-cris.c (add_dynamic_entry): Likewise. * elf32-hppa.c (add_dynamic_entry): Likewise. * elf32-i370.c (add_dynamic_entry): Likewise. * elf32-i386.c (add_dynamic_entry): Likewise. * elf32-m32r.c (add_dynamic_entry): Likewise. * elf32-m68k.c (add_dynamic_entry): Likewise. * elf32-ppc.c (add_dynamic_entry): Likewise. * elf32-s390.c (add_dynamic_entry): Likewise. * elf32-sh.c (add_dynamic_entry): Likewise. * elf32-sparc.c (add_dynamic_entry): Likewise. * elf32-vax.c (add_dynamic_entry): Likewise. * elf32-xtensa.c (add_dynamic_entry): Likewise. * elf64-alpha.c (add_dynamic_entry): Likewise. * elf64-hppa.c (add_dynamic_entry): Likewise. * elf64-ppc.c (add_dynamic_entry): Likewise. * elf64-s390.c (add_dynamic_entry): Likewise. * elf64-sparc.c (add_dynamic_entry): Likewise. * elf64-x86-64.c (add_dynamic_entry): Likewise. * elfxx-ia64.c (add_dynamic_entry): Likewise. * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update size_dynamic_sections call.
2004-03-25 13:48:45 +01:00
_bfd_elf_add_dynamic_entry (info, TAG, VAL)
ELF: Add _bfd_elf_add_dynamic_tags All ELF backends with shared library support need to add dynamic tags. Add dt_pltgot_required and dt_jmprel_required to elf_link_hash_table to indicate that DT_PLTGOT and DT_JMPREL are required dynamic tags. 1. Add _bfd_elf_add_dynamic_tags to add common dynamic tags. 2. Add _bfd_elf_maybe_vxworks_add_dynamic_tags to add common VxWorks dynamic tags. * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and dt_jmprel_required. (_bfd_elf_add_dynamic_tags): New. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. * elf32-arm.c (elf32_arm_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc, dt_reloc_sz and dt_reloc_ent. * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New. * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set etab.dt_pltgot_required. (elf32_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-metag.c (elf_metag_link_hash_table_create): Set etab.dt_pltgot_required. (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-sh.c (sh_elf_link_hash_table_create): Set root.dt_pltgot_required for FDPIC output. (sh_elf_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set elf.dt_pltgot_required. (elf_xtensa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf64-hppa.c (elf64_hppa_hash_table_create): Set root.dt_pltgot_required. (elf64_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set root.dt_pltgot_required. (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags. * elflink.c (_bfd_elf_add_dynamic_tags): New.
2020-06-23 14:07:31 +02:00
if (!add_dynamic_entry (DT_HP_DLD_FLAGS, 0))
return FALSE;
/* Add some entries to the .dynamic section. We fill in the
values later, in elf64_hppa_finish_dynamic_sections, but we
must add the entries now so that we get the correct size for
the .dynamic section. The DT_DEBUG entry is filled in by the
dynamic linker and used by the debugger. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (! bfd_link_pic (info))
{
ELF: Add _bfd_elf_add_dynamic_tags All ELF backends with shared library support need to add dynamic tags. Add dt_pltgot_required and dt_jmprel_required to elf_link_hash_table to indicate that DT_PLTGOT and DT_JMPREL are required dynamic tags. 1. Add _bfd_elf_add_dynamic_tags to add common dynamic tags. 2. Add _bfd_elf_maybe_vxworks_add_dynamic_tags to add common VxWorks dynamic tags. * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and dt_jmprel_required. (_bfd_elf_add_dynamic_tags): New. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. * elf32-arm.c (elf32_arm_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc, dt_reloc_sz and dt_reloc_ent. * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New. * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set etab.dt_pltgot_required. (elf32_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-metag.c (elf_metag_link_hash_table_create): Set etab.dt_pltgot_required. (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-sh.c (sh_elf_link_hash_table_create): Set root.dt_pltgot_required for FDPIC output. (sh_elf_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set elf.dt_pltgot_required. (elf_xtensa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf64-hppa.c (elf64_hppa_hash_table_create): Set root.dt_pltgot_required. (elf64_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set root.dt_pltgot_required. (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags. * elflink.c (_bfd_elf_add_dynamic_tags): New.
2020-06-23 14:07:31 +02:00
if (!add_dynamic_entry (DT_HP_DLD_HOOK, 0)
|| !add_dynamic_entry (DT_HP_LOAD_MAP, 0))
return FALSE;
}
/* Force DT_FLAGS to always be set.
Required by HPUX 11.00 patch PHSS_26559. */
if (!add_dynamic_entry (DT_FLAGS, (info)->flags))
return FALSE;
}
#undef add_dynamic_entry
ELF: Add _bfd_elf_add_dynamic_tags All ELF backends with shared library support need to add dynamic tags. Add dt_pltgot_required and dt_jmprel_required to elf_link_hash_table to indicate that DT_PLTGOT and DT_JMPREL are required dynamic tags. 1. Add _bfd_elf_add_dynamic_tags to add common dynamic tags. 2. Add _bfd_elf_maybe_vxworks_add_dynamic_tags to add common VxWorks dynamic tags. * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and dt_jmprel_required. (_bfd_elf_add_dynamic_tags): New. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise. * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise. * elf32-arm.c (elf32_arm_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc, dt_reloc_sz and dt_reloc_ent. * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New. * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set etab.dt_pltgot_required. (elf32_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-metag.c (elf_metag_link_hash_table_create): Set etab.dt_pltgot_required. (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf32-sh.c (sh_elf_link_hash_table_create): Set root.dt_pltgot_required for FDPIC output. (sh_elf_size_dynamic_sections): Call _bfd_elf_maybe_vxworks_add_dynamic_tags. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set elf.dt_pltgot_required. (elf_xtensa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elf64-hppa.c (elf64_hppa_hash_table_create): Set root.dt_pltgot_required. (elf64_hppa_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set root.dt_pltgot_required. (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags. * elflink.c (_bfd_elf_add_dynamic_tags): New.
2020-06-23 14:07:31 +02:00
return _bfd_elf_add_dynamic_tags (output_bfd, info, relocs);
}
/* Called after we have output the symbol into the dynamic symbol
table, but before we output the symbol into the normal symbol
table.
For some symbols we had to change their address when outputting
the dynamic symbol table. We undo that change here so that
the symbols have their expected value in the normal symbol
table. Ick. */
* elf-bfd.h (struct elf_backend_data <elf_backend_link_output_symbol_hook>): Return an int. * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop symbols on deleted .opd entries. * elflink.c (elf_link_output_sym): Return without outputting sym if output_symbol_hook returns 2. (elf_link_output_extsym): Don't assign h->indx when symbol discarded. Abort if we must not discard sym. (elf_link_input_bfd): Similarly, don't set finfo->indices for local syms. (bfd_elf_final_link): Adjust elf_link_output_sym calls. * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for elf_backend_link_output_symbol_hook return type change. * elf32-arm.c (output_arch_syminfo): Likewise. (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. (elf32_arm_output_arch_local_syms): Likewise. * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. (bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
2009-05-21 16:15:50 +02:00
static int
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name,
Elf_Internal_Sym *sym,
asection *input_sec ATTRIBUTE_UNUSED,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf_link_hash_entry *eh)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
/* We may be called with the file symbol or section symbols.
They never need munging, so it is safe to ignore them. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (!name || !eh)
* elf-bfd.h (struct elf_backend_data <elf_backend_link_output_symbol_hook>): Return an int. * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop symbols on deleted .opd entries. * elflink.c (elf_link_output_sym): Return without outputting sym if output_symbol_hook returns 2. (elf_link_output_extsym): Don't assign h->indx when symbol discarded. Abort if we must not discard sym. (elf_link_input_bfd): Similarly, don't set finfo->indices for local syms. (bfd_elf_final_link): Adjust elf_link_output_sym calls. * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for elf_backend_link_output_symbol_hook return type change. * elf32-arm.c (output_arch_syminfo): Likewise. (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. (elf32_arm_output_arch_local_syms): Likewise. * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. (bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
2009-05-21 16:15:50 +02:00
return 1;
/* Function symbols for which we created .opd entries *may* have been
munged by finish_dynamic_symbol and have to be un-munged here.
Note that finish_dynamic_symbol sometimes turns dynamic symbols
into non-dynamic ones, so we initialize st_shndx to -1 in
mark_exported_functions and check to see if it was overwritten
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
here instead of just checking eh->dynindx. */
if (hh->want_opd && hh->st_shndx != -1)
{
/* Restore the saved value and section index. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
sym->st_value = hh->st_value;
sym->st_shndx = hh->st_shndx;
}
* elf-bfd.h (struct elf_backend_data <elf_backend_link_output_symbol_hook>): Return an int. * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop symbols on deleted .opd entries. * elflink.c (elf_link_output_sym): Return without outputting sym if output_symbol_hook returns 2. (elf_link_output_extsym): Don't assign h->indx when symbol discarded. Abort if we must not discard sym. (elf_link_input_bfd): Similarly, don't set finfo->indices for local syms. (bfd_elf_final_link): Adjust elf_link_output_sym calls. * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for elf_backend_link_output_symbol_hook return type change. * elf32-arm.c (output_arch_syminfo): Likewise. (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. (elf32_arm_output_arch_local_syms): Likewise. * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. (bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
2009-05-21 16:15:50 +02:00
return 1;
}
/* Finish up dynamic symbol handling. We set the contents of various
dynamic sections here. */
static bfd_boolean
elf64_hppa_finish_dynamic_symbol (bfd *output_bfd,
struct bfd_link_info *info,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf_link_hash_entry *eh,
Elf_Internal_Sym *sym)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
2010-06-27 06:07:55 +02:00
asection *stub, *splt, *sopd, *spltrel;
struct elf64_hppa_link_hash_table *hppa_info;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
stub = hppa_info->stub_sec;
splt = hppa_info->root.splt;
sopd = hppa_info->opd_sec;
spltrel = hppa_info->root.srelplt;
/* Incredible. It is actually necessary to NOT use the symbol's real
value when building the dynamic symbol table for a shared library.
At least for symbols that refer to functions.
We will store a new value and section index into the symbol long
enough to output it into the dynamic symbol table, then we restore
the original values (in elf64_hppa_link_output_symbol_hook). */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_opd)
{
BFD_ASSERT (sopd != NULL);
/* Save away the original value and section index so that we
can restore them later. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hh->st_value = sym->st_value;
hh->st_shndx = sym->st_shndx;
/* For the dynamic symbol table entry, we want the value to be
address of this symbol's entry within the .opd section. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
sym->st_value = (hh->opd_offset
+ sopd->output_offset
+ sopd->output_section->vma);
sym->st_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
sopd->output_section);
}
/* Initialize a .plt entry if requested. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_plt
&& elf64_hppa_dynamic_symbol_p (eh, info))
{
bfd_vma value;
Elf_Internal_Rela rel;
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
bfd_byte *loc;
BFD_ASSERT (splt != NULL && spltrel != NULL);
/* We do not actually care about the value in the PLT entry
if we are creating a shared library and the symbol is
still undefined, we create a dynamic relocation to fill
in the correct value. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) && eh->root.type == bfd_link_hash_undefined)
value = 0;
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value = (eh->root.u.def.value + eh->root.u.def.section->vma);
/* Fill in the entry in the procedure linkage table.
The format of a plt entry is
<funcaddr> <__gp>.
plt_offset is the offset within the PLT section at which to
install the PLT entry.
We are modifying the in-memory PLT contents here, so we do not add
in the output_offset of the PLT section. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd_put_64 (splt->owner, value, splt->contents + hh->plt_offset);
value = _bfd_get_gp_value (info->output_bfd);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd_put_64 (splt->owner, value, splt->contents + hh->plt_offset + 0x8);
/* Create a dynamic IPLT relocation for this entry.
We are creating a relocation in the output file's PLT section,
which is included within the DLT secton. So we do need to include
the PLT's output_offset in the computation of the relocation's
address. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
rel.r_offset = (hh->plt_offset + splt->output_offset
+ splt->output_section->vma);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
rel.r_info = ELF64_R_INFO (hh->eh.dynindx, R_PARISC_IPLT);
rel.r_addend = 0;
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
loc = spltrel->contents;
loc += spltrel->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (info->output_bfd, &rel, loc);
}
/* Initialize an external call stub entry if requested. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_stub
&& elf64_hppa_dynamic_symbol_p (eh, info))
{
bfd_vma value;
int insn;
2001-01-14 06:22:51 +01:00
unsigned int max_offset;
BFD_ASSERT (stub != NULL);
/* Install the generic stub template.
We are modifying the contents of the stub section, so we do not
need to include the stub section's output_offset here. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
memcpy (stub->contents + hh->stub_offset, plt_stub, sizeof (plt_stub));
/* Fix up the first ldd instruction.
We are modifying the contents of the STUB section in memory,
so we do not need to include its output offset in this computation.
Note the plt_offset value is the value of the PLT entry relative to
the start of the PLT section. These instructions will reference
data relative to the value of __gp, which may not necessarily have
the same address as the start of the PLT section.
gp_offset contains the offset of __gp within the PLT section. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value = hh->plt_offset - hppa_info->gp_offset;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
insn = bfd_get_32 (stub->owner, stub->contents + hh->stub_offset);
2001-01-14 06:22:51 +01:00
if (output_bfd->arch_info->mach >= 25)
{
/* Wide mode allows 16 bit offsets. */
max_offset = 32768;
insn &= ~ 0xfff1;
insn |= re_assemble_16 ((int) value);
2001-01-14 06:22:51 +01:00
}
else
{
max_offset = 8192;
insn &= ~ 0x3ff1;
insn |= re_assemble_14 ((int) value);
2001-01-14 06:22:51 +01:00
}
if ((value & 7) || value + max_offset >= 2*max_offset - 8)
{
Remove syntactic sugar Now that _bfd_error_handler is not a function pointer. * aout-adobe.c: Replace (*_bfd_error_handler) (...) with _bfd_error_handler (...) throughout. * aout-cris.c, * aoutx.h, * archive.c, * bfd.c, * binary.c, * cache.c, * coff-alpha.c, * coff-arm.c, * coff-h8300.c, * coff-i860.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * cpu-arm.c, * cpu-m68k.c, * cpu-sh.c, * dwarf2.c, * ecoff.c, * elf-eh-frame.c, * elf-m10300.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cris.c, * elf32-crx.c, * elf32-dlx.c, * elf32-frv.c, * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-x86-64.c, * elfcode.h, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * hpux-core.c, * i386linux.c, * ieee.c, * ihex.c, * libbfd.c, * linker.c, * m68klinux.c, * mach-o.c, * merge.c, * mmo.c, * oasys.c, * osf-core.c, * pdp11.c, * pe-mips.c, * peXXigen.c, * pef.c, * plugin.c, * reloc.c, * rs6000-core.c, * sco5-core.c, * som.c, * sparclinux.c, * srec.c, * stabs.c, * syms.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * xcofflink.c: Likewise.
2016-09-30 05:30:18 +02:00
_bfd_error_handler
Add c-format tags to translatable strings with more than one argument-using formatting token. * aout-adobe.c: Add missing c-format tags for translatable strings. * aout-cris.c: Likewise. * aoutx.h: Likewise. * bfd.c: Likewise. * binary.c: Likewise. * cache.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-i860.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * ecoff.c: Likewise. * elf-attrs.c: Likewise. * elf-eh-frame.c: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-d30v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i960.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-pj.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-xgate.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * m68klinux.c: Likewise. * mach-o.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peXXigen.c: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * ppcboot.c: Likewise. * reloc.c: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * stabs.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * xcofflink.c: Likewise.
2016-10-19 15:04:34 +02:00
/* xgettext:c-format */
(_("stub entry for %s cannot load .plt, dp offset = %" PRId64),
hh->eh.root.root.string, (int64_t) value);
return FALSE;
2001-01-14 06:22:51 +01:00
}
bfd_put_32 (stub->owner, (bfd_vma) insn,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
stub->contents + hh->stub_offset);
/* Fix up the second ldd instruction. */
2001-01-14 06:22:51 +01:00
value += 8;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
insn = bfd_get_32 (stub->owner, stub->contents + hh->stub_offset + 8);
2001-01-14 06:22:51 +01:00
if (output_bfd->arch_info->mach >= 25)
{
insn &= ~ 0xfff1;
insn |= re_assemble_16 ((int) value);
2001-01-14 06:22:51 +01:00
}
else
{
insn &= ~ 0x3ff1;
insn |= re_assemble_14 ((int) value);
2001-01-14 06:22:51 +01:00
}
bfd_put_32 (stub->owner, (bfd_vma) insn,
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
stub->contents + hh->stub_offset + 8);
}
return TRUE;
}
/* The .opd section contains FPTRs for each function this file
exports. Initialize the FPTR entries. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_finalize_opd (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct bfd_link_info *info = (struct bfd_link_info *)data;
struct elf64_hppa_link_hash_table *hppa_info;
asection *sopd;
asection *sopdrel;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
sopd = hppa_info->opd_sec;
sopdrel = hppa_info->opd_rel_sec;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_opd)
{
bfd_vma value;
/* The first two words of an .opd entry are zero.
We are modifying the contents of the OPD section in memory, so we
do not need to include its output offset in this computation. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
memset (sopd->contents + hh->opd_offset, 0, 16);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value = (eh->root.u.def.value
+ eh->root.u.def.section->output_section->vma
+ eh->root.u.def.section->output_offset);
/* The next word is the address of the function. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd_put_64 (sopd->owner, value, sopd->contents + hh->opd_offset + 16);
/* The last word is our local __gp value. */
value = _bfd_get_gp_value (info->output_bfd);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd_put_64 (sopd->owner, value, sopd->contents + hh->opd_offset + 24);
}
/* If we are generating a shared library, we must generate EPLT relocations
for each entry in the .opd, even for static functions (they may have
had their address taken). */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info) && hh->want_opd)
{
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
Elf_Internal_Rela rel;
bfd_byte *loc;
int dynindx;
/* We may need to do a relocation against a local symbol, in
which case we have to look up it's dynamic symbol index off
the local symbol hash table. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh->dynindx != -1)
dynindx = eh->dynindx;
else
dynindx
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
= _bfd_elf_link_lookup_local_dynindx (info, hh->owner,
hh->sym_indx);
/* The offset of this relocation is the absolute address of the
.opd entry for this symbol. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
rel.r_offset = (hh->opd_offset + sopd->output_offset
+ sopd->output_section->vma);
/* If H is non-null, then we have an external symbol.
It is imperative that we use a different dynamic symbol for the
EPLT relocation if the symbol has global scope.
In the dynamic symbol table, the function symbol will have a value
which is address of the function's .opd entry.
Thus, we can not use that dynamic symbol for the EPLT relocation
(if we did, the data in the .opd would reference itself rather
than the actual address of the function). Instead we have to use
a new dynamic symbol which has the same value as the original global
function symbol.
We prefix the original symbol with a "." and use the new symbol in
the EPLT relocation. This new symbol has already been recorded in
the symbol table, we just have to look it up and use it.
We do not have such problems with static functions because we do
not make their addresses in the dynamic symbol table point to
the .opd entry. Ultimately this should be safe since a static
function can not be directly referenced outside of its shared
library.
We do have to play similar games for FPTR relocations in shared
libraries, including those for static symbols. See the FPTR
handling in elf64_hppa_finalize_dynreloc. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh)
{
char *new_name;
struct elf_link_hash_entry *nh;
new_name = concat (".", eh->root.root.string, NULL);
nh = elf_link_hash_lookup (elf_hash_table (info),
new_name, TRUE, TRUE, FALSE);
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
/* All we really want from the new symbol is its dynamic
symbol index. */
Multi-GOT support for m68k. bfd/ * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key, glist): New fields. (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry, struct elf_m68k_got, struct elf_m68k_bfd2got_entry, struct elf_m68k_multi_got): New data structures. (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p, allow_multigot_p, multi_got_): New fields. (elf_m68k_multi_got): New macro. (elf_m68k_link_hash_newfunc): Initialize new fields of struct elf_m68k_link_hash_entry. (elf_m68k_link_hash_table_create): Initialize new fields of struct elf_m68k_link_hash_table. (elf_m68k_link_hash_table_free): New static function implementing hook. (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New static functions for struct elf_m68k_got. (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash, elf_m68k_got_entry_eq): New static functions for struct elf_m68k_got_entry. (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT, ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros. (enum elf_m68k_get_entry_howto): New enum. (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type, elf_m68k_remove_got_entry_type): New static functions for struct elf_m68k_got_entry. (elf_m68k_add_entry_to_got): New static function. (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq, elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static functions for struct elf_m68k_bfd2got_entry. (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1, elf_m68k_can_merge_gots): New traversal. (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1, elf_m68k_merge_gots): Ditto. (struct elf_m68k_finalize_got_offsets_arg, elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto. (struct elf_m68k_partition_multi_got_arg, elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1, elf_m68k_partition_multi_got): Ditto. (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static functions. (elf_m68k_copy_indirect_symbol): New static function implementing a hook. (elf_m68k_check_relocs): Update to add entries to multi-GOT. (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT. (elf_m68k_always_size_sections): Assign BFDs to GOTs. (elf_m68k_relocate_section): Update to properly handle GOT relocations. (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries of a global symbol. (bfd_elf_m68k_set_target_options): New function. (bfd_elf32_bfd_link_hash_table_free): Define hook. (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link to skip generic calculation of GOT offsets. (elf_backend_copy_indirect_symbol): Define hook. * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function. * bfd-in2.h: Regenerate. ld/ * configure.in (--enable-got): New option. Handle it. * configure: Regenerate. * config.in: Regenerate. * emultempl/m68kelf.em: (got_handling_target_default): New shell variable. (GOT_HANDLING_TARGET_DEFAULT): New macro. (GOT_HANDLING_DEFAULT): New macro. Initialize it from configure option if one was given. (got_handling): New static variable. (elf_m68k_create_output_section_statements): New static function implementing hook. (PARSE_AND_LIST_PROLOGUE): Define shell variable. (OPTION_GOT): New macro. (PARSE_AND_LIST_LONGOPTS): Define shell variable. Specify --got option. (got): New linker option. (PARSE_AND_LIST_OPTIONS): Define shell variable. Print help string for --got option. (PARSE_AND_LIST_ARGS_CASES): Define shell variable. Handle --got option. * ld.texinfo: Document --got=<type> option. * gen-doc.texi: Add M68K. * NEWS: Mention the new feature. ld/testsuite/ * ld-m68k/got-12.s: New file. * ld-m68k/got-13.s: New file. * ld-m68k/got-14.s: New file. * ld-m68k/got-15.s: New file. * ld-m68k/got-34.s: New file. * ld-m68k/got-35.s: New file. * ld-m68k/got-single-12-ok.d: New dump test. * ld-m68k/got-single-13-er.d: New dump test. * ld-m68k/got-negative-14-ok.d: New dump test. * ld-m68k/got-negative-15-er.d: New dump test. * ld-m68k/got-negative-12-13-14-34-ok.d: New dump test. * ld-m68k/got-negative-12-13-14-35-er.d: New dump test. * ld-m68k/got-multigot-14-ok.d: New dump test. * ld-m68k/got-multigot-15-er.d: New dump test. * ld-m68k/got-multigot-12-13-14-34-35-ok.d: New dump test. * ld-m68k/xgot-15.s: New source. * ld-m68k/got-xgot-15-ok.d: New test. * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: New test. * ld-m68k/m68k.exp: Run new tests.
2008-05-21 14:01:37 +02:00
if (nh)
dynindx = nh->dynindx;
free (new_name);
}
rel.r_addend = 0;
rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_EPLT);
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
loc = sopdrel->contents;
loc += sopdrel->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (info->output_bfd, &rel, loc);
}
return TRUE;
}
/* The .dlt section contains addresses for items referenced through the
dlt. Note that we can have a DLTIND relocation for a local symbol, thus
we can not depend on finish_dynamic_symbol to initialize the .dlt. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_finalize_dlt (struct elf_link_hash_entry *eh, void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct bfd_link_info *info = (struct bfd_link_info *)data;
struct elf64_hppa_link_hash_table *hppa_info;
asection *sdlt, *sdltrel;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
sdlt = hppa_info->dlt_sec;
sdltrel = hppa_info->dlt_rel_sec;
/* H/DYN_H may refer to a local variable and we know it's
address, so there is no need to create a relocation. Just install
the proper value into the DLT, note this shortcut can not be
skipped when building a shared library. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (! bfd_link_pic (info) && hh && hh->want_dlt)
{
bfd_vma value;
/* If we had an LTOFF_FPTR style relocation we want the DLT entry
to point to the FPTR entry in the .opd section.
We include the OPD's output offset in this computation as
we are referring to an absolute address in the resulting
object file. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_opd)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value = (hh->opd_offset
+ hppa_info->opd_sec->output_offset
+ hppa_info->opd_sec->output_section->vma);
}
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
else if ((eh->root.type == bfd_link_hash_defined
|| eh->root.type == bfd_link_hash_defweak)
&& eh->root.u.def.section)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value = eh->root.u.def.value + eh->root.u.def.section->output_offset;
if (eh->root.u.def.section->output_section)
value += eh->root.u.def.section->output_section->vma;
else
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value += eh->root.u.def.section->vma;
}
else
/* We have an undefined function reference. */
value = 0;
/* We do not need to include the output offset of the DLT section
here because we are modifying the in-memory contents. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
bfd_put_64 (sdlt->owner, value, sdlt->contents + hh->dlt_offset);
}
/* Create a relocation for the DLT entry associated with this symbol.
When building a shared library the symbol does not have to be dynamic. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->want_dlt
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
&& (elf64_hppa_dynamic_symbol_p (eh, info) || bfd_link_pic (info)))
{
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
Elf_Internal_Rela rel;
bfd_byte *loc;
int dynindx;
/* We may need to do a relocation against a local symbol, in
which case we have to look up it's dynamic symbol index off
the local symbol hash table. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh && eh->dynindx != -1)
dynindx = eh->dynindx;
else
dynindx
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
= _bfd_elf_link_lookup_local_dynindx (info, hh->owner,
hh->sym_indx);
/* Create a dynamic relocation for this entry. Do include the output
offset of the DLT entry since we need an absolute address in the
resulting object file. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
rel.r_offset = (hh->dlt_offset + sdlt->output_offset
+ sdlt->output_section->vma);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh && eh->type == STT_FUNC)
rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_FPTR64);
else
rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_DIR64);
rel.r_addend = 0;
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
loc = sdltrel->contents;
loc += sdltrel->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (info->output_bfd, &rel, loc);
}
return TRUE;
}
/* Finalize the dynamic relocations. Specifically the FPTR relocations
for dynamic functions used to initialize static data. */
static bfd_boolean
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf64_hppa_finalize_dynreloc (struct elf_link_hash_entry *eh,
void *data)
{
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
struct bfd_link_info *info = (struct bfd_link_info *)data;
struct elf64_hppa_link_hash_table *hppa_info;
int dynamic_symbol;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
dynamic_symbol = elf64_hppa_dynamic_symbol_p (eh, info);
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (!dynamic_symbol && !bfd_link_pic (info))
return TRUE;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (hh->reloc_entries)
{
struct elf64_hppa_dyn_reloc_entry *rent;
int dynindx;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
/* We may need to do a relocation against a local symbol, in
which case we have to look up it's dynamic symbol index off
the local symbol hash table. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
if (eh->dynindx != -1)
dynindx = eh->dynindx;
else
dynindx
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
= _bfd_elf_link_lookup_local_dynindx (info, hh->owner,
hh->sym_indx);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
for (rent = hh->reloc_entries; rent; rent = rent->next)
{
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
Elf_Internal_Rela rel;
bfd_byte *loc;
/* Allocate one iff we are building a shared library, the relocation
isn't a R_PARISC_FPTR64, or we don't want an opd entry. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (!bfd_link_pic (info)
&& rent->type == R_PARISC_FPTR64 && hh->want_opd)
continue;
/* Create a dynamic relocation for this entry.
We need the output offset for the reloc's section because
we are creating an absolute address in the resulting object
file. */
rel.r_offset = (rent->offset + rent->sec->output_offset
+ rent->sec->output_section->vma);
/* An FPTR64 relocation implies that we took the address of
a function and that the function has an entry in the .opd
section. We want the FPTR64 relocation to reference the
entry in .opd.
We could munge the symbol value in the dynamic symbol table
(in fact we already do for functions with global scope) to point
to the .opd entry. Then we could use that dynamic symbol in
this relocation.
Or we could do something sensible, not munge the symbol's
address and instead just use a different symbol to reference
the .opd entry. At least that seems sensible until you
realize there's no local dynamic symbols we can use for that
purpose. Thus the hair in the check_relocs routine.
We use a section symbol recorded by check_relocs as the
base symbol for the relocation. The addend is the difference
between the section symbol and the address of the .opd entry. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_pic (info)
&& rent->type == R_PARISC_FPTR64 && hh->want_opd)
{
bfd_vma value, value2;
/* First compute the address of the opd entry for this symbol. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
value = (hh->opd_offset
+ hppa_info->opd_sec->output_section->vma
+ hppa_info->opd_sec->output_offset);
/* Compute the value of the start of the section with
the relocation. */
value2 = (rent->sec->output_section->vma
+ rent->sec->output_offset);
/* Compute the difference between the start of the section
with the relocation and the opd entry. */
value -= value2;
/* The result becomes the addend of the relocation. */
rel.r_addend = value;
/* The section symbol becomes the symbol for the dynamic
relocation. */
dynindx
= _bfd_elf_link_lookup_local_dynindx (info,
rent->sec->owner,
rent->sec_symndx);
}
else
rel.r_addend = rent->addend;
rel.r_info = ELF64_R_INFO (dynindx, rent->type);
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
loc = hppa_info->other_rel_sec->contents;
loc += (hppa_info->other_rel_sec->reloc_count++
* sizeof (Elf64_External_Rela));
bfd_elf64_swap_reloca_out (info->output_bfd, &rel, loc);
}
}
return TRUE;
}
/* Used to decide how to sort relocs in an optimal manner for the
dynamic linker, before writing them out. */
static enum elf_reloc_type_class
elf64_hppa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
const asection *rel_sec ATTRIBUTE_UNUSED,
const Elf_Internal_Rela *rela)
{
if (ELF64_R_SYM (rela->r_info) == STN_UNDEF)
return reloc_class_relative;
switch ((int) ELF64_R_TYPE (rela->r_info))
{
case R_PARISC_IPLT:
return reloc_class_plt;
case R_PARISC_COPY:
return reloc_class_copy;
default:
return reloc_class_normal;
}
}
/* Finish up the dynamic sections. */
static bfd_boolean
elf64_hppa_finish_dynamic_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
bfd *dynobj;
asection *sdyn;
struct elf64_hppa_link_hash_table *hppa_info;
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
/* Finalize the contents of the .opd section. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf_link_hash_traverse (elf_hash_table (info),
elf64_hppa_finalize_opd,
info);
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf_link_hash_traverse (elf_hash_table (info),
elf64_hppa_finalize_dynreloc,
info);
/* Finalize the contents of the .dlt section. */
dynobj = elf_hash_table (info)->dynobj;
/* Finalize the contents of the .dlt section. */
* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. (elf_hppa_relocate_section): Likewise. * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive from struct elf_link_hash_entry. Add count field. (struct elf64_hppa_dyn_hash_table): Delete. (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. (elf64_hppa_hash_table): Rename to hppa_link_hash_table. (hppa_elf_hash_entry, eh_name): Define. (elf64_hppa_new_dyn_hash_entry): Delete. (elf64_hppa_dyn_hash_lookup): Delete. (elf64_hppa_dyn_hash_traverse): Delete. (get_dyn_name): Delete. (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead of struct elf64_hppa_dyn_hash_entry *. (elf64_hppa_finalize_dlt, llocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): Likewise. (hppa64_link_hash_newfunc): New. (elf64_hppa_hash_table_create): Rework. (count_dyn_reloc): Likewise. (hppa64_elf_local_refcounts): New. (elf64_hppa_check_relocs): Rework using standard technique for recording local DLT, PLT and OPD reference counts. (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct elf_link_hash_entry *. (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, allocate_global_data_plt, allocate_global_data_stub, allocate_global_data_opd, allocate_dynrel_entries, elf64_hppa_adjust_dynamic_symbol, elf64_hppa_mark_milli_and_exported_functions): Likewise. (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): Use hppa_link_hash_table. Rework. (elf64_hppa_link_output_symbol_hook): Rework. (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 03:10:49 +01:00
elf_link_hash_traverse (elf_hash_table (info),
elf64_hppa_finalize_dlt,
info);
2012-06-29 16:46:03 +02:00
sdyn = bfd_get_linker_section (dynobj, ".dynamic");
if (elf_hash_table (info)->dynamic_sections_created)
{
Elf64_External_Dyn *dyncon, *dynconend;
BFD_ASSERT (sdyn != NULL);
dyncon = (Elf64_External_Dyn *) sdyn->contents;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
{
Elf_Internal_Dyn dyn;
asection *s;
bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn);
switch (dyn.d_tag)
{
default:
break;
case DT_HP_LOAD_MAP:
/* Compute the absolute address of 16byte scratchpad area
for the dynamic linker.
By convention the linker script will allocate the scratchpad
area at the start of the .data section. So all we have to
to is find the start of the .data section. */
s = bfd_get_section_by_name (output_bfd, ".data");
if (!s)
return FALSE;
dyn.d_un.d_ptr = s->vma;
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_PLTGOT:
/* HP's use PLTGOT to set the GOT register. */
dyn.d_un.d_ptr = _bfd_get_gp_value (output_bfd);
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_JMPREL:
s = hppa_info->root.srelplt;
dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_PLTRELSZ:
s = hppa_info->root.srelplt;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
dyn.d_un.d_val = s->size;
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_RELA:
s = hppa_info->other_rel_sec;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
if (! s || ! s->size)
s = hppa_info->dlt_rel_sec;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
if (! s || ! s->size)
s = hppa_info->opd_rel_sec;
dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_RELASZ:
s = hppa_info->other_rel_sec;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
dyn.d_un.d_val = s->size;
s = hppa_info->dlt_rel_sec;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
dyn.d_un.d_val += s->size;
s = hppa_info->opd_rel_sec;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
dyn.d_un.d_val += s->size;
/* There is some question about whether or not the size of
the PLT relocs should be included here. HP's tools do
it, so we'll emulate them. */
s = hppa_info->root.srelplt;
bfd/ * section.c (struct sec): Rename "_cooked_size" to "size". Rename "_raw_size" to "rawsize". (STD_SECTION): Adjust comments. (bfd_set_section_size, bfd_get_section_contents): Use size. (bfd_malloc_and_get_section): New function. * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. Correctly free reloc and contents memory. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME and fake CIE now that we can shink section size to zero. (_bfd_elf_write_section_eh_frame): Likewise.. * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use _bfd_stab_section_offset. Use _bfd_elf_section_offset. * stabs.c (_bfd_stab_section_offset_): Remove unused args and unneeded indirection. * elf.c (_bfd_elf_section_offset): .. and update call. * libbfd-in.h (_bfd_stab_section_offset): Update prototype. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. Replace occurrences of "_raw_size" and "_cooked_size" in most places with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE sections. Use "rawsize", if non-zero, for bfd_get_section_contents calls if the section might be a stabs, eh_frame, or SEC_MERGE section. Similarly use "rawsize", if non-zero, in reloc functions to validate reloc addresses. Use new bfd_malloc_and_get_section in most places where bfd_get_section_contents was called. Expand all occurrences of bfd_section_size and bfd_get_section_size. Rename "raw_size" var in grok_prstatus and similar functions to "size". * aix386-core.c (aix386_core_file_p): .. * aix5ppc-core.c (xcoff64_core_p): .. * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, aout_adobe_set_section_contents): .. * aout-target.h (callback): .. * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, MY_bfd_final_link): .. * aoutf1.h (sunos4_core_file_p): .. * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, final_link, aout_link_input_section): .. * binary.c (binary_object_p, binary_canonicalize_symtab, binary_set_section_contents): .. * bout.c (b_out_callback, b_out_write_object_contents, b_out_set_section_contents, b_out_bfd_relax_section, b_out_bfd_get_relocated_section_contents): .. * cisco-core.c (cisco_core_file_validate): .. * coff-alpha.c (alpha_ecoff_object_p, alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. * coff-arm.c (coff_arm_relocate_section, bfd_arm_allocate_interworking_sections): .. * coff-h8300.c (h8300_reloc16_extra_cases, h8300_bfd_link_add_symbols): .. * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, ppc_bfd_coff_final_link): .. * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, sh_align_loads, sh_coff_get_relocated_section_contents): .. * coff64-rs6000.c (xcoff64_write_object_contents, xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. * coffcode.h (coff_compute_section_file_positions, coff_write_object_contents): .. * coffgen.c (make_a_section_from_file, coff_write_symbols, coff_section_symbol, build_debug_section): .. * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, process_embedded_commands, _bfd_coff_link_input_bfd, _bfd_coff_write_global_sym): .. * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): .. * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, ecoff_compute_section_file_positions, _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, _bfd_elf_discard_section_eh_frame_hdr, _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, _bfd_elf_write_section_eh_frame, _bfd_elf_write_section_eh_frame_hdr): .. * elf-hppa.h (elf_hppa_sort_unwind): .. * elf-m10200.c (mn10200_elf_relax_section, mn10200_elf_relax_delete_bytes, mn10200_elf_get_relocated_section_contents): .. * elf-m10300.c (_bfd_mn10300_elf_create_got_section, mn10300_elf_check_relocs, mn10300_elf_relax_section, mn10300_elf_relax_delete_bytes, mn10300_elf_get_relocated_section_contents, _bfd_mn10300_elf_adjust_dynamic_symbol, _bfd_mn10300_elf_discard_copies, _bfd_mn10300_elf_size_dynamic_sections, _bfd_mn10300_elf_finish_dynamic_sections): .. * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, _bfd_elf_make_section_from_phdr, elf_fake_sections, bfd_elf_set_group_contents, map_sections_to_segments, elf_sort_sections, assign_file_positions_for_segments, SECTION_SIZE, copy_private_bfd_data, _bfd_elf_get_dynamic_reloc_upper_bound, _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, bfd_elf32_arm_process_before_allocation, elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, elf32_arm_write_section): .. * elf32-cris.c (cris_elf_grok_prstatus, elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, cris_elf_check_relocs, elf_cris_size_dynamic_sections, elf_cris_discard_excess_dso_dynamics, elf_cris_discard_excess_program_dynamics): .. * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, _frv_create_got_section, _frvfdpic_assign_plt_entries, elf32_frvfdpic_size_dynamic_sections, elf32_frvfdpic_modify_segment_map, elf32_frvfdpic_finish_dynamic_sections): .. * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, elf32_h8_get_relocated_section_contents): .. * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, elf32_hppa_finish_dynamic_sections): .. * elf32-i370.c (i370_elf_adjust_dynamic_symbol, i370_elf_size_dynamic_sections, i370_elf_check_relocs, i370_elf_finish_dynamic_sections): .. * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. * elf32-ip2k.c (ip2k_is_switch_table_128, ip2k_relax_switch_table_128, ip2k_is_switch_table_256, ip2k_relax_switch_table_256, ip2k_elf_relax_section, adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, allocate_dynrelocs, m32r_elf_size_dynamic_sections, m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, m32r_elf_relax_section, m32r_elf_relax_delete_bytes, m32r_elf_get_relocated_section_contents): .. * elf32-m68hc11.c (m68hc11_elf_build_one_stub, m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, m68hc11_elf_relax_delete_bytes): .. * elf32-m68hc12.c (m68hc12_elf_build_one_stub, m68hc12_elf_size_one_stub): .. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elf32-or32.c (or32_elf_consth_reloc): .. * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, elf_create_pointer_linker_section, ppc_elf_create_linker_section, ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, ppc_elf_final_write_processing): .. * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, sh_elf_relax_delete_bytes, sh_elf_align_loads, sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. * elf32-sh64-com.c (sh64_address_in_cranges, sh64_get_contents_type): .. * elf32-sh64.c (sh64_find_section_for_address, sh64_elf_final_write_processing): .. * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, allocate_dynrelocs, elf32_sparc_size_dynamic_sections, elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, elf_vax_size_dynamic_sections, elf_vax_discard_copies, elf_vax_instantiate_got_entries, elf_vax_relocate_section, elf_vax_finish_dynamic_sections): .. * elf32-xstormy16.c (xstormy16_elf_24_reloc, xstormy16_elf_check_relocs, xstormy16_relax_plt_check, xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, xstormy16_elf_finish_dynamic_sections): .. * elf32-xtensa.c (xtensa_read_table_entries, elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, get_relocation_opcode, retrieve_contents, find_relaxable_sections, collect_source_relocs, is_resolvable_asm_expansion, remove_literals, relax_section, shrink_dynamic_reloc_sections, relax_property_section, xtensa_callback_required_dependence): .. * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. * elf64-hppa.c (allocate_dynrel_entries, elf64_hppa_size_dynamic_sections, elf64_hppa_finish_dynamic_sections): .. * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, elf64_mips_grok_prstatus): .. * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, mmix_elf_relocate_section, mmix_elf_final_link, mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, mmix_elf_relax_section, mmix_elf_get_section_contents): .. * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, allocate_dynrelocs, ppc64_elf_size_dynamic_sections, ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, ppc64_elf_build_stubs, ppc64_elf_relocate_section, ppc64_elf_finish_dynamic_sections): .. * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, allocate_dynrelocs, elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_sections): .. * elf64-sh64.c (sh_elf64_get_relocated_section_contents, sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_sections): .. * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): .. * elf64-x86-64.c (elf64_x86_64_grok_prstatus, elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, elf64_x86_64_finish_dynamic_sections): .. * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. * elfcode.h (elf_slurp_reloc_table): .. * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, elf_finalize_dynstr, elf_link_add_object_symbols, bfd_elf_size_dynamic_sections, elf_link_sort_relocs, elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, elf32_mips_grok_prstatus): .. * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, elfNN_ia64_choose_gp, elfNN_ia64_final_link, elfNN_ia64_finish_dynamic_sections): .. * elfxx-mips.c (mips_elf_create_procedure_table, mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, mips_elf_global_got_index, mips_elf_multi_got, mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, mips_elf_allocate_dynamic_relocations, mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, _bfd_mips_elf_always_size_sections, _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_finish_dynamic_symbol, _bfd_mips_elf_finish_dynamic_sections, _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, _bfd_elf_mips_get_relocated_section_contents, _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. * hp300hpux.c (callback): .. * hppabsd-core.c (make_bfd_asection): .. * hpux-core.c (make_bfd_asection): .. * i386linux.c (linux_link_create_dynamic_sections, bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. * i386msdos.c (msdos_write_object_contents): .. * i386os9k.c (os9k_callback, os9k_write_object_contents, os9k_set_section_contents): .. * ieee.c (parse_expression, ieee_slurp_external_symbols, ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, ieee_write_section_part, do_with_relocs, do_as_repeat, do_without_relocs, ieee_write_debug_part, init_for_output, ieee_set_section_contents): .. * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. * irix-core.c (do_sections, make_bfd_asection): .. * libaout.h (aout_section_merge_with_text_p): .. * libbfd.c (_bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window): .. * linker.c (default_indirect_link_order): .. * lynx-core.c (make_bfd_asection): .. * m68klinux.c (linux_link_create_dynamic_sections, bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. * mach-o.c (bfd_mach_o_make_bfd_section, bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, bfd_mach_o_scan_read_segment): .. * merge.c (_bfd_add_merge_section, record_section, merge_strings, _bfd_merge_sections): .. * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, mmo_map_set_sizes, mmo_canonicalize_symtab, mmo_internal_write_section, mmo_write_object_contents): .. * netbsd-core.c (netbsd_core_file_p): .. * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, nlm_alpha_set_public_section): .. * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. * nlm32-sparc.c (nlm_sparc_write_import): .. * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, nlm_compute_section_file_positions): .. * oasys.c (oasys_object_p, oasys_slurp_section_data, oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. * opncls.c (get_debug_link_info): .. * osf-core.c (make_bfd_asection): .. * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, final_link, aout_link_input_section): .. * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. * ptrace-core.c (ptrace_unix_core_file_p): .. * reloc.c (bfd_perform_relocation, bfd_install_relocation, _bfd_final_link_relocate, bfd_generic_relax_section, bfd_generic_get_relocated_section_contents): .. * reloc16.c (bfd_coff_reloc16_relax_section, bfd_coff_reloc16_get_relocated_section_c): .. * riscix.c (riscix_some_aout_object_p): .. * rs6000-core.c (read_hdr, make_bfd_asection): .. * sco5-core.c (make_bfd_asection): .. * simple.c (bfd_simple_get_relocated_section_contents): .. * som.c (som_object_setup, setup_sections, som_prep_headers, som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, som_set_reloc_info, som_get_section_contents, som_bfd_link_split_section): .. * sparclinux.c (linux_link_create_dynamic_sections, bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, _bfd_write_stab_strings, _bfd_stab_section_offset): .. * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, sunos_finish_dynamic_link): .. * syms.c (_bfd_stab_section_find_nearest_line): .. * tekhex.c (first_phase, tekhex_set_section_contents, tekhex_write_object_contents): .. * trad-core.c (trad_unix_core_file_p): .. * versados.c (process_esd, process_otr, process_otr): .. * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. * vms-misc.c (add_new_contents): .. * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. * vms.c (vms_set_section_contents): .. * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. * xsym.c (bfd_sym_scan): .. See above. binutils/ * objcopy.c (copy_section): Don't set _cooked_size. include/ * bfdlink.h (struct bfd_link_order): Update comment. ld/ * ldlang.c (print_output_section_statement): Don't print size before relaxation. (IGNORE_SECTION): Remove bfd arg. Update all callers. * ldexp.c (fold_name): .. See below. * ldlang.c (section_already_linked, print_output_section_statement, print_input_section, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections_1, lang_size_sections, lang_do_assignments_1, lang_set_startof, lang_one_common, lang_reset_memory_regions, lang_process, lang_abs_symbol_at_end_of, lang_do_version_exports_section): .. * ldwrite.c (build_link_order, clone_section, ds, split_sections): .. * pe-dll.c (process_def_file, generate_reloc): .. * emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment, gld${EMULATION_NAME}_before_allocation): .. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): .. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation, sh64_elf_${EMULATION_NAME}_after_allocation): .. * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): .. * emultempl/xtensaelf.em (ld_assign_relative_paged_dot, ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use "size" instead of "_raw_size" and "_cooked_size". Expand bfd_section_size macro invocations.
2004-06-24 06:46:28 +02:00
dyn.d_un.d_val += s->size;
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
}
}
}
return TRUE;
}
/* Support for core dump NOTE sections. */
static bfd_boolean
elf64_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
{
int offset;
size_t size;
switch (note->descsz)
{
default:
return FALSE;
case 760: /* Linux/hppa */
/* pr_cursig */
elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
offset = 112;
size = 640;
break;
}
/* Make a ".reg/999" section. */
return _bfd_elfcore_make_pseudosection (abfd, ".reg",
size, note->descpos + offset);
}
static bfd_boolean
elf64_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
{
char * command;
int n;
switch (note->descsz)
{
default:
return FALSE;
case 136: /* Linux/hppa elf_prpsinfo. */
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
}
/* Note that for some reason, a spurious space is tacked
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
command = elf_tdata (abfd)->core->command;
n = strlen (command);
if (0 < n && command[n - 1] == ' ')
command[n - 1] = '\0';
return TRUE;
}
/* Return the number of additional phdrs we will need.
The generic ELF code only creates PT_PHDRs for executables. The HP
dynamic linker requires PT_PHDRs for dynamic libraries too.
This routine indicates that the backend needs one additional program
header for that case.
Note we do not have access to the link info structure here, so we have
to guess whether or not we are building a shared library based on the
existence of a .interp section. */
static int
bfd/ * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer parameter. (_bfd_elf_sizeof_headers): Replace bfd_boolean param with bfd_link_info pointer. * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise. * bfd.c (bfd_sizeof_headers): Tweak param name. * aout-adobe.c (aout_adobe_sizeof_headers): Adjust. * aoutx.h (NAME (aout, sizeof_headers)): Adjust. * binary.c (binary_sizeof_headers): Adjust. * bout.c (b_out_sizeof_headers): Adjust. * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust. * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust. * coffgen.c (coff_sizeof_headers): Adjust. * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust. (ecoff_compute_section_file_positions): Adjust. (_bfd_ecoff_write_object_contents): Adjust. * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust. * elf32-arm.c (elf32_arm_additional_program_headers): Adjust. * elf32-i370.c (elf_backend_additional_program_headers): Adjust. * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust. * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust. * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust. * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust. * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust. * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust. * i386msdos.c: Convert to ISO C. (msdos_sizeof_headers): Adjust. * i386os9k.c: Convert to ISO C. (os9k_sizeof_headers): Adjust. * ieee.c (ieee_sizeof_headers): Adjust. * ihex.c (ihex_sizeof_headers): Adjust. * libaout.h (NAME (aout, sizeof_headers)): Adjust. * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust. * libcoff-in.h (coff_sizeof_headers): Adjust. * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust. * mach-o.c (bfd_mach_o_sizeof_headers): Adjust. * mmo.c (mmo_sizeof_headers): Adjust. * oasys.c (oasys_sizeof_headers): Adjust. * pdp11.c (NAME (aout, sizeof_headers)): Adjust. * pef.c (bfd_pef_sizeof_headers): Adjust. * ppcboot.c (ppcboot_sizeof_headers): Adjust. * som.c (som_sizeof_headers): Adjust. * srec.c (srec_sizeof_headers): Adjust. * tekhex.c (tekhex_sizeof_headers): Adjust. * versados.c (versados_sizeof_headers): Adjust. * vms.c (vms_sizeof_headers): Adjust. * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust. * xsym.c (bfd_sym_sizeof_headers): Adjust. * xsym.h (bfd_sym_sizeof_headers): Adjust. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * ldexp.c (fold_name): Adjust bfd_sizeof_headers call.
2006-06-19 15:17:44 +02:00
elf64_hppa_additional_program_headers (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
asection *s;
/* If we are creating a shared library, then we have to create a
PT_PHDR segment. HP's dynamic linker chokes without it. */
s = bfd_get_section_by_name (abfd, ".interp");
if (! s)
return 1;
return 0;
}
Fix the linker so that it will not silently generate ELF binaries with invalid program headers. Fix readelf to report such invalid binaries. PR ld/20815 bfd * elf.c (elf_modify_segment_map): Allow empty LOAD segments if they contain the program headers. (_bfd_elf_map_sections_to_segments): If the linker created the PHDR segment then always attempt to include it in a LOAD segment. (assign_file_positions_for_non_load_sections): Allow LOAD segments to overlap PHDR segments. (phdr_sorter): New function. Sorts program headers. (assign_file_positions_except_relocs): Sort the program headers before writing them out. Issue an error if the PHDR segment is not covered by a LOAD segment, unless the backend allows it. * elf-bfd.h (struct elf_backend_data): Add elf_backend_allow_non_load_phdr. * elfxx-target.h (elf_backend_allow_non_load_phdr): Provide default definition that returns FALSE. (elfNN_bed): Initialise the elf_backend_allow_non_load_phdr field. * elf64-hppa.c (elf64_hppa_allow_non_load_phdr): New function. Returns TRUE. (elf_backend_allow_non_load_phdr): Define. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Do not place the interpreter string into the .interp section if the nointerp flag is set in the link info structure. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-score7.c (score_elf_final_link_relocate): Allow for the _gp symbol not being part of the output. binutils* readelf.c (process_program_headers): Check PT_LOAD and PT_PHDR segments for validity. ld * ld.texinfo: Note that PT_TLS can be used as a segment type. * testsuite/ld-discard/discard.ld: Add space for program headers. * testsuite/ld-elf/flags1.ld: Likewise. * testsuite/ld-elf/maxpage3.t: Likewise. * testsuite/ld-elf/noload-1.t: Likewise. * testsuite/ld-elf/orphan.ld: Likewise. * testsuite/ld-elf/overlay.t: Likewise. * testsuite/ld-elf/pr14052.t: Likewise. * testsuite/ld-elf/pr19539.t: Likewise. * testsuite/ld-elf/provide-hidden-1.ld: Likewise. * testsuite/ld-elf/provide-hidden-s.ld: Likewise. * testsuite/ld-elf/weak-dyn-1.ld: Likewise. * testsuite/ld-i386/pr19539.t: Likewise. * testsuite/ld-scripts/defined.t: Likewise. * testsuite/ld-scripts/defined6.t: Likewise. * testsuite/ld-scripts/dynamic-sections.t: Likewise. * testsuite/ld-scripts/empty-aligned.t: Likewise. * testsuite/ld-scripts/provide-2.t: Likewise. * testsuite/ld-scripts/provide-4.t: Likewise. * testsuite/ld-vax-elf/plt-local.ld: Likewise. * testsuite/ld-x86-64/pr19539.t: Likewise. * testsuite/ld-elf/ehdr_start-missing.d: Do not initialise the dynamic linker. * testsuite/ld-elf/ehdr_start-weak.d: Likewise. * testsuite/ld-elf/elf.exp (pr14170, pr17068): Likewise. * testsuite/ld-elf/loadaddr1.d: Update expected readelf output. * testsuite/ld-elf/noload-2.d: Likewise. * testsuite/ld-powerpc/vxworks2.sd: Likewise. * testsuite/ld-scripts/phdrs3a.d: Likewise. * testsuite/ld-scripts/size-2.d: Likewise. * testsuite/ld-elf/group.ld: Add program headers. * testsuite/ld-elf/overlay.d: Skip for SPU. * testsuite/ld-elf/flags1.d: Skip for RX. * testsuite/ld-elf/pr19162.d: Skip for HPPA64. * testsuite/ld-elf/pr19539.d: Skip for ALPHA. * testsuite/ld-scripts/empty-orphan.t: Update program headers. * testsuite/ld-scripts/size-2.t: Likewise.
2016-11-23 12:10:39 +01:00
static bfd_boolean
elf64_hppa_allow_non_load_phdr (bfd *abfd ATTRIBUTE_UNUSED,
const Elf_Internal_Phdr *phdr ATTRIBUTE_UNUSED,
unsigned int count ATTRIBUTE_UNUSED)
{
return TRUE;
}
/* Allocate and initialize any program headers required by this
specific backend.
The generic ELF code only creates PT_PHDRs for executables. The HP
dynamic linker requires PT_PHDRs for dynamic libraries too.
This allocates the PT_PHDR and initializes it in a manner suitable
for the HP linker.
Note we do not have access to the link info structure here, so we have
to guess whether or not we are building a shared library based on the
existence of a .interp section. */
static bfd_boolean
elf64_hppa_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
{
2000-07-09 09:23:07 +02:00
struct elf_segment_map *m;
m = elf_seg_map (abfd);
if (info != NULL && !info->user_phdrs && m != NULL && m->p_type != PT_PHDR)
{
m = ((struct elf_segment_map *)
bfd_zalloc (abfd, (bfd_size_type) sizeof *m));
if (m == NULL)
return FALSE;
m->p_type = PT_PHDR;
m->p_flags = PF_R | PF_X;
m->p_flags_valid = 1;
m->p_paddr_valid = 1;
m->includes_phdrs = 1;
m->next = elf_seg_map (abfd);
elf_seg_map (abfd) = m;
}
for (m = elf_seg_map (abfd) ; m != NULL; m = m->next)
if (m->p_type == PT_LOAD)
{
2000-07-12 07:03:01 +02:00
unsigned int i;
for (i = 0; i < m->count; i++)
{
/* The code "hint" is not really a hint. It is a requirement
for certain versions of the HP dynamic linker. Worse yet,
it must be set even if the shared library does not have
any code in its "text" segment (thus the check for .hash
to catch this situation). */
if (m->sections[i]->flags & SEC_CODE
|| (strcmp (m->sections[i]->name, ".hash") == 0))
m->p_flags |= (PF_X | PF_HP_CODE);
}
}
return TRUE;
}
/* Called when writing out an object file to decide the type of a
symbol. */
static int
elf64_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym,
int type)
{
if (ELF_ST_TYPE (elf_sym->st_info) == STT_PARISC_MILLI)
return STT_PARISC_MILLI;
else
return type;
}
/* Support HP specific sections for core files. */
static bfd_boolean
elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int sec_index,
const char *typename)
{
if (hdr->p_type == PT_HP_CORE_KERNEL)
{
asection *sect;
if (!_bfd_elf_make_section_from_phdr (abfd, hdr, sec_index, typename))
return FALSE;
sect = bfd_make_section_anyway (abfd, ".kernel");
if (sect == NULL)
return FALSE;
sect->size = hdr->p_filesz;
sect->filepos = hdr->p_offset;
sect->flags = SEC_HAS_CONTENTS | SEC_READONLY;
return TRUE;
}
if (hdr->p_type == PT_HP_CORE_PROC)
{
int sig;
if (bfd_seek (abfd, hdr->p_offset, SEEK_SET) != 0)
return FALSE;
if (bfd_bread (&sig, 4, abfd) != 4)
return FALSE;
elf_tdata (abfd)->core->signal = sig;
if (!_bfd_elf_make_section_from_phdr (abfd, hdr, sec_index, typename))
return FALSE;
/* GDB uses the ".reg" section to read register contents. */
return _bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz,
hdr->p_offset);
}
if (hdr->p_type == PT_HP_CORE_LOADABLE
|| hdr->p_type == PT_HP_CORE_STACK
|| hdr->p_type == PT_HP_CORE_MMF)
hdr->p_type = PT_LOAD;
return _bfd_elf_make_section_from_phdr (abfd, hdr, sec_index, typename);
}
/* Hook called by the linker routine which adds symbols from an object
file. HP's libraries define symbols with HP specific section
indices, which we have to handle. */
static bfd_boolean
elf_hppa_add_symbol_hook (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
const char **namep ATTRIBUTE_UNUSED,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp,
bfd_vma *valp)
{
unsigned int sec_index = sym->st_shndx;
switch (sec_index)
{
case SHN_PARISC_ANSI_COMMON:
*secp = bfd_make_section_old_way (abfd, ".PARISC.ansi.common");
(*secp)->flags |= SEC_IS_COMMON;
*valp = sym->st_size;
break;
case SHN_PARISC_HUGE_COMMON:
*secp = bfd_make_section_old_way (abfd, ".PARISC.huge.common");
(*secp)->flags |= SEC_IS_COMMON;
*valp = sym->st_size;
break;
}
return TRUE;
}
static bfd_boolean
elf_hppa_unmark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
void *data)
{
struct bfd_link_info *info = data;
/* If we are not creating a shared library, and this symbol is
referenced by a shared library but is not defined anywhere, then
the generic code will warn that it is undefined.
This behavior is undesirable on HPs since the standard shared
libraries contain references to undefined symbols.
So we twiddle the flags associated with such symbols so that they
will not trigger the warning. ?!? FIXME. This is horribly fragile.
Ultimately we should have better controls over the generic ELF BFD
linker code. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (! bfd_link_relocatable (info)
&& info->unresolved_syms_in_shared_libs != RM_IGNORE
&& h->root.type == bfd_link_hash_undefined
&& h->ref_dynamic
&& !h->ref_regular)
{
h->ref_dynamic = 0;
h->pointer_equality_needed = 1;
}
return TRUE;
}
static bfd_boolean
elf_hppa_remark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
void *data)
{
struct bfd_link_info *info = data;
/* If we are not creating a shared library, and this symbol is
referenced by a shared library but is not defined anywhere, then
the generic code will warn that it is undefined.
This behavior is undesirable on HPs since the standard shared
libraries contain references to undefined symbols.
So we twiddle the flags associated with such symbols so that they
will not trigger the warning. ?!? FIXME. This is horribly fragile.
Ultimately we should have better controls over the generic ELF BFD
linker code. */
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (! bfd_link_relocatable (info)
&& info->unresolved_syms_in_shared_libs != RM_IGNORE
&& h->root.type == bfd_link_hash_undefined
&& !h->ref_dynamic
&& !h->ref_regular
&& h->pointer_equality_needed)
{
h->ref_dynamic = 1;
h->pointer_equality_needed = 0;
}
return TRUE;
}
static bfd_boolean
elf_hppa_is_dynamic_loader_symbol (const char *name)
{
return (! strcmp (name, "__CPU_REVISION")
|| ! strcmp (name, "__CPU_KEYBITS_1")
|| ! strcmp (name, "__SYSTEM_ID_D")
|| ! strcmp (name, "__FPU_MODEL")
|| ! strcmp (name, "__FPU_REVISION")
|| ! strcmp (name, "__ARGC")
|| ! strcmp (name, "__ARGV")
|| ! strcmp (name, "__ENVP")
|| ! strcmp (name, "__TLS_SIZE_D")
|| ! strcmp (name, "__LOAD_INFO")
|| ! strcmp (name, "__systab"));
}
/* Record the lowest address for the data and text segments. */
static void
elf_hppa_record_segment_addrs (bfd *abfd,
asection *section,
void *data)
{
struct elf64_hppa_link_hash_table *hppa_info = data;
if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma value;
Elf_Internal_Phdr *p;
p = _bfd_elf_find_segment_containing_section (abfd, section->output_section);
BFD_ASSERT (p != NULL);
value = p->p_vaddr;
if (section->flags & SEC_READONLY)
{
if (value < hppa_info->text_segment_base)
hppa_info->text_segment_base = value;
}
else
{
if (value < hppa_info->data_segment_base)
hppa_info->data_segment_base = value;
}
}
}
/* Called after we have seen all the input files/sections, but before
final symbol resolution and section placement has been determined.
We use this hook to (possibly) provide a value for __gp, then we
fall back to the generic ELF final link routine. */
static bfd_boolean
elf_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
{
struct stat buf;
struct elf64_hppa_link_hash_table *hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (! bfd_link_relocatable (info))
{
struct elf_link_hash_entry *gp;
bfd_vma gp_val;
/* The linker script defines a value for __gp iff it was referenced
by one of the objects being linked. First try to find the symbol
in the hash table. If that fails, just compute the value __gp
should have had. */
gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
FALSE, FALSE);
if (gp)
{
/* Adjust the value of __gp as we may want to slide it into the
.plt section so that the stubs can access PLT entries without
using an addil sequence. */
gp->root.u.def.value += hppa_info->gp_offset;
gp_val = (gp->root.u.def.section->output_section->vma
+ gp->root.u.def.section->output_offset
+ gp->root.u.def.value);
}
else
{
asection *sec;
/* First look for a .plt section. If found, then __gp is the
address of the .plt + gp_offset.
If no .plt is found, then look for .dlt, .opd and .data (in
that order) and set __gp to the base address of whichever
section is found first. */
sec = hppa_info->root.splt;
if (sec && ! (sec->flags & SEC_EXCLUDE))
gp_val = (sec->output_offset
+ sec->output_section->vma
+ hppa_info->gp_offset);
else
{
sec = hppa_info->dlt_sec;
if (!sec || (sec->flags & SEC_EXCLUDE))
sec = hppa_info->opd_sec;
if (!sec || (sec->flags & SEC_EXCLUDE))
sec = bfd_get_section_by_name (abfd, ".data");
if (!sec || (sec->flags & SEC_EXCLUDE))
gp_val = 0;
else
gp_val = sec->output_offset + sec->output_section->vma;
}
}
/* Install whatever value we found/computed for __gp. */
_bfd_set_gp_value (abfd, gp_val);
}
/* We need to know the base of the text and data segments so that we
can perform SEGREL relocations. We will record the base addresses
when we encounter the first SEGREL relocation. */
hppa_info->text_segment_base = (bfd_vma)-1;
hppa_info->data_segment_base = (bfd_vma)-1;
/* HP's shared libraries have references to symbols that are not
defined anywhere. The generic ELF BFD linker code will complain
about such symbols.
So we detect the losing case and arrange for the flags on the symbol
to indicate that it was never referenced. This keeps the generic
ELF BFD link code happy and appears to not create any secondary
problems. Ultimately we need a way to control the behavior of the
generic ELF BFD link code better. */
elf_link_hash_traverse (elf_hash_table (info),
elf_hppa_unmark_useless_dynamic_symbols,
info);
/* Invoke the regular ELF backend linker to do all the work. */
if (!bfd_elf_final_link (abfd, info))
return FALSE;
elf_link_hash_traverse (elf_hash_table (info),
elf_hppa_remark_useless_dynamic_symbols,
info);
/* If we're producing a final executable, sort the contents of the
unwind section. */
if (bfd_link_relocatable (info))
return TRUE;
/* 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". */
Use bfd_get_filename throughout bfd * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use bfd_get_filename rather than accessing bfd->filename directly. * aout-target.h (MY (object_p)): Likewise. * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise. * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag), (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr), (_bfd_archive_bsd44_construct_extended_name_table), (_bfd_write_archive_contents, _bfd_compute_and_write_armap), (_bfd_bsd_write_armap): Likewise. * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise. * cache.c (bfd_open_file): Likewise. * ecoff.c (_bfd_ecoff_write_armap): Likewise. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise. * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_final_link): Likewise. * elf32-nds32.c (nds32_elf_output_symbol_hook), (patch_tls_desc_to_ie): Likewise. * elf32-spu.c (sort_bfds, print_one_overlay_section), (spu_elf_auto_overlay): Likewise. * elf64-hppa.c (elf_hppa_final_link): Likewise. * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise. * elfcore.h (elf_core_file_matches_executable_p): Likewise. * elflink.c (bfd_elf_size_dynamic_sections), (elf_link_input_bfd): Likewise. * linker.c (_bfd_generic_link_output_symbols): Likewise. * mach-o.c (bfd_mach_o_follow_dsym), (bfd_mach_o_close_and_cleanup): Likewise. * opncls.c (_bfd_delete_bfd, _maybe_make_executable), (find_separate_debug_file, get_build_id_name): Likewise. * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise. * plugin.c (bfd_plugin_open_input): Likewise. * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise. * som.c (som_write_armap): Likewise. * srec.c (srec_write_record, srec_write_symbols): Likewise. * vms-lib.c (_bfd_vms_lib_get_imagelib_file), (_bfd_vms_lib_write_archive_contents): Likewise. * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2020-05-19 05:05:03 +02:00
if (stat (bfd_get_filename (abfd), &buf) != 0
|| !S_ISREG(buf.st_mode))
return TRUE;
return elf_hppa_sort_unwind (abfd);
}
/* Relocate the given INSN. VALUE should be the actual value we want
to insert into the instruction, ie by this point we should not be
concerned with computing an offset relative to the DLT, PC, etc.
Instead this routine is meant to handle the bit manipulations needed
to insert the relocation into the given instruction. */
static int
elf_hppa_relocate_insn (int insn, int sym_value, unsigned int r_type)
{
switch (r_type)
{
/* This is any 22 bit branch. In PA2.0 syntax it corresponds to
the "B" instruction. */
case R_PARISC_PCREL22F:
case R_PARISC_PCREL22C:
return (insn & ~0x3ff1ffd) | re_assemble_22 (sym_value);
/* This is any 12 bit branch. */
case R_PARISC_PCREL12F:
return (insn & ~0x1ffd) | re_assemble_12 (sym_value);
/* This is any 17 bit branch. In PA2.0 syntax it also corresponds
to the "B" instruction as well as BE. */
case R_PARISC_PCREL17F:
case R_PARISC_DIR17F:
case R_PARISC_DIR17R:
case R_PARISC_PCREL17C:
case R_PARISC_PCREL17R:
return (insn & ~0x1f1ffd) | re_assemble_17 (sym_value);
/* ADDIL or LDIL instructions. */
case R_PARISC_DLTREL21L:
case R_PARISC_DLTIND21L:
case R_PARISC_LTOFF_FPTR21L:
case R_PARISC_PCREL21L:
case R_PARISC_LTOFF_TP21L:
case R_PARISC_DPREL21L:
case R_PARISC_PLTOFF21L:
case R_PARISC_DIR21L:
return (insn & ~0x1fffff) | re_assemble_21 (sym_value);
/* LDO and integer loads/stores with 14 bit displacements. */
case R_PARISC_DLTREL14R:
case R_PARISC_DLTREL14F:
case R_PARISC_DLTIND14R:
case R_PARISC_DLTIND14F:
case R_PARISC_LTOFF_FPTR14R:
case R_PARISC_PCREL14R:
case R_PARISC_PCREL14F:
case R_PARISC_LTOFF_TP14R:
case R_PARISC_LTOFF_TP14F:
case R_PARISC_DPREL14R:
case R_PARISC_DPREL14F:
case R_PARISC_PLTOFF14R:
case R_PARISC_PLTOFF14F:
case R_PARISC_DIR14R:
case R_PARISC_DIR14F:
return (insn & ~0x3fff) | low_sign_unext (sym_value, 14);
/* PA2.0W LDO and integer loads/stores with 16 bit displacements. */
case R_PARISC_LTOFF_FPTR16F:
case R_PARISC_PCREL16F:
case R_PARISC_LTOFF_TP16F:
case R_PARISC_GPREL16F:
case R_PARISC_PLTOFF16F:
case R_PARISC_DIR16F:
case R_PARISC_LTOFF16F:
return (insn & ~0xffff) | re_assemble_16 (sym_value);
/* Doubleword loads and stores with a 14 bit displacement. */
case R_PARISC_DLTREL14DR:
case R_PARISC_DLTIND14DR:
case R_PARISC_LTOFF_FPTR14DR:
case R_PARISC_LTOFF_FPTR16DF:
case R_PARISC_PCREL14DR:
case R_PARISC_PCREL16DF:
case R_PARISC_LTOFF_TP14DR:
case R_PARISC_LTOFF_TP16DF:
case R_PARISC_DPREL14DR:
case R_PARISC_GPREL16DF:
case R_PARISC_PLTOFF14DR:
case R_PARISC_PLTOFF16DF:
case R_PARISC_DIR14DR:
case R_PARISC_DIR16DF:
case R_PARISC_LTOFF16DF:
return (insn & ~0x3ff1) | (((sym_value & 0x2000) >> 13)
| ((sym_value & 0x1ff8) << 1));
/* Floating point single word load/store instructions. */
case R_PARISC_DLTREL14WR:
case R_PARISC_DLTIND14WR:
case R_PARISC_LTOFF_FPTR14WR:
case R_PARISC_LTOFF_FPTR16WF:
case R_PARISC_PCREL14WR:
case R_PARISC_PCREL16WF:
case R_PARISC_LTOFF_TP14WR:
case R_PARISC_LTOFF_TP16WF:
case R_PARISC_DPREL14WR:
case R_PARISC_GPREL16WF:
case R_PARISC_PLTOFF14WR:
case R_PARISC_PLTOFF16WF:
case R_PARISC_DIR16WF:
case R_PARISC_DIR14WR:
case R_PARISC_LTOFF16WF:
return (insn & ~0x3ff9) | (((sym_value & 0x2000) >> 13)
| ((sym_value & 0x1ffc) << 1));
default:
return insn;
}
}
/* Compute the value for a relocation (REL) during a final link stage,
then insert the value into the proper location in CONTENTS.
VALUE is a tentative value for the relocation and may be overridden
and modified here based on the specific relocation to be performed.
For example we do conversions for PC-relative branches in this routine
or redirection of calls to external routines to stubs.
The work of actually applying the relocation is left to a helper
routine in an attempt to reduce the complexity and size of this
function. */
static bfd_reloc_status_type
elf_hppa_final_link_relocate (Elf_Internal_Rela *rel,
bfd *input_bfd,
bfd *output_bfd,
asection *input_section,
bfd_byte *contents,
bfd_vma value,
struct bfd_link_info *info,
asection *sym_sec,
struct elf_link_hash_entry *eh)
{
struct elf64_hppa_link_hash_table *hppa_info = hppa_link_hash_table (info);
struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
bfd_vma *local_offsets;
Elf_Internal_Shdr *symtab_hdr;
int insn;
bfd_vma max_branch_offset = 0;
bfd_vma offset = rel->r_offset;
bfd_signed_vma addend = rel->r_addend;
reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info);
unsigned int r_symndx = ELF_R_SYM (rel->r_info);
unsigned int r_type = howto->type;
bfd_byte *hit_data = contents + offset;
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return bfd_reloc_notsupported;
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
local_offsets = elf_local_got_offsets (input_bfd);
insn = bfd_get_32 (input_bfd, hit_data);
switch (r_type)
{
case R_PARISC_NONE:
break;
/* Basic function call support.
Note for a call to a function defined in another dynamic library
we want to redirect the call to a stub. */
/* PC relative relocs without an implicit offset. */
case R_PARISC_PCREL21L:
case R_PARISC_PCREL14R:
case R_PARISC_PCREL14F:
case R_PARISC_PCREL14WR:
case R_PARISC_PCREL14DR:
case R_PARISC_PCREL16F:
case R_PARISC_PCREL16WF:
case R_PARISC_PCREL16DF:
{
/* If this is a call to a function defined in another dynamic
library, then redirect the call to the local stub for this
function. */
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (hh->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
/* Adjust for any field selectors. */
if (r_type == R_PARISC_PCREL21L)
value = hppa_field_adjust (value, -8 + addend, e_lsel);
else if (r_type == R_PARISC_PCREL14F
|| r_type == R_PARISC_PCREL16F
|| r_type == R_PARISC_PCREL16WF
|| r_type == R_PARISC_PCREL16DF)
value = hppa_field_adjust (value, -8 + addend, e_fsel);
else
value = hppa_field_adjust (value, -8 + addend, e_rsel);
/* Apply the relocation to the given instruction. */
insn = elf_hppa_relocate_insn (insn, (int) value, r_type);
break;
}
case R_PARISC_PCREL12F:
case R_PARISC_PCREL22F:
case R_PARISC_PCREL17F:
case R_PARISC_PCREL22C:
case R_PARISC_PCREL17C:
case R_PARISC_PCREL17R:
{
/* If this is a call to a function defined in another dynamic
library, then redirect the call to the local stub for this
function. */
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (hh->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
addend -= 8;
if (r_type == (unsigned int) R_PARISC_PCREL22F)
max_branch_offset = (1 << (22-1)) << 2;
else if (r_type == (unsigned int) R_PARISC_PCREL17F)
max_branch_offset = (1 << (17-1)) << 2;
else if (r_type == (unsigned int) R_PARISC_PCREL12F)
max_branch_offset = (1 << (12-1)) << 2;
/* Make sure we can reach the branch target. */
if (max_branch_offset != 0
&& value + addend + max_branch_offset >= 2*max_branch_offset)
{
Remove syntactic sugar Now that _bfd_error_handler is not a function pointer. * aout-adobe.c: Replace (*_bfd_error_handler) (...) with _bfd_error_handler (...) throughout. * aout-cris.c, * aoutx.h, * archive.c, * bfd.c, * binary.c, * cache.c, * coff-alpha.c, * coff-arm.c, * coff-h8300.c, * coff-i860.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * cpu-arm.c, * cpu-m68k.c, * cpu-sh.c, * dwarf2.c, * ecoff.c, * elf-eh-frame.c, * elf-m10300.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cris.c, * elf32-crx.c, * elf32-dlx.c, * elf32-frv.c, * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-x86-64.c, * elfcode.h, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * hpux-core.c, * i386linux.c, * ieee.c, * ihex.c, * libbfd.c, * linker.c, * m68klinux.c, * mach-o.c, * merge.c, * mmo.c, * oasys.c, * osf-core.c, * pdp11.c, * pe-mips.c, * peXXigen.c, * pef.c, * plugin.c, * reloc.c, * rs6000-core.c, * sco5-core.c, * som.c, * sparclinux.c, * srec.c, * stabs.c, * syms.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * xcofflink.c: Likewise.
2016-09-30 05:30:18 +02:00
_bfd_error_handler
Add c-format tags to translatable strings with more than one argument-using formatting token. * aout-adobe.c: Add missing c-format tags for translatable strings. * aout-cris.c: Likewise. * aoutx.h: Likewise. * bfd.c: Likewise. * binary.c: Likewise. * cache.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-i860.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * ecoff.c: Likewise. * elf-attrs.c: Likewise. * elf-eh-frame.c: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-d30v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i960.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-pj.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-xgate.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * m68klinux.c: Likewise. * mach-o.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peXXigen.c: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * ppcboot.c: Likewise. * reloc.c: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * stabs.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * xcofflink.c: Likewise.
2016-10-19 15:04:34 +02:00
/* xgettext:c-format */
(_("%pB(%pA+%#" PRIx64 "): cannot reach %s"),
input_bfd,
input_section,
(uint64_t) offset,
eh ? eh->root.root.string : "unknown");
bfd_set_error (bfd_error_bad_value);
return bfd_reloc_overflow;
}
/* Adjust for any field selectors. */
if (r_type == R_PARISC_PCREL17R)
value = hppa_field_adjust (value, addend, e_rsel);
else
value = hppa_field_adjust (value, addend, e_fsel);
/* All branches are implicitly shifted by 2 places. */
value >>= 2;
/* Apply the relocation to the given instruction. */
insn = elf_hppa_relocate_insn (insn, (int) value, r_type);
break;
}
/* Indirect references to data through the DLT. */
case R_PARISC_DLTIND14R:
case R_PARISC_DLTIND14F:
case R_PARISC_DLTIND14DR:
case R_PARISC_DLTIND14WR:
case R_PARISC_DLTIND21L:
case R_PARISC_LTOFF_FPTR14R:
case R_PARISC_LTOFF_FPTR14DR:
case R_PARISC_LTOFF_FPTR14WR:
case R_PARISC_LTOFF_FPTR21L:
case R_PARISC_LTOFF_FPTR16F:
case R_PARISC_LTOFF_FPTR16WF:
case R_PARISC_LTOFF_FPTR16DF:
case R_PARISC_LTOFF_TP21L:
case R_PARISC_LTOFF_TP14R:
case R_PARISC_LTOFF_TP14F:
case R_PARISC_LTOFF_TP14WR:
case R_PARISC_LTOFF_TP14DR:
case R_PARISC_LTOFF_TP16F:
case R_PARISC_LTOFF_TP16WF:
case R_PARISC_LTOFF_TP16DF:
case R_PARISC_LTOFF16F:
case R_PARISC_LTOFF16WF:
case R_PARISC_LTOFF16DF:
{
bfd_vma off;
/* If this relocation was against a local symbol, then we still
have not set up the DLT entry (it's not convenient to do so
in the "finalize_dlt" routine because it is difficult to get
to the local symbol's value).
So, if this is a local symbol (h == NULL), then we need to
fill in its DLT entry.
Similarly we may still need to set up an entry in .opd for
a local function which had its address taken. */
if (hh == NULL)
{
bfd_vma *local_opd_offsets, *local_dlt_offsets;
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
if (local_offsets == NULL)
abort ();
/* Now do .opd creation if needed. */
if (r_type == R_PARISC_LTOFF_FPTR14R
|| r_type == R_PARISC_LTOFF_FPTR14DR
|| r_type == R_PARISC_LTOFF_FPTR14WR
|| r_type == R_PARISC_LTOFF_FPTR21L
|| r_type == R_PARISC_LTOFF_FPTR16F
|| r_type == R_PARISC_LTOFF_FPTR16WF
|| r_type == R_PARISC_LTOFF_FPTR16DF)
{
local_opd_offsets = local_offsets + 2 * symtab_hdr->sh_info;
off = local_opd_offsets[r_symndx];
/* The last bit records whether we've already initialised
this local .opd entry. */
if ((off & 1) != 0)
{
BFD_ASSERT (off != (bfd_vma) -1);
off &= ~1;
}
else
{
local_opd_offsets[r_symndx] |= 1;
/* The first two words of an .opd entry are zero. */
memset (hppa_info->opd_sec->contents + off, 0, 16);
/* The next word is the address of the function. */
bfd_put_64 (hppa_info->opd_sec->owner, value + addend,
(hppa_info->opd_sec->contents + off + 16));
/* The last word is our local __gp value. */
value = _bfd_get_gp_value (info->output_bfd);
bfd_put_64 (hppa_info->opd_sec->owner, value,
(hppa_info->opd_sec->contents + off + 24));
}
/* The DLT value is the address of the .opd entry. */
value = (off
+ hppa_info->opd_sec->output_offset
+ hppa_info->opd_sec->output_section->vma);
addend = 0;
}
local_dlt_offsets = local_offsets;
off = local_dlt_offsets[r_symndx];
if ((off & 1) != 0)
{
BFD_ASSERT (off != (bfd_vma) -1);
off &= ~1;
}
else
{
local_dlt_offsets[r_symndx] |= 1;
bfd_put_64 (hppa_info->dlt_sec->owner,
value + addend,
hppa_info->dlt_sec->contents + off);
}
}
else
off = hh->dlt_offset;
/* We want the value of the DLT offset for this symbol, not
the symbol's actual address. Note that __gp may not point
to the start of the DLT, so we have to compute the absolute
address, then subtract out the value of __gp. */
value = (off
+ hppa_info->dlt_sec->output_offset
+ hppa_info->dlt_sec->output_section->vma);
value -= _bfd_get_gp_value (output_bfd);
/* All DLTIND relocations are basically the same at this point,
except that we need different field selectors for the 21bit
version vs the 14bit versions. */
if (r_type == R_PARISC_DLTIND21L
|| r_type == R_PARISC_LTOFF_FPTR21L
|| r_type == R_PARISC_LTOFF_TP21L)
value = hppa_field_adjust (value, 0, e_lsel);
else if (r_type == R_PARISC_DLTIND14F
|| r_type == R_PARISC_LTOFF_FPTR16F
|| r_type == R_PARISC_LTOFF_FPTR16WF
|| r_type == R_PARISC_LTOFF_FPTR16DF
|| r_type == R_PARISC_LTOFF16F
|| r_type == R_PARISC_LTOFF16DF
|| r_type == R_PARISC_LTOFF16WF
|| r_type == R_PARISC_LTOFF_TP16F
|| r_type == R_PARISC_LTOFF_TP16WF
|| r_type == R_PARISC_LTOFF_TP16DF)
value = hppa_field_adjust (value, 0, e_fsel);
else
value = hppa_field_adjust (value, 0, e_rsel);
insn = elf_hppa_relocate_insn (insn, (int) value, r_type);
break;
}
case R_PARISC_DLTREL14R:
case R_PARISC_DLTREL14F:
case R_PARISC_DLTREL14DR:
case R_PARISC_DLTREL14WR:
case R_PARISC_DLTREL21L:
case R_PARISC_DPREL21L:
case R_PARISC_DPREL14WR:
case R_PARISC_DPREL14DR:
case R_PARISC_DPREL14R:
case R_PARISC_DPREL14F:
case R_PARISC_GPREL16F:
case R_PARISC_GPREL16WF:
case R_PARISC_GPREL16DF:
{
/* Subtract out the global pointer value to make value a DLT
relative address. */
value -= _bfd_get_gp_value (output_bfd);
/* All DLTREL relocations are basically the same at this point,
except that we need different field selectors for the 21bit
version vs the 14bit versions. */
if (r_type == R_PARISC_DLTREL21L
|| r_type == R_PARISC_DPREL21L)
value = hppa_field_adjust (value, addend, e_lrsel);
else if (r_type == R_PARISC_DLTREL14F
|| r_type == R_PARISC_DPREL14F
|| r_type == R_PARISC_GPREL16F
|| r_type == R_PARISC_GPREL16WF
|| r_type == R_PARISC_GPREL16DF)
value = hppa_field_adjust (value, addend, e_fsel);
else
value = hppa_field_adjust (value, addend, e_rrsel);
insn = elf_hppa_relocate_insn (insn, (int) value, r_type);
break;
}
case R_PARISC_DIR21L:
case R_PARISC_DIR17R:
case R_PARISC_DIR17F:
case R_PARISC_DIR14R:
case R_PARISC_DIR14F:
case R_PARISC_DIR14WR:
case R_PARISC_DIR14DR:
case R_PARISC_DIR16F:
case R_PARISC_DIR16WF:
case R_PARISC_DIR16DF:
{
/* All DIR relocations are basically the same at this point,
except that branch offsets need to be divided by four, and
we need different field selectors. Note that we don't
redirect absolute calls to local stubs. */
if (r_type == R_PARISC_DIR21L)
value = hppa_field_adjust (value, addend, e_lrsel);
else if (r_type == R_PARISC_DIR17F
|| r_type == R_PARISC_DIR16F
|| r_type == R_PARISC_DIR16WF
|| r_type == R_PARISC_DIR16DF
|| r_type == R_PARISC_DIR14F)
value = hppa_field_adjust (value, addend, e_fsel);
else
value = hppa_field_adjust (value, addend, e_rrsel);
if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F)
/* All branches are implicitly shifted by 2 places. */
value >>= 2;
insn = elf_hppa_relocate_insn (insn, (int) value, r_type);
break;
}
case R_PARISC_PLTOFF21L:
case R_PARISC_PLTOFF14R:
case R_PARISC_PLTOFF14F:
case R_PARISC_PLTOFF14WR:
case R_PARISC_PLTOFF14DR:
case R_PARISC_PLTOFF16F:
case R_PARISC_PLTOFF16WF:
case R_PARISC_PLTOFF16DF:
{
/* We want the value of the PLT offset for this symbol, not
the symbol's actual address. Note that __gp may not point
to the start of the DLT, so we have to compute the absolute
address, then subtract out the value of __gp. */
value = (hh->plt_offset
+ hppa_info->root.splt->output_offset
+ hppa_info->root.splt->output_section->vma);
value -= _bfd_get_gp_value (output_bfd);
/* All PLTOFF relocations are basically the same at this point,
except that we need different field selectors for the 21bit
version vs the 14bit versions. */
if (r_type == R_PARISC_PLTOFF21L)
value = hppa_field_adjust (value, addend, e_lrsel);
else if (r_type == R_PARISC_PLTOFF14F
|| r_type == R_PARISC_PLTOFF16F
|| r_type == R_PARISC_PLTOFF16WF
|| r_type == R_PARISC_PLTOFF16DF)
value = hppa_field_adjust (value, addend, e_fsel);
else
value = hppa_field_adjust (value, addend, e_rrsel);
insn = elf_hppa_relocate_insn (insn, (int) value, r_type);
break;
}
case R_PARISC_LTOFF_FPTR32:
{
/* FIXME: There used to be code here to create the FPTR itself if
the relocation was against a local symbol. But the code could
never have worked. If the assert below is ever triggered then
the code will need to be reinstated and fixed so that it does
what is needed. */
BFD_ASSERT (hh != NULL);
/* We want the value of the DLT offset for this symbol, not
the symbol's actual address. Note that __gp may not point
to the start of the DLT, so we have to compute the absolute
address, then subtract out the value of __gp. */
value = (hh->dlt_offset
+ hppa_info->dlt_sec->output_offset
+ hppa_info->dlt_sec->output_section->vma);
value -= _bfd_get_gp_value (output_bfd);
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_LTOFF_FPTR64:
case R_PARISC_LTOFF_TP64:
{
/* We may still need to create the FPTR itself if it was for
a local symbol. */
if (eh == NULL && r_type == R_PARISC_LTOFF_FPTR64)
{
/* The first two words of an .opd entry are zero. */
memset (hppa_info->opd_sec->contents + hh->opd_offset, 0, 16);
/* The next word is the address of the function. */
bfd_put_64 (hppa_info->opd_sec->owner, value + addend,
(hppa_info->opd_sec->contents
+ hh->opd_offset + 16));
/* The last word is our local __gp value. */
value = _bfd_get_gp_value (info->output_bfd);
bfd_put_64 (hppa_info->opd_sec->owner, value,
hppa_info->opd_sec->contents + hh->opd_offset + 24);
/* The DLT value is the address of the .opd entry. */
value = (hh->opd_offset
+ hppa_info->opd_sec->output_offset
+ hppa_info->opd_sec->output_section->vma);
bfd_put_64 (hppa_info->dlt_sec->owner,
value,
hppa_info->dlt_sec->contents + hh->dlt_offset);
}
/* We want the value of the DLT offset for this symbol, not
the symbol's actual address. Note that __gp may not point
to the start of the DLT, so we have to compute the absolute
address, then subtract out the value of __gp. */
value = (hh->dlt_offset
+ hppa_info->dlt_sec->output_offset
+ hppa_info->dlt_sec->output_section->vma);
value -= _bfd_get_gp_value (output_bfd);
bfd_put_64 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_DIR32:
bfd_put_32 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
case R_PARISC_DIR64:
bfd_put_64 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
case R_PARISC_GPREL64:
/* Subtract out the global pointer value to make value a DLT
relative address. */
value -= _bfd_get_gp_value (output_bfd);
bfd_put_64 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
case R_PARISC_LTOFF64:
/* We want the value of the DLT offset for this symbol, not
the symbol's actual address. Note that __gp may not point
to the start of the DLT, so we have to compute the absolute
address, then subtract out the value of __gp. */
value = (hh->dlt_offset
+ hppa_info->dlt_sec->output_offset
+ hppa_info->dlt_sec->output_section->vma);
value -= _bfd_get_gp_value (output_bfd);
bfd_put_64 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
case R_PARISC_PCREL32:
{
/* If this is a call to a function defined in another dynamic
library, then redirect the call to the local stub for this
function. */
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (hh->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
value += addend;
value -= 8;
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_PCREL64:
{
/* If this is a call to a function defined in another dynamic
library, then redirect the call to the local stub for this
function. */
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (hh->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
value += addend;
value -= 8;
bfd_put_64 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_FPTR64:
{
bfd_vma off;
/* We may still need to create the FPTR itself if it was for
a local symbol. */
if (hh == NULL)
{
bfd_vma *local_opd_offsets;
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
if (local_offsets == NULL)
abort ();
local_opd_offsets = local_offsets + 2 * symtab_hdr->sh_info;
off = local_opd_offsets[r_symndx];
/* The last bit records whether we've already initialised
this local .opd entry. */
if ((off & 1) != 0)
{
BFD_ASSERT (off != (bfd_vma) -1);
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
off &= ~1;
}
else
{
/* The first two words of an .opd entry are zero. */
memset (hppa_info->opd_sec->contents + off, 0, 16);
/* The next word is the address of the function. */
bfd_put_64 (hppa_info->opd_sec->owner, value + addend,
(hppa_info->opd_sec->contents + off + 16));
/* The last word is our local __gp value. */
value = _bfd_get_gp_value (info->output_bfd);
bfd_put_64 (hppa_info->opd_sec->owner, value,
hppa_info->opd_sec->contents + off + 24);
}
}
else
off = hh->opd_offset;
if (hh == NULL || hh->want_opd)
/* We want the value of the OPD offset for this symbol. */
value = (off
+ hppa_info->opd_sec->output_offset
+ hppa_info->opd_sec->output_section->vma);
else
/* We want the address of the symbol. */
value += addend;
bfd_put_64 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_SECREL32:
if (sym_sec)
value -= sym_sec->output_section->vma;
bfd_put_32 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
case R_PARISC_SEGREL32:
case R_PARISC_SEGREL64:
{
/* If this is the first SEGREL relocation, then initialize
the segment base values. */
if (hppa_info->text_segment_base == (bfd_vma) -1)
bfd_map_over_sections (output_bfd, elf_hppa_record_segment_addrs,
hppa_info);
/* VALUE holds the absolute address. We want to include the
addend, then turn it into a segment relative address.
The segment is derived from SYM_SEC. We assume that there are
only two segments of note in the resulting executable/shlib.
A readonly segment (.text) and a readwrite segment (.data). */
value += addend;
if (sym_sec->flags & SEC_CODE)
value -= hppa_info->text_segment_base;
else
value -= hppa_info->data_segment_base;
if (r_type == R_PARISC_SEGREL32)
bfd_put_32 (input_bfd, value, hit_data);
else
bfd_put_64 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
/* Something we don't know how to handle. */
default:
return bfd_reloc_notsupported;
}
/* Update the instruction word. */
bfd_put_32 (input_bfd, (bfd_vma) insn, hit_data);
return bfd_reloc_ok;
}
/* Relocate an HPPA ELF section. */
static bfd_boolean
elf64_hppa_relocate_section (bfd *output_bfd,
struct bfd_link_info *info,
bfd *input_bfd,
asection *input_section,
bfd_byte *contents,
Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms,
asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
struct elf64_hppa_link_hash_table *hppa_info;
hppa_info = hppa_link_hash_table (info);
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
if (hppa_info == NULL)
return FALSE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
rel = relocs;
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
{
int r_type;
reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info);
unsigned long r_symndx;
struct elf_link_hash_entry *eh;
Elf_Internal_Sym *sym;
asection *sym_sec;
bfd_vma relocation;
bfd_reloc_status_type r;
r_type = ELF_R_TYPE (rel->r_info);
if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED)
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (r_type == (unsigned int) R_PARISC_GNU_VTENTRY
|| r_type == (unsigned int) R_PARISC_GNU_VTINHERIT)
continue;
/* This is a final link. */
r_symndx = ELF_R_SYM (rel->r_info);
eh = NULL;
sym = NULL;
sym_sec = NULL;
if (r_symndx < symtab_hdr->sh_info)
{
/* This is a local symbol, hh defaults to NULL. */
sym = local_syms + r_symndx;
sym_sec = local_sections[r_symndx];
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
}
else
{
/* This is not a local symbol. */
struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
/* It seems this can happen with erroneous or unsupported
input (mixing a.out and elf in an archive, for example.) */
if (sym_hashes == NULL)
return FALSE;
eh = sym_hashes[r_symndx - symtab_hdr->sh_info];
if (info->wrap_hash != NULL
&& (input_section->flags & SEC_DEBUGGING) != 0)
eh = ((struct elf_link_hash_entry *)
unwrap_hash_lookup (info, input_bfd, &eh->root));
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
while (eh->root.type == bfd_link_hash_indirect
|| eh->root.type == bfd_link_hash_warning)
eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
relocation = 0;
if (eh->root.type == bfd_link_hash_defined
|| eh->root.type == bfd_link_hash_defweak)
{
sym_sec = eh->root.u.def.section;
2010-06-27 06:07:55 +02:00
if (sym_sec != NULL
&& sym_sec->output_section != NULL)
relocation = (eh->root.u.def.value
+ sym_sec->output_section->vma
+ sym_sec->output_offset);
}
else if (eh->root.type == bfd_link_hash_undefweak)
;
else if (info->unresolved_syms_in_objects == RM_IGNORE
&& ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT)
;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
else if (!bfd_link_relocatable (info)
&& elf_hppa_is_dynamic_loader_symbol (eh->root.root.string))
continue;
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
else if (!bfd_link_relocatable (info))
{
bfd_boolean 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);
}
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
if (!bfd_link_relocatable (info)
&& relocation == 0
&& eh->root.type != bfd_link_hash_defined
&& eh->root.type != bfd_link_hash_defweak
&& eh->root.type != bfd_link_hash_undefweak)
{
if (info->unresolved_syms_in_objects == RM_IGNORE
&& ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT
&& eh->type == STT_PARISC_MILLI)
info->callbacks->undefined_symbol
Return void from linker callbacks The ldmain.c implementation of these linker callback functions always return true, so any code handling a false return is dead. What's more, some of the bfd backends abort if ever a false return is seen, and there seems to be some confusion in gdb's compile-object-load.c. The return value was never meant to be "oh yes, a multiple_definition error occurred", but rather "out of memory or other catastrophic failure". This patch removes the status return on the callbacks that always return true. I kept the return status for "notice" because that one does happen to need to return "out of memory". include/ * bfdlink.h (struct bfd_link_callbacks): Update comments. Return void from multiple_definition, multiple_common, add_to_set, constructor, warning, undefined_symbol, reloc_overflow, reloc_dangerous and unattached_reloc. bfd/ * aoutx.h: Adjust linker callback calls throughout file, removing dead code. * bout.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-h8300.c: Likewise. * coff-h8500.c: Likewise. * coff-i960.c: Likewise. * coff-mcore.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic80.c: Likewise. * coff-w65.c: Likewise. * coff-z80.c: Likewise. * coff-z8k.c: Likewise. * coff64-rs6000.c: Likewise. * cofflink.c: Likewise. * ecoff.c: Likewise. * elf-bfd.h: Likewise. * elf-m10200.c: Likewise. * elf-m10300.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-ft32.c: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * linker.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * reloc.c: Likewise. * reloc16.c: Likewise. * simple.c: Likewise. * vms-alpha.c: Likewise. * xcofflink.c: Likewise. * elf32-rl78.c (get_symbol_value, get_romstart, get_ramstart): Delete status param. Adjust calls to these and linker callbacks throughout. * elf32-rx.c: (get_symbol_value, get_gp, get_romstart, get_ramstart): Delete status param. Adjust calls to these and linker callbacks throughout. ld/ * ldmain.c (multiple_definition, multiple_common, add_to_set, constructor_callback, warning_callback, undefined_symbol, reloc_overflow, reloc_dangerous, unattached_reloc): Return void. * emultempl/elf32.em: Adjust callback calls. gdb/ * compile/compile-object-load.c (link_callbacks_multiple_definition, link_callbacks_warning, link_callbacks_undefined_symbol, link_callbacks_undefined_symbol, link_callbacks_reloc_overflow, link_callbacks_reloc_dangerous, link_callbacks_unattached_reloc): Return void.
2016-05-27 09:50:55 +02:00
(info, eh_name (eh), input_bfd,
input_section, rel->r_offset, FALSE);
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
}
}
PR ld/13991 bfd/ * bfd/elf-bfd.h (_bfd_elf_link_just_syms): Define as _bfd_generic_link_just_syms. * bfd/elflink.c (_bfd_elf_link_just_syms): Delete. * bfd/linker.c (_bfd_generic_link_just_syms): Set sec_info_type. * bfd/bfd-in.h (discarded_section): Renamed from elf_discarded_section. * bfd/section.c (SEC_INFO_TYPE_NONE, SEC_INFO_TYPE_STABS, SEC_INFO_TYPE_MERGE, SEC_INFO_TYPE_EH_FRAME, SEC_INFO_TYPE_JUST_SYMS): Renamed from corresponding ELF_INFO_TYPE. * bfd/elf-eh-frame.c, * bfd/elf-m10200.c, * bfd/elf-m10300.c, * bfd/elf.c, * bfd/elf32-arm.c, * bfd/elf32-avr.c, * bfd/elf32-bfin.c, * bfd/elf32-cr16.c, * bfd/elf32-cr16c.c, * bfd/elf32-cris.c, * bfd/elf32-crx.c, * bfd/elf32-d10v.c, * bfd/elf32-epiphany.c, * bfd/elf32-fr30.c, * bfd/elf32-frv.c, * bfd/elf32-h8300.c, * bfd/elf32-hppa.c, * bfd/elf32-i370.c, * bfd/elf32-i386.c, * bfd/elf32-i860.c, * bfd/elf32-ip2k.c, * bfd/elf32-iq2000.c, * bfd/elf32-lm32.c, * bfd/elf32-m32c.c, * bfd/elf32-m32r.c, * bfd/elf32-m68hc1x.c, * bfd/elf32-m68k.c, * bfd/elf32-mcore.c, * bfd/elf32-mep.c, * bfd/elf32-moxie.c, * bfd/elf32-msp430.c, * bfd/elf32-mt.c, * bfd/elf32-openrisc.c, * bfd/elf32-ppc.c, * bfd/elf32-rl78.c, * bfd/elf32-rx.c, * bfd/elf32-s390.c, * bfd/elf32-score.c, * bfd/elf32-score7.c, * bfd/elf32-sh.c, * bfd/elf32-spu.c, * bfd/elf32-tic6x.c, * bfd/elf32-tilepro.c, * bfd/elf32-v850.c, * bfd/elf32-vax.c, * bfd/elf32-xc16x.c, * bfd/elf32-xstormy16.c, * bfd/elf32-xtensa.c, * bfd/elf64-alpha.c, * bfd/elf64-hppa.c, * bfd/elf64-ia64-vms.c, * bfd/elf64-mmix.c, * bfd/elf64-ppc.c, * bfd/elf64-s390.c, * bfd/elf64-sh64.c, * bfd/elf64-x86-64.c, * bfd/elflink.c, * bfd/elfnn-ia64.c, * bfd/elfxx-mips.c, * bfd/elfxx-sparc.c, * bfd/elfxx-tilegx.c, * bfd/reloc.c: Update all references. * bfd/bfd-in2.h: Regenerate. ld/ * ld/ldlang.c (size_input_section): Use sec_info_type rather than usrdata->flags.just_syms. * ld/ldwrite.c (build_link_order): Likewise. * ld/emultempl/hppaelf.em (build_section_lists): Likewise. * ld/emultempl/ppc64elf.em (build_toc_list): Likewise. * ld/emultempl/armelf.em (build_section_lists): Likewise. (after_allocation): Update for renamed sec_info_type value. * ld/emultempl/tic6xdsbt.em: Likewise.
2012-04-24 07:12:40 +02:00
if (sym_sec != NULL && discarded_section (sym_sec))
bfd/ * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Always call _bfd_clear_contents. Pass it the input section. * libbfd-in.h (_bfd_clear_contents): Add input_section argument. * libbfd.h: Regenerate. * reloc.c (_bfd_clear_contents): Take input_section argument. Use non-zero for .debug_ranges. (bfd_generic_get_relocated_section_conten): Update _bfd_clear_contents call. * elf32-arm.c (elf32_arm_relocate_section): Use RELOC_AGAINST_DISCARDED_SECTION. * elf-m10200.c (mn10200_elf_relocate_section): Likewise. * elf-m10300.c (mn10300_elf_relocate_section): Likewise. * elf32-arm.c (elf32_arm_relocate_section): Likewise. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-bfin.c (bfin_relocate_section): Likewise. (bfinfdpic_relocate_section): Likewise. * elf32-cr16.c (elf32_cr16_relocate_section): Likewise. * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-crx.c (elf32_crx_relocate_section): Likewise. * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. * elf32-lm32.c (lm32_elf_relocate_section): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-mep.c (mep_elf_relocate_section): Likewise. * elf32-moxie.c (moxie_elf_relocate_section): Likewise. * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-mt.c (mt_elf_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-rx.c (rx_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-spu.c (spu_elf_relocate_section): Likewise. * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. (elf64_alpha_relocate_section): Likewise. * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. * elf64-mmix.c (mmix_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. ld/testsuite/ * ld-discard/zero-range.d, ld-discard/zero-range.s: New files.
2010-10-25 17:54:16 +02:00
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Handle compound relocations. * elfxx-mips.c (mips_reloc_against_discarded_section): New function. (_bfd_mips_elf_relocate_section): Call it, in place of RELOC_AGAINST_DISCARDED_SECTION. * elf-m10200.c (mn10200_elf_relocate_section): Update arguments to RELOC_AGAINST_DISCARDED_SECTION. * elf-m10300.c (mn10300_elf_relocate_section): Likewise. * elf32-arm.c (elf32_arm_relocate_section): Likewise. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-bfin.c (bfin_relocate_section): Likewise. (bfinfdpic_relocate_section): Likewise. * elf32-cr16.c (elf32_cr16_relocate_section): Likewise. * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-crx.c (elf32_crx_relocate_section): Likewise. * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. * elf32-epiphany.c (epiphany_elf_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-i386.c (elf_i386_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. * elf32-lm32.c (lm32_elf_relocate_section): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-mep.c (mep_elf_relocate_section): Likewise. * elf32-moxie.c (moxie_elf_relocate_section): Likewise. * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-mt.c (mt_elf_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. * elf32-rx.c (rx_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-spu.c (spu_elf_relocate_section): Likewise. * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise. * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. (elf64_alpha_relocate_section): Likewise. * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. * elf64-mmix.c (mmix_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2012-05-07 05:27:52 +02:00
rel, 1, relend, howto, 0, contents);
Add output_type to bfd_link_info The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18 14:51:03 +02:00
if (bfd_link_relocatable (info))
continue;
r = elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
input_section, contents,
relocation, info, sym_sec,
eh);
if (r != bfd_reloc_ok)
{
switch (r)
{
default:
abort ();
case bfd_reloc_overflow:
{
const char *sym_name;
if (eh != NULL)
sym_name = NULL;
else
{
sym_name = bfd_elf_string_from_elf_section (input_bfd,
symtab_hdr->sh_link,
sym->st_name);
if (sym_name == NULL)
return FALSE;
if (*sym_name == '\0')
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
sym_name = bfd_section_name (sym_sec);
}
Return void from linker callbacks The ldmain.c implementation of these linker callback functions always return true, so any code handling a false return is dead. What's more, some of the bfd backends abort if ever a false return is seen, and there seems to be some confusion in gdb's compile-object-load.c. The return value was never meant to be "oh yes, a multiple_definition error occurred", but rather "out of memory or other catastrophic failure". This patch removes the status return on the callbacks that always return true. I kept the return status for "notice" because that one does happen to need to return "out of memory". include/ * bfdlink.h (struct bfd_link_callbacks): Update comments. Return void from multiple_definition, multiple_common, add_to_set, constructor, warning, undefined_symbol, reloc_overflow, reloc_dangerous and unattached_reloc. bfd/ * aoutx.h: Adjust linker callback calls throughout file, removing dead code. * bout.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-h8300.c: Likewise. * coff-h8500.c: Likewise. * coff-i960.c: Likewise. * coff-mcore.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic80.c: Likewise. * coff-w65.c: Likewise. * coff-z80.c: Likewise. * coff-z8k.c: Likewise. * coff64-rs6000.c: Likewise. * cofflink.c: Likewise. * ecoff.c: Likewise. * elf-bfd.h: Likewise. * elf-m10200.c: Likewise. * elf-m10300.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-ft32.c: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * linker.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * reloc.c: Likewise. * reloc16.c: Likewise. * simple.c: Likewise. * vms-alpha.c: Likewise. * xcofflink.c: Likewise. * elf32-rl78.c (get_symbol_value, get_romstart, get_ramstart): Delete status param. Adjust calls to these and linker callbacks throughout. * elf32-rx.c: (get_symbol_value, get_gp, get_romstart, get_ramstart): Delete status param. Adjust calls to these and linker callbacks throughout. ld/ * ldmain.c (multiple_definition, multiple_common, add_to_set, constructor_callback, warning_callback, undefined_symbol, reloc_overflow, reloc_dangerous, unattached_reloc): Return void. * emultempl/elf32.em: Adjust callback calls. gdb/ * compile/compile-object-load.c (link_callbacks_multiple_definition, link_callbacks_warning, link_callbacks_undefined_symbol, link_callbacks_undefined_symbol, link_callbacks_reloc_overflow, link_callbacks_reloc_dangerous, link_callbacks_unattached_reloc): Return void.
2016-05-27 09:50:55 +02:00
(*info->callbacks->reloc_overflow)
(info, (eh ? &eh->root : NULL), sym_name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset);
}
break;
}
}
}
return TRUE;
}
static const struct bfd_elf_special_section elf64_hppa_special_sections[] =
bfd/ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (bfd_elf_special_section): New. (elf_backend_data): Add special_sections, a pointer to bfd_elf_special_section. (elf_section_type). New. (elf_section_flags): New. (_bfd_elf_get_sec_type_attr): New. * elf.c (_bfd_elf_make_section_from_shdr): Always use the real section type/flags. (special_sections): New. (get_special_section): New. (_bfd_elf_get_sec_type_attr): New. (_bfd_elf_new_section_hook): Check special_section to set elf_section_type and elf_section_flags. (elf_fake_sections): Don't use section name to set ELF section data. * elf32-m32r.c (m32r_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-m68hc11.c (elf32_m68hc11_special_sections): New. (elf_backend_special_sections): Defined. * elf32-mcore.c (mcore_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-ppc.c (ppc_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-sh64.c (sh64_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-v850.c (v850_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-xtensa.c (elf_xtensa_special_sections): New. (elf_backend_special_sections): Defined. * elf64-alpha.c (elf64_alpha_special_sections): New. (elf_backend_special_sections): Defined. * elf64-hppa.c (elf64_hppa_special_sections): New. (elf_backend_special_sections): Defined. * elf64-ppc.c (ppc64_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf64-sh64.c (sh64_elf64_special_sections): New. (elf_backend_special_sections): Defined. * elfxx-ia64.c (elfNN_ia64_special_sections): New. (elf_backend_special_sections): Defined. * elfxx-mips.c (_bfd_mips_elf_special_sections): New. * elfxx-mips.h (_bfd_mips_elf_special_sections): New. (elf_backend_special_sections): Defined. * elfxx-target.h (elf_backend_special_sections): New. Default to NULL. (elfNN_bed): Initialize special_sections. * section.c (bfd_abs_section): Remove const. (bfd_und_section): Likewise. (bfd_com_section): Likewise. (bfd_ind_section): Likewise. gas/ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> * config/obj-elf.c (special_sections): Removed. (obj_elf_change_section): Call _bfd_elf_get_sec_type_attr. Set elf_section_type and elf_section_flags. (elf_frob_file): Set SHT_GROUP. * config/obj-elf.h (obj_sec_set_private_data): New. * config/tc-alpha.h (ELF_TC_SPECIAL_SECTIONS): Removed. * config/tc-ia64.h: Likewise. * config/tc-m32r.h: Likewise. * config/tc-m68hc11.h: Likewise. * config/tc-mcore.h: Likewise. * config/tc-mips.h: Likewise. * config/tc-ppc.h: Likewise. * config/tc-sh64.h: Likewise. * config/tc-v850.h: Likewise. * config/tc-xtensa.h: Likewise. * config/tc-v850.h (SHF_V850_GPREL): Removed. (SHF_V850_EPREL): Likewise. (SHF_V850_R0REL): Likewise. * subsegs.c (subseg_get): Call obj_sec_set_private_data if it is defined. include/elf/ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> * v850.h (SHF_V850_GPREL): New. (SHF_V850_EPREL): Likewise. (SHF_V850_R0REL): Likewise.
2003-07-25 16:35:56 +02:00
{
SHF_GNU_MBIND requires ELFOSABI_GNU When SHF_GNU_MBIND was added in the SHF_LOOS to SHF_HIOS range, it should have required ELFOSABI_GNU since these flags are already in use by other OSes. HPUX SHF_HP_TLS in fact has the same value. That means no place in binutils should test SHF_GNU_MBIND without first checking OSABI, and SHF_GNU_MBIND should not be set without also setting OSABI. At least, that's the ideal, but the patch accepts SHF_GNU_MBIND on ELFOSABI_NONE object files since gas didn't always set OSABI. However, to reinforce the fact that SHF_GNU_MBIND isn't proper without a non-zero OSABI, readelf will display the flag as LOOS+0 if OSABI isn't set. The clash with SHF_HP_TLS means that hppa64-linux either has that flag on .tbss sections or supports GNU_MBIND, not both. (hppa64-linux users, if there are any, may have noticed that GNU ld since 2017 mysteriously aligned their .tbss sections to a 4k boundary. That was one consequence of SHF_HP_TLS being blindly interpreted as SHF_GNU_MBIND.) Since it seems that binutils, gdb, gcc, glibc, and the linux kernel don't care about SHF_HP_TLS I took that flag out of .tbss for hppa64-linux. bfd/ * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind. * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind. (get_program_header_size): Formatting. Only test SH_GNU_MBIND when elf_gnu_osabi_mbind is set. (_bfd_elf_map_sections_to_segments): Likewise. (_bfd_elf_init_private_section_data): Likewise. (_bfd_elf_final_write_processing): Update comment. * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry. (elf_backend_special_sections): Define without .tbss for linux. binutils/ * readelf.c (get_parisc_segment_type): Split off hpux entries.. (get_ia64_segment_type): ..and these.. (get_hpux_segment_type): ..to here. (get_segment_type): Condition GNU_MBIND on osabi. Use get_hpux_segment_type. (get_symbol_binding): Do not print UNIQUE for ELFOSABI_NONE. (get_symbol_type): Do not print IFUNC for ELFOSABI_NONE. gas/ * config/obj-elf.c (obj_elf_change_section): Don't emit a fatal error for non-SHF_ALLOC SHF_GNU_MBIND here. (obj_elf_parse_section_letters): Return SHF_GNU_MBIND in new gnu_attr param. (obj_elf_section): Adjust obj_elf_parse_section_letters call. Formatting. Set SHF_GNU_MBIND and elf_osabi from gnu_attr. Emit normal error for non-SHF_ALLOC SHF_GNU_MBIND and wrong osabi. (obj_elf_type): Set elf_osabi for ifunc. * testsuite/gas/elf/section12a.d: xfail msp430 and hpux. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section13.d: Likewise. * testsuite/gas/elf/section13.l: Adjust expected error. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Condition SHF_GNU_MBIND on osabi. Set output elf_gnu_osabi_mbind.
2019-07-23 10:24:42 +02:00
{ STRING_COMMA_LEN (".tbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS },
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
{ STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ STRING_COMMA_LEN (".dlt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ STRING_COMMA_LEN (".sdata"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
{ STRING_COMMA_LEN (".sbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ NULL, 0, 0, 0, 0 }
bfd/ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (bfd_elf_special_section): New. (elf_backend_data): Add special_sections, a pointer to bfd_elf_special_section. (elf_section_type). New. (elf_section_flags): New. (_bfd_elf_get_sec_type_attr): New. * elf.c (_bfd_elf_make_section_from_shdr): Always use the real section type/flags. (special_sections): New. (get_special_section): New. (_bfd_elf_get_sec_type_attr): New. (_bfd_elf_new_section_hook): Check special_section to set elf_section_type and elf_section_flags. (elf_fake_sections): Don't use section name to set ELF section data. * elf32-m32r.c (m32r_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-m68hc11.c (elf32_m68hc11_special_sections): New. (elf_backend_special_sections): Defined. * elf32-mcore.c (mcore_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-ppc.c (ppc_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-sh64.c (sh64_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-v850.c (v850_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf32-xtensa.c (elf_xtensa_special_sections): New. (elf_backend_special_sections): Defined. * elf64-alpha.c (elf64_alpha_special_sections): New. (elf_backend_special_sections): Defined. * elf64-hppa.c (elf64_hppa_special_sections): New. (elf_backend_special_sections): Defined. * elf64-ppc.c (ppc64_elf_special_sections): New. (elf_backend_special_sections): Defined. * elf64-sh64.c (sh64_elf64_special_sections): New. (elf_backend_special_sections): Defined. * elfxx-ia64.c (elfNN_ia64_special_sections): New. (elf_backend_special_sections): Defined. * elfxx-mips.c (_bfd_mips_elf_special_sections): New. * elfxx-mips.h (_bfd_mips_elf_special_sections): New. (elf_backend_special_sections): Defined. * elfxx-target.h (elf_backend_special_sections): New. Default to NULL. (elfNN_bed): Initialize special_sections. * section.c (bfd_abs_section): Remove const. (bfd_und_section): Likewise. (bfd_com_section): Likewise. (bfd_ind_section): Likewise. gas/ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> * config/obj-elf.c (special_sections): Removed. (obj_elf_change_section): Call _bfd_elf_get_sec_type_attr. Set elf_section_type and elf_section_flags. (elf_frob_file): Set SHT_GROUP. * config/obj-elf.h (obj_sec_set_private_data): New. * config/tc-alpha.h (ELF_TC_SPECIAL_SECTIONS): Removed. * config/tc-ia64.h: Likewise. * config/tc-m32r.h: Likewise. * config/tc-m68hc11.h: Likewise. * config/tc-mcore.h: Likewise. * config/tc-mips.h: Likewise. * config/tc-ppc.h: Likewise. * config/tc-sh64.h: Likewise. * config/tc-v850.h: Likewise. * config/tc-xtensa.h: Likewise. * config/tc-v850.h (SHF_V850_GPREL): Removed. (SHF_V850_EPREL): Likewise. (SHF_V850_R0REL): Likewise. * subsegs.c (subseg_get): Call obj_sec_set_private_data if it is defined. include/elf/ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> * v850.h (SHF_V850_GPREL): New. (SHF_V850_EPREL): Likewise. (SHF_V850_R0REL): Likewise.
2003-07-25 16:35:56 +02:00
};
/* The hash bucket size is the standard one, namely 4. */
const struct elf_size_info hppa64_elf_size_info =
{
sizeof (Elf64_External_Ehdr),
sizeof (Elf64_External_Phdr),
sizeof (Elf64_External_Shdr),
sizeof (Elf64_External_Rel),
sizeof (Elf64_External_Rela),
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
4,
1,
* elflink.c (_bfd_elf_link_create_dynamic_sections): Move from elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. (bfd_elf_record_link_assignment): Move from elflink.h. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_add_default_symbol): Likewise. (_bfd_elf_export_symbol): Likewise. (_bfd_elf_link_find_version_dependencies): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel and bed->s->sizeof_rela. (_bfd_elf_link_output_relocs): Likewise. * elf-bfd.h (struct elf_size_info): Rename file_align to log_file_align. (struct elf_info_failed): Move from elflink.h. (struct elf_assign_sym_version_info): Likewise. (struct elf_find_verdep_info): Likewise. (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms): Declare. (bfd_elf32_link_create_dynamic_sections): Don't declare. (_bfd_elf32_link_read_relocs): Likewise. (bfd_elf64_link_create_dynamic_sections): Likewise. (_bfd_elf64_link_read_relocs): Likewise. * elflink.h: Move lots o' stuff elsewhere. * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. (bfd_elf64_record_link_assignment): Likewise. (bfd_elf_record_link_assignment): Declare. * bfd-in2.h: Regenerate. * elfcode.h (elf_link_create_dynamic_sections): Don't declare. (NAME(_bfd_elf,size_info)): Adjust for log_file_align. * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. (assign_file_positions_for_segments): Likewise. (assign_file_positions_except_relocs): Likewise. (swap_out_syms, elfcore_write_note): Likewise. * elf-m10200.c: Adjust for changed function names. * elf-m10300.c: Likewise. * elf32-arm.h: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-mips.c (mips_elf64_size_info): Likewise. * elf64-s390.c (s390_elf64_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2003-05-09 04:27:11 +02:00
64, 3,
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
bfd_elf64_checksum_contents,
bfd_elf64_write_relocs,
* elf-bfd.h (struct elf_size_info): Add swap_symbol_in field. (bfd_elf32_swap_symbol_in): Update prototype. (bfd_elf64_swap_symbol_in): Likewise. * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *. (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. * elflink.h (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_object_symbols): Likewise. (elf_link_record_local_dynamic_symbol): Likewise. (elf_link_input_bfd): Likewise. (elf_gc_mark): Likewise. (elf_reloc_symbol_deleted_p): Likewise. * elf-m10200.c (mn10200_elf_relax_section): Likewise. (mn10200_elf_relax_delete_bytes): Likewise. (mn10200_elf_symbol_address_p): Likewise. (mn10200_elf_get_relocated_section_contents): Likewise. * elf-m10300.c (mn10300_elf_relax_section): Likewise. (mn10300_elf_relax_section): Likewise. (mn10300_elf_relax_delete_bytes): Likewise. (mn10300_elf_symbol_address_p): Likewise. (mn10300_elf_get_relocated_section_contents): Likewise. * elf32-h8300.c (elf32_h8_relax_section): Likewise. (elf32_h8_relax_delete_bytes): Likewise. (elf32_h8_symbol_address_p): Likewise. (elf32_h8_get_relocated_section_contents): Likewise. * elf32-hppa.c (get_local_syms): Likewise. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. * elf32-sh.c (sh_elf_relax_section): Likewise. (sh_elf_relax_delete_bytes): Likewise. (sh_elf_get_relocated_section_contents): Likewise. * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. * elf64-alpha.c (elf64_alpha_relax_section): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elf64-ppc.c (get_local_syms): Likewise. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser. * elf64-alpha.c (alpha_elf_size_info): Likewise. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-mips.c (mips_elf64_size_info): Likewise. * elf64-s390.c (s390_elf64_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-06-05 15:32:02 +02:00
bfd_elf64_swap_symbol_in,
bfd_elf64_swap_symbol_out,
bfd_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
bfd_elf64_swap_dyn_in,
bfd_elf64_swap_dyn_out,
include/elf/ChangeLog * internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 12:55:43 +01:00
bfd_elf64_swap_reloc_in,
bfd_elf64_swap_reloc_out,
bfd_elf64_swap_reloca_in,
bfd_elf64_swap_reloca_out
};
bfd target vector rationalisation This renames the bfd targets to <cpu>_<format>_<other>_<endian>_vec. So for example, bfd_elf32_ntradlittlemips_vec becomes mips_elf32_ntrad_le_vec and hp300bsd_vec becomes m68k_aout_hp300bsd_vec. bfd/ * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-ns32k.c, * aout-sparcle.c, * aout0.c, * aoutx.h, * armnetbsd.c, * bout.c, * cf-i386lynx.c, * cf-sparclynx.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-aux.c, * coff-go32.c, * coff-h8300.c, * coff-h8500.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c, * coff-sparc.c, * coff-stgo32.c, * coff-svm68k.c, * coff-tic80.c, * coff-u68k.c, * coff-w65.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * config.bfd, * configure.com, * configure.in, * demo64.c, * elf-m10200.c, * elf-m10300.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-gen.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * epoc-pe-arm.c, * epoc-pei-arm.c, * hp300bsd.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386bsd.c, * i386dynix.c, * i386freebsd.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * i386os9k.c, * irix-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * m88kopenbsd.c, * mach-o-i386.c, * mach-o-x86-64.c, * makefile.vms, * mipsbsd.c, * mmo.c, * netbsd-core.c, * newsos3.c, * nlm32-alpha.c, * nlm32-i386.c, * nlm32-ppc.c, * nlm32-sparc.c, * ns32knetbsd.c, * osf-core.c, * pc532-mach.c, * pe-arm-wince.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-ppc.c, * pe-sh.c, * pe-x86_64.c, * pei-arm-wince.c, * pei-arm.c, * pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-mips.c, * pei-ppc.c, * pei-sh.c, * pei-x86_64.c, * ppcboot.c, * ptrace-core.c, * riscix.c, * sco5-core.c, * som.c, * sparclinux.c, * sparclynx.c, * sparcnetbsd.c, * sunos.c, * targets.c, * trad-core.c, * vax1knetbsd.c, * vaxbsd.c, * vaxnetbsd.c, * versados.c, * vms-alpha.c, * vms-lib.c: Rename bfd targets to <cpu>_<format>_<other>_<endian>_vec. Adjust associated MY macros on aout targets. * configure: Regenerate. binutils/ * emul_aix.c: Update bfd target vector naming. * testsuite/binutils-all/objcopy.exp: Likewise. ld/ * emultempl/metagelf.em: Update bfd target vector naming. * emultempl/nios2elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise.
2014-05-02 12:39:40 +02:00
#define TARGET_BIG_SYM hppa_elf64_vec
#define TARGET_BIG_NAME "elf64-hppa"
#define ELF_ARCH bfd_arch_hppa
Add target_id to elf_backend_data. 2010-08-25 H.J. Lu <hongjiu.lu@intel.com> PR ld/11944 * elf-bfd.h (elf_backend_data): Add target_id. (bfd_elf_make_generic_object): Renamed to ... (bfd_elf_make_object): This. * elf.c (bfd_elf_make_generic_object): Removed. (bfd_elf_make_object): New. (bfd_elf_mkcorefile): Really treat it as an object file. * elf-m10300.c (ELF_TARGET_ID): New. * elf32-arm.c (ELF_TARGET_ID): Likewise. * elf32-bfin.c (ELF_TARGET_ID): Likewise. * elf32-cris.c (ELF_TARGET_ID): Likewise. * elf32-frv.c (ELF_TARGET_ID): Likewise. * elf32-i386.c (ELF_TARGET_ID): Likewise. * elf32-lm32.c (ELF_TARGET_ID): Likewise. * elf32-m32r.c (ELF_TARGET_ID): Likewise. * elf32-m68hc11.c (ELF_TARGET_ID): Likewise. * elf32-m68hc12.c (ELF_TARGET_ID): Likewise. * elf32-m68k.c (ELF_TARGET_ID): Likewise. * elf32-microblaze.c (ELF_TARGET_ID): Likewise. * elf32-ppc.c (ELF_TARGET_ID): Likewise. * elf32-s390.c (ELF_TARGET_ID): Likewise. * elf32-sh.c (ELF_TARGET_ID): Likewise. * elf32-sparc.c (ELF_TARGET_ID): Likewise. * elf32-spu.c (ELF_TARGET_ID): Likewise. * elf32-tic6x.c (ELF_TARGET_ID): Likewise. * elf32-xtensa.c (ELF_TARGET_ID): Likewise. * elf64-alpha.c (ELF_TARGET_ID): Likewise. * elf64-hppa.c (ELF_TARGET_ID): Likewise. * elf64-ppc.c (ELF_TARGET_ID): Likewise. * elf64-s390.c (ELF_TARGET_ID): Likewise. * elf64-x86-64.c (ELF_TARGET_ID): Likewise. * elfxx-ia64.c (ELF_TARGET_ID): Likewise. * elf32-hppa.c (elf32_hppa_mkobject): Removed. (bfd_elf32_mkobject): Likewise. (ELF_TARGET_ID): New. * elf32-mips.c (ELF_TARGET_ID): New. (bfd_elf32_mkobject): Removed. * elf64-mips.c (ELF_TARGET_ID): New. (bfd_elf64_mkobject): Removed. * elfn32-mips.c (ELF_TARGET_ID): New. (bfd_elf32_mkobject): Removed. * elfxx-mips.c (_bfd_mips_elf_mkobject): Removed. * elfxx-mips.h (_bfd_mips_elf_mkobject): Likewise. * elfxx-target.h (bfd_elfNN_mkobject): Default to bfd_elf_make_object. (ELF_TARGET_ID): New. Default to GENERIC_ELF_DATA. (elfNN_bed): Initialize target_id.
2010-08-25 16:53:45 +02:00
#define ELF_TARGET_ID HPPA64_ELF_DATA
#define ELF_MACHINE_CODE EM_PARISC
/* This is not strictly correct. The maximum page size for PA2.0 is
64M. But everything still uses 4k. */
#define ELF_MAXPAGESIZE 0x1000
2007-03-13 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3826 * elf-bfd.h (elf_backend_data): Add elf_osabi. (_bfd_elf_set_osabi): New. * elf.c (_bfd_elf_set_osabi): New. * elf32-hppa.c (elf32_hppa_post_process_headers): Removed. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. (ELF_OSABI): Properly defined for each target. * elf32-i370.c (i370_elf_post_process_headers): Removed. (ELF_OSABI): Defined. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi. * elf32-msp430.c (elf32_msp430_post_process_headers): Removed. (ELF_OSABI): Defined. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with elf_osabi. * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI with elf_osabi. (ELF_OSABI): Properly defined for each target. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi for Linux. * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed. (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed. (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target with any ELF target of the compatible machine for which we do not have a specific backend. * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI with elf_osabi. * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE. (elfNN_bed): Initialize elf_osabi with ELF_OSABI.
2007-03-14 03:56:45 +01:00
#define ELF_OSABI ELFOSABI_HPUX
#define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup
* aout-adobe.c (aout_32_bfd_reloc_name_lookup): Define. * aout-arm.c (MY_bfd_reloc_name_lookup): Define. (MY (bfd_reloc_name_lookup)): New function. * aout-ns32k.c (MY (bfd_reloc_name_lookup)): New function. * aout-target.h (NAME (aout, reloc_name_lookup)): Declare. (MY_bfd_reloc_name_lookup): Define. * aout-tic30.c (tic30_aout_reloc_name_lookup): New function. (MY_bfd_reloc_name_lookup): Define. * aoutx.h (NAME (aout, reloc_type_lookup)): Don't declare. (NAME (aout, reloc_name_lookup)): New function. * bout.c (b_out_bfd_reloc_name_lookup): New function. * coff-alpha.c (alpha_bfd_reloc_name_lookup): New function. (_bfd_ecoff_bfd_reloc_name_lookup): Define. * coff-arm.c (coff_arm_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-i386.c (coff_bfd_reloc_name_lookup): Define. (coff_i386_reloc_name_lookup): New function. * coff-i860.c (coff_i860_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-i960.c (coff_i960_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-m68k.c (m68k_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-maxq.c (maxq_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-mcore.c (mcore_coff_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-mips.c (mips_bfd_reloc_name_lookup): New function. (_bfd_ecoff_bfd_reloc_name_lookup): Define. * coff-ppc.c (ppc_coff_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-rs6000.c (coff_bfd_reloc_name_lookup): Define. (_bfd_xcoff_reloc_name_lookup): New function. (rs6000coff_vec, pmac_xcoff_vec): Init new field. * coff-sh.c (coff_bfd_reloc_name_lookup): Define. (sh_coff_reloc_name_lookup): New function. * coff-sparc.c (coff_sparc_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-tic30.c (coff_bfd_reloc_name_lookup): Define. (tic30_coff_reloc_name_lookup): New function. * coff-tic4x.c (coff_bfd_reloc_name_lookup): Define. (tic4x_coff_reloc_name_lookup): New function. * coff-tic54x.c (coff_bfd_reloc_name_lookup): Define. (tic54x_coff_reloc_name_lookup): New function. * coff-x86_64.c (coff_bfd_reloc_name_lookup): Define. (coff_amd64_reloc_name_lookup): New function. * coff-z80.c (coff_z80_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff-z8k.c (coff_z8k_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * coff64-rs6000.c (coff_bfd_reloc_name_lookup): Define. (xcoff64_reloc_name_lookup): New function. (rs6000coff64_vec, aix5coff64_vec): Init new field. * coffcode.h (coff_bfd_reloc_name_lookup): Define. * elf-hppa.h (elf_hppa_reloc_name_lookup): New function. * elf-m10200.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf-m10300.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-arc.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-arm.c (elf32_arm_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-avr.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-bfin.c (bfin_bfd_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-cr16c.c (elf_cr16c_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-cris.c (cris_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-crx.c (elf_crx_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-d10v.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-d30v.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-dlx.c (elf32_dlx_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-fr30.c (fr30_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-frv.c (frv_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-gen.c (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-h8300.c (elf32_h8_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-hppa.c (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-i370.c (i370_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-i386.c (elf_i386_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-i860.c (elf32_i860_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-i960.c (elf32_i960_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-ip2k.c (ip2k_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-iq2000.c (iq2000_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-m32c.c (m32c_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-m32r.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-m68hc11.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-m68hc12.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-m68k.c (reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-m88k.c (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-mcore.c (mcore_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-mep.c (mep_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. (mips_vxworks_bfd_reloc_name_lookup): Likewise. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-msp430.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-mt.c (mt_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-openrisc.c (openrisc_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-or32.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elf32-pj.c (pj_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-ppc.c (ppc_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-s390.c (elf_s390_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-score.c (elf32_score_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-sh.c (sh_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-sparc.c (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-spu.c (spu_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-v850.c (v850_elf_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-vax.c (reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-xc16x.c (xc16x_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-xstormy16.c (xstormy16_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf32-xtensa.c (elf_xtensa_reloc_name_lookup): New function. (bfd_elf32_bfd_reloc_name_lookup): Define. * elf64-alpha.c (elf64_alpha_bfd_reloc_name_lookup): New function. (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-gen.c (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-hppa.c (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-mips.c (bfd_elf64_bfd_reloc_name_lookup): New function. * elf64-mmix.c (bfd_elf64_bfd_reloc_name_lookup): New function. * elf64-ppc.c (ppc64_elf_reloc_name_lookup): New function. (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-s390.c (elf_s390_reloc_name_lookup): New function. (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-sh64.c (sh_elf64_reloc_name_lookup): New function. (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-sparc.c (bfd_elf64_bfd_reloc_name_lookup): Define. * elf64-x86-64.c (elf64_x86_64_reloc_name_lookup): New function. (bfd_elf64_bfd_reloc_name_lookup): Define. * elfn32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. * elfxx-ia64.c (elfNN_ia64_reloc_name_lookup): New function. (bfd_elfNN_bfd_reloc_name_lookup): Define. * elfxx-sparc.c (_bfd_sparc_elf_reloc_name_lookup): New function. * elfxx-sparc.h (_bfd_sparc_elf_reloc_name_lookup): Declare. * i386msdos.c (msdos_bfd_reloc_name_lookup): Define. * i386os9k.c (aout_32_bfd_reloc_name_lookup): Define. * ieee.c (ieee_bfd_reloc_name_lookup): Define. * libaout.h (NAME (aout, reloc_name_lookup)): Declare. * libbfd-in.h (_bfd_norelocs_bfd_reloc_name_lookup): Declare. * mipsbsd.c (MY_bfd_reloc_name_lookup): Define. (MY(reloc_type_lookup)): Rename from MY(reloc_howto_type_lookup). (MY(reloc_name_lookup)): New function. * nlm-target.h (nlm_bfd_reloc_name_lookup): Define. * oasys.c (oasys_bfd_reloc_name_lookup): Define. * pdp11.c (NAME (aout, reloc_name_lookup)): New function. * pe-mips.c (coff_mips_reloc_name_lookup): New function. (coff_bfd_reloc_name_lookup): Define. * reloc.c (bfd_reloc_name_lookup): New function. * riscix.c (riscix_reloc_name_lookup): New function. (MY_bfd_reloc_name_lookup): Define. * som.c (som_bfd_reloc_name_lookup): New function. * targets.c (struct bfd_target): Add reloc_name_lookup. (BFD_JUMP_TABLE_RELOCS): Add NAME##_bfd_reloc_name_lookup. * versados.c (versados_bfd_reloc_name_lookup): Define. * vms.c (vms_bfd_reloc_name_lookup): New function. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate.
2007-03-26 14:23:03 +02:00
#define bfd_elf64_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup
#define bfd_elf64_bfd_is_local_label_name elf_hppa_is_local_label_name
#define elf_info_to_howto elf_hppa_info_to_howto
#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel
#define elf_backend_section_from_shdr elf64_hppa_section_from_shdr
#define elf_backend_object_p elf64_hppa_object_p
#define elf_backend_final_write_processing \
elf_hppa_final_write_processing
#define elf_backend_fake_sections elf_hppa_fake_sections
#define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook
* elf-hppa.h (elf_hppa_relocate_section): If relocatable, return immediately. Remove code handling relocatable linking. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-fr30.c (elf32_frv_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf32-avr.c (elf_backend_rela_normal): Define. * elf32-cris.c: Likewise. * elf32-fr30.c: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-sparc.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf64-hppa.c: Likewise. * elf64-sparc.c: Likewise. * elf32-fr30.c (elf32_frv_relocate_section): Edit comment. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf-m10200.c (USE_RELA): Don't define. * elf-m10300.c: Likewise. * elf32-i370.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-vax.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise. * elf32-avr.c (USE_REL): Don't undef. * elf32-ip2k.c: Likewise.
2002-07-23 14:29:33 +02:00
#define elf_backend_relocate_section elf_hppa_relocate_section
#define bfd_elf64_bfd_final_link elf_hppa_final_link
#define elf_backend_create_dynamic_sections \
elf64_hppa_create_dynamic_sections
elf_backend_init_file_header This patch renames elf_backend_post_process_headers and moves the prep_headers code into the new function. Naming the backend functions elf_backend_init_file_header and elf_backend_modify_headers makes it clear which function is called first. * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): Rename from elf_backend_post_process_headers. (_bfd_elf_post_process_headers): Delete. (_bfd_elf_init_file_header): Declare. * elf.c (_bfd_elf_compute_section_file_positions): Call new function in place of prep_headers and elf_backend_post_process_headers. (_bfd_elf_init_file_header): Renamed from prep_headers with updated args and made global. Delete dead code. (_bfd_elf_post_process_headers): Delete. * elf32-arm.c (elf32_arm_init_file_header): Rename from elf32_arm_post_process_headers and call _bfd_elf_init_file_header. Return status. (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. * elf32-metag.c (elf_metag_init_file_header): Similarly. * elf32-spu.c (spu_elf_init_file_header * elf32-visium.c (visium_elf_init_file_header * elf64-alpha.c (elf64_alpha_fbsd_init_file_header * elf64-hppa.c (elf64_hppa_init_file_header * elf64-ia64-vms.c (elf64_vms_init_file_header * elfnn-aarch64.c (elfNN_aarch64_init_file_header * elfnn-ia64.c (elfNN_hpux_init_file_header * elfxx-mips.c (_bfd_mips_init_file_header * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. (_bfd_mips_init_file_header): Declare. (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define. * elfxx-target.h (elf_backend_post_process_headers): Delete. (elf_backend_init_file_header): Define and use. * elf32-m68hc12.c (elf_backend_init_file_header): Define. (elf_backend_post_process_headers): Don't define. * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. (elf32_m68hc11_init_file_header): Declare. * elf32-ppc.c (elf_backend_post_process_headers): Remove unnecessary undef.
2019-11-18 07:39:40 +01:00
#define elf_backend_init_file_header elf64_hppa_init_file_header
Remove bfd stub function casts. This patch defines a bunch of new functions to use in the BFD target structs rather than casting bfd_false or bfd_true and similar stub functions. I've also renamed the stub functions to reflect their parameters and put "error" in the name if they set bfd_error. The latter change is important since there were quite a few uses of bfd_false where setting bfd_error was inappropriate, for example in elf_backend_allow_non_load_phdr and is_target_special_symbol. * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. (_bfd_bool_bfd_true): Rename from bfd_true. (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. (_bfd_int_bfd_0): Rename from bfd_0. (_bfd_uint_bfd_0): Rename from bfd_0u. (_bfd_long_bfd_0): Rename from bfd_0l. (_bfd_long_bfd_n1_error): Rename from _bfd_n1. (_bfd_void_bfd): Rename from bfd_void. (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), (_bfd_bool_bfd_link_false_error), (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), (_bfd_bool_bfd_asection_bfd_asection_true), (_bfd_bool_bfd_asymbol_bfd_asymbol_true), (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. * archive.c (_bfd_noarchive_get_elt_at_index), (_bfd_noarchive_openr_next_archived_file), (_bfd_noarchive_construct_extended_name_table), (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), (_bfd_noarchive_write_armap): New functions. * archures.c (_bfd_nowrite_set_arch_mach): New function. * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), (alpha_ecoff_swap_coff_lineno_out), (alpha_ecoff_swap_coff_reloc_out): New functions. * coff-mips.c (mips_ecoff_swap_coff_aux_in), (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), (mips_ecoff_swap_coff_lineno_out), (mips_ecoff_swap_coff_reloc_out): New functions. * coffcode.h (coff_set_alignment_hook): Replace define with new function. (symname_in_debug_hook): Likewise. * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. * elf.c (assign_file_positions_except_relocs): Test elf_backend_allow_non_load_phdr for NULL. * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from _bfd_elf_link_omit_section_dynsym. Update uses. (_bfd_elf_omit_section_dynsym_all): New function. * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. (_bfd_elf_omit_section_dynsym_default): Declare. (_bfd_elf_omit_section_dynsym_all): Declare. * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), (_bfd_nolink_bfd_get_relocated_section_contents), (_bfd_nolink_bfd_lookup_section_flags), (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), (_bfd_nolink_bfd_link_hash_table_create), (_bfd_nolink_bfd_link_just_syms), (_bfd_nolink_bfd_copy_link_hash_symbol_type), (_bfd_nolink_bfd_link_split_section), (_bfd_nolink_section_already_linked), (_bfd_nolink_bfd_define_common_symbol), (_bfd_nolink_bfd_define_start_stop): New functions. * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), (_bfd_norelocs_bfd_reloc_name_lookup), (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. * section.c (_bfd_nowrite_set_section_contents): New function. * syms.c (_bfd_nosymbols_canonicalize_symtab), (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), (_bfd_nosymbols_get_symbol_version_string), (_bfd_nosymbols_bfd_is_local_label_name), (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), (_bfd_nosymbols_bfd_make_debug_symbol), ( _bfd_nosymbols_read_minisymbols), ( _bfd_nosymbols_minisymbol_to_symbol), (_bfd_nodynamic_get_synthetic_symtab): New functions. * libbfd-in.h: Declare new functions. Update existing defines, removing casts. * aix386-core.c: Update to use new hooks. Formatting. * aout-adobe.c: Likewise. * aout-arm.c: Likewise. * aout-target.h: Likewise. * aout-tic30.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * bout.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-i860.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-x86_64.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * elf-m10300.c: Likewise. * elf32-cr16.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32r.c: Likewise. * elf32-metag.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-target.h: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.h: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * libaout.h: Likewise. * libecoff.h: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mipsbsd.c: Likewise. * mmo.c: Likewise. * netbsd-core.c: Likewise. * nlm-target.h: Likewise. * oasys.c: Likewise. * osf-core.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * pe-x86_64.c: Likewise. * pef.c: Likewise. * plugin.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * sco5-core.c: Likewise. * som.c: Likewise. * sparclynx.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * trad-core.c: Likewise. * verilog.c: Likewise. * versados.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_adjust_dynamic_symbol \
elf64_hppa_adjust_dynamic_symbol
#define elf_backend_size_dynamic_sections \
elf64_hppa_size_dynamic_sections
#define elf_backend_finish_dynamic_symbol \
elf64_hppa_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
elf64_hppa_finish_dynamic_sections
#define elf_backend_grok_prstatus elf64_hppa_grok_prstatus
#define elf_backend_grok_psinfo elf64_hppa_grok_psinfo
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
/* Stuff for the BFD linker: */
#define bfd_elf64_bfd_link_hash_table_create \
elf64_hppa_hash_table_create
#define elf_backend_check_relocs \
elf64_hppa_check_relocs
#define elf_backend_size_info \
hppa64_elf_size_info
#define elf_backend_additional_program_headers \
elf64_hppa_additional_program_headers
#define elf_backend_modify_segment_map \
elf64_hppa_modify_segment_map
Fix the linker so that it will not silently generate ELF binaries with invalid program headers. Fix readelf to report such invalid binaries. PR ld/20815 bfd * elf.c (elf_modify_segment_map): Allow empty LOAD segments if they contain the program headers. (_bfd_elf_map_sections_to_segments): If the linker created the PHDR segment then always attempt to include it in a LOAD segment. (assign_file_positions_for_non_load_sections): Allow LOAD segments to overlap PHDR segments. (phdr_sorter): New function. Sorts program headers. (assign_file_positions_except_relocs): Sort the program headers before writing them out. Issue an error if the PHDR segment is not covered by a LOAD segment, unless the backend allows it. * elf-bfd.h (struct elf_backend_data): Add elf_backend_allow_non_load_phdr. * elfxx-target.h (elf_backend_allow_non_load_phdr): Provide default definition that returns FALSE. (elfNN_bed): Initialise the elf_backend_allow_non_load_phdr field. * elf64-hppa.c (elf64_hppa_allow_non_load_phdr): New function. Returns TRUE. (elf_backend_allow_non_load_phdr): Define. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Do not place the interpreter string into the .interp section if the nointerp flag is set in the link info structure. * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise. * elf32-score7.c (score_elf_final_link_relocate): Allow for the _gp symbol not being part of the output. binutils* readelf.c (process_program_headers): Check PT_LOAD and PT_PHDR segments for validity. ld * ld.texinfo: Note that PT_TLS can be used as a segment type. * testsuite/ld-discard/discard.ld: Add space for program headers. * testsuite/ld-elf/flags1.ld: Likewise. * testsuite/ld-elf/maxpage3.t: Likewise. * testsuite/ld-elf/noload-1.t: Likewise. * testsuite/ld-elf/orphan.ld: Likewise. * testsuite/ld-elf/overlay.t: Likewise. * testsuite/ld-elf/pr14052.t: Likewise. * testsuite/ld-elf/pr19539.t: Likewise. * testsuite/ld-elf/provide-hidden-1.ld: Likewise. * testsuite/ld-elf/provide-hidden-s.ld: Likewise. * testsuite/ld-elf/weak-dyn-1.ld: Likewise. * testsuite/ld-i386/pr19539.t: Likewise. * testsuite/ld-scripts/defined.t: Likewise. * testsuite/ld-scripts/defined6.t: Likewise. * testsuite/ld-scripts/dynamic-sections.t: Likewise. * testsuite/ld-scripts/empty-aligned.t: Likewise. * testsuite/ld-scripts/provide-2.t: Likewise. * testsuite/ld-scripts/provide-4.t: Likewise. * testsuite/ld-vax-elf/plt-local.ld: Likewise. * testsuite/ld-x86-64/pr19539.t: Likewise. * testsuite/ld-elf/ehdr_start-missing.d: Do not initialise the dynamic linker. * testsuite/ld-elf/ehdr_start-weak.d: Likewise. * testsuite/ld-elf/elf.exp (pr14170, pr17068): Likewise. * testsuite/ld-elf/loadaddr1.d: Update expected readelf output. * testsuite/ld-elf/noload-2.d: Likewise. * testsuite/ld-powerpc/vxworks2.sd: Likewise. * testsuite/ld-scripts/phdrs3a.d: Likewise. * testsuite/ld-scripts/size-2.d: Likewise. * testsuite/ld-elf/group.ld: Add program headers. * testsuite/ld-elf/overlay.d: Skip for SPU. * testsuite/ld-elf/flags1.d: Skip for RX. * testsuite/ld-elf/pr19162.d: Skip for HPPA64. * testsuite/ld-elf/pr19539.d: Skip for ALPHA. * testsuite/ld-scripts/empty-orphan.t: Update program headers. * testsuite/ld-scripts/size-2.t: Likewise.
2016-11-23 12:10:39 +01:00
#define elf_backend_allow_non_load_phdr \
elf64_hppa_allow_non_load_phdr
#define elf_backend_link_output_symbol_hook \
elf64_hppa_link_output_symbol_hook
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0
#define elf_backend_want_plt_sym 0
#define elf_backend_got_header_size 0
#define elf_backend_type_change_ok TRUE
#define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type
#define elf_backend_reloc_type_class elf64_hppa_reloc_type_class
#define elf_backend_rela_normal 1
#define elf_backend_special_sections elf64_hppa_special_sections
#define elf_backend_action_discarded elf_hppa_action_discarded
#define elf_backend_section_from_phdr elf64_hppa_section_from_phdr
#define elf64_bed elf64_hppa_hpux_bed
#include "elf64-target.h"
2001-01-14 12:12:53 +01:00
#undef TARGET_BIG_SYM
bfd target vector rationalisation This renames the bfd targets to <cpu>_<format>_<other>_<endian>_vec. So for example, bfd_elf32_ntradlittlemips_vec becomes mips_elf32_ntrad_le_vec and hp300bsd_vec becomes m68k_aout_hp300bsd_vec. bfd/ * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-ns32k.c, * aout-sparcle.c, * aout0.c, * aoutx.h, * armnetbsd.c, * bout.c, * cf-i386lynx.c, * cf-sparclynx.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-aux.c, * coff-go32.c, * coff-h8300.c, * coff-h8500.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c, * coff-sparc.c, * coff-stgo32.c, * coff-svm68k.c, * coff-tic80.c, * coff-u68k.c, * coff-w65.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * config.bfd, * configure.com, * configure.in, * demo64.c, * elf-m10200.c, * elf-m10300.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-gen.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * epoc-pe-arm.c, * epoc-pei-arm.c, * hp300bsd.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386bsd.c, * i386dynix.c, * i386freebsd.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * i386os9k.c, * irix-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * m88kopenbsd.c, * mach-o-i386.c, * mach-o-x86-64.c, * makefile.vms, * mipsbsd.c, * mmo.c, * netbsd-core.c, * newsos3.c, * nlm32-alpha.c, * nlm32-i386.c, * nlm32-ppc.c, * nlm32-sparc.c, * ns32knetbsd.c, * osf-core.c, * pc532-mach.c, * pe-arm-wince.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-ppc.c, * pe-sh.c, * pe-x86_64.c, * pei-arm-wince.c, * pei-arm.c, * pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-mips.c, * pei-ppc.c, * pei-sh.c, * pei-x86_64.c, * ppcboot.c, * ptrace-core.c, * riscix.c, * sco5-core.c, * som.c, * sparclinux.c, * sparclynx.c, * sparcnetbsd.c, * sunos.c, * targets.c, * trad-core.c, * vax1knetbsd.c, * vaxbsd.c, * vaxnetbsd.c, * versados.c, * vms-alpha.c, * vms-lib.c: Rename bfd targets to <cpu>_<format>_<other>_<endian>_vec. Adjust associated MY macros on aout targets. * configure: Regenerate. binutils/ * emul_aix.c: Update bfd target vector naming. * testsuite/binutils-all/objcopy.exp: Likewise. ld/ * emultempl/metagelf.em: Update bfd target vector naming. * emultempl/nios2elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise.
2014-05-02 12:39:40 +02:00
#define TARGET_BIG_SYM hppa_elf64_linux_vec
2001-01-14 12:12:53 +01:00
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-hppa-linux"
2007-03-13 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3826 * elf-bfd.h (elf_backend_data): Add elf_osabi. (_bfd_elf_set_osabi): New. * elf.c (_bfd_elf_set_osabi): New. * elf32-hppa.c (elf32_hppa_post_process_headers): Removed. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. (ELF_OSABI): Properly defined for each target. * elf32-i370.c (i370_elf_post_process_headers): Removed. (ELF_OSABI): Defined. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi. * elf32-msp430.c (elf32_msp430_post_process_headers): Removed. (ELF_OSABI): Defined. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with elf_osabi. * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI with elf_osabi. (ELF_OSABI): Properly defined for each target. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi for Linux. * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed. (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed. (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. (elf_backend_post_process_headers): Defined with _bfd_elf_set_osabi. * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target with any ELF target of the compatible machine for which we do not have a specific backend. * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI with elf_osabi. * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE. (elfNN_bed): Initialize elf_osabi with ELF_OSABI.
2007-03-14 03:56:45 +01:00
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_GNU
#undef elf64_bed
#define elf64_bed elf64_hppa_linux_bed
SHF_GNU_MBIND requires ELFOSABI_GNU When SHF_GNU_MBIND was added in the SHF_LOOS to SHF_HIOS range, it should have required ELFOSABI_GNU since these flags are already in use by other OSes. HPUX SHF_HP_TLS in fact has the same value. That means no place in binutils should test SHF_GNU_MBIND without first checking OSABI, and SHF_GNU_MBIND should not be set without also setting OSABI. At least, that's the ideal, but the patch accepts SHF_GNU_MBIND on ELFOSABI_NONE object files since gas didn't always set OSABI. However, to reinforce the fact that SHF_GNU_MBIND isn't proper without a non-zero OSABI, readelf will display the flag as LOOS+0 if OSABI isn't set. The clash with SHF_HP_TLS means that hppa64-linux either has that flag on .tbss sections or supports GNU_MBIND, not both. (hppa64-linux users, if there are any, may have noticed that GNU ld since 2017 mysteriously aligned their .tbss sections to a 4k boundary. That was one consequence of SHF_HP_TLS being blindly interpreted as SHF_GNU_MBIND.) Since it seems that binutils, gdb, gcc, glibc, and the linux kernel don't care about SHF_HP_TLS I took that flag out of .tbss for hppa64-linux. bfd/ * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind. * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind. (get_program_header_size): Formatting. Only test SH_GNU_MBIND when elf_gnu_osabi_mbind is set. (_bfd_elf_map_sections_to_segments): Likewise. (_bfd_elf_init_private_section_data): Likewise. (_bfd_elf_final_write_processing): Update comment. * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry. (elf_backend_special_sections): Define without .tbss for linux. binutils/ * readelf.c (get_parisc_segment_type): Split off hpux entries.. (get_ia64_segment_type): ..and these.. (get_hpux_segment_type): ..to here. (get_segment_type): Condition GNU_MBIND on osabi. Use get_hpux_segment_type. (get_symbol_binding): Do not print UNIQUE for ELFOSABI_NONE. (get_symbol_type): Do not print IFUNC for ELFOSABI_NONE. gas/ * config/obj-elf.c (obj_elf_change_section): Don't emit a fatal error for non-SHF_ALLOC SHF_GNU_MBIND here. (obj_elf_parse_section_letters): Return SHF_GNU_MBIND in new gnu_attr param. (obj_elf_section): Adjust obj_elf_parse_section_letters call. Formatting. Set SHF_GNU_MBIND and elf_osabi from gnu_attr. Emit normal error for non-SHF_ALLOC SHF_GNU_MBIND and wrong osabi. (obj_elf_type): Set elf_osabi for ifunc. * testsuite/gas/elf/section12a.d: xfail msp430 and hpux. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section13.d: Likewise. * testsuite/gas/elf/section13.l: Adjust expected error. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Condition SHF_GNU_MBIND on osabi. Set output elf_gnu_osabi_mbind.
2019-07-23 10:24:42 +02:00
#undef elf_backend_special_sections
#define elf_backend_special_sections (elf64_hppa_special_sections + 1)
2001-01-14 12:12:53 +01:00
#include "elf64-target.h"