1999-05-03 09:29:11 +02:00
|
|
|
|
/* Main header file for the bfd library -- portable access to object files.
|
2003-02-27 22:24:36 +01:00
|
|
|
|
|
|
|
|
|
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
2010-01-25 07:47:16 +01:00
|
|
|
|
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
* bfd/archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
(bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
bfd_mach_mcf_isa_b_usp_float_emac): New.
(bfd_default_scan): Update coldfire mapping.
* bfd/bfd-in.h (bfd_m68k_mach_to_features,
bfd_m68k_features_to_mach): Declare.
* bfd/bfd-in2.h: Rebuilt.
* bfd/cpu-m68k.c (arch_info_struct): Add new coldfire machines,
adjust legacy names.
(m68k_arch_features): New.
(bfd_m68k_mach_to_features,
bfd_m68k_features_to_mach): Define.
* bfd/elf32-m68k.c (elf32_m68k_object_p): New.
(elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
(elf32_m68k_print_private_bfd_data): Print the CF EF flags.
(elf_backend_object_p): Define.
* bfd/ieee.c (ieee_write_processor): Update coldfire machines.
* bfd/libbfd.h: Rebuilt.
* gas/config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs,
mcf5329_control_regs): New.
(not_current_architecture, selected_arch, selected_cpu): New.
(m68k_archs, m68k_extensions): New.
(archs): Renamed to ...
(m68k_cpus): ... here. Adjust.
(n_arches): Remove.
(md_pseudo_table): Add arch and cpu directives.
(find_cf_chip, m68k_ip): Adjust table scanning.
(no_68851, no_68881): Remove.
(md_assemble): Lazily initialize.
(select_control_regs): Adjust cpu names. Add 5208, 5213, 5329.
(md_init_after_args): Move functionality to m68k_init_arch.
(mri_chip): Adjust table scanning.
(md_parse_option): Reimplement 'm' processing to add -march & -mcpu
options with saner parsing.
(m68k_lookup_cpu, m68k_set_arch, m68k_set_cpu, m68k_set_extension,
m68k_init_arch): New.
(s_m68k_cpu, s_m68k_arch): New.
(md_show_usage): Adjust.
(m68k_elf_final_processing): Set CF EF flags.
* gas/config/tc-m68k.h (m68k_init_after_args): Remove.
(tc_init_after_args): Remove.
* gas/doc/c-m68k.texi (M68K-Opts): Document -march, -mcpu options.
(M68k-Directives): Document .arch and .cpu directives.
* gas/testsuite/gas/m68k/all.exp: Add arch-cpu-1 test.
* gas/testsuite/gas/m68k/arch-cpu-1.[sd]: New.
* include/elf/m68k.h (EF_CPU32, EF_M68000, EF_CFV4E): Rename to ...
(EF_M68K_CPU32, EF_M68K_M68000, EF_M68K_CFV4E): ... here.
(EF_M68K_ISA_MASK, EF_M68K_ISA_A, EF_M68K_M68K_ISA_A_PLUS,
EF_M68K_ISA_B, EF_M68K_HW_DIV, EF_M68K_MAC_MASK, EF_M68K_MAC,
EF_M68K_EMAC, EF_M68K_USP, EF_M68K_FLOAT): New.
* include/opcode/m68k.h (m68008, m68ec030, m68882): Remove.
(m68k_mask): New.
(cpu_m68k, cpu_cf): New.
(mcf5200, mcf5206e, mcf521x, mcf5249, mcf528x, mcf5307, mcf5407,
mcf5470, mcf5480): Rename to cpu_<foo>. Add m680x0 variants.
* opcodes/m68k-dis.c (print_insn_m68k): Use
bfd_m68k_mach_to_features.
* binutils/readelf.c (get_machine_flags): Add logic for EF_M68K flags.
2006-02-07 20:01:10 +01:00
|
|
|
|
Free Software Foundation, Inc.
|
2003-02-27 22:24:36 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
Contributed by Cygnus Support.
|
|
|
|
|
|
2002-05-29 18:03:04 +02:00
|
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-05-29 18:03:04 +02:00
|
|
|
|
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
|
2007-07-03 16:26:43 +02:00
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-05-29 18:03:04 +02:00
|
|
|
|
(at your option) any later version.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-05-29 18:03:04 +02:00
|
|
|
|
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.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-05-29 18:03:04 +02:00
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
2005-05-04 17:53:43 +02:00
|
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#ifndef __BFD_H_SEEN__
|
|
|
|
|
#define __BFD_H_SEEN__
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "ansidecl.h"
|
2001-10-02 07:58:41 +02:00
|
|
|
|
#include "symcat.h"
|
|
|
|
|
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
|
|
|
|
|
#ifndef SABER
|
|
|
|
|
/* This hack is to avoid a problem with some strict ANSI C preprocessors.
|
|
|
|
|
The problem is, "32_" is not a valid preprocessing token, and we don't
|
|
|
|
|
want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
|
|
|
|
|
cause the inner CONCAT2 macros to be evaluated first, producing
|
|
|
|
|
still-valid pp-tokens. Then the final concatenation can be done. */
|
|
|
|
|
#undef CONCAT4
|
|
|
|
|
#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2006-09-16 20:12:17 +02:00
|
|
|
|
/* This is a utility macro to handle the situation where the code
|
|
|
|
|
wants to place a constant string into the code, followed by a
|
|
|
|
|
comma and then the length of the string. Doing this by hand
|
2007-10-25 23:01:55 +02:00
|
|
|
|
is error prone, so using this macro is safer. */
|
|
|
|
|
#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
|
2006-09-16 20:12:17 +02:00
|
|
|
|
/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
|
|
|
|
|
to create the arguments to another macro, since the preprocessor
|
|
|
|
|
will mis-count the number of arguments to the outer macro (by not
|
|
|
|
|
evaluating STRING_COMMA_LEN and so missing the comma). This is a
|
|
|
|
|
problem for example when trying to use STRING_COMMA_LEN to build
|
|
|
|
|
the arguments to the strncmp() macro. Hence this alternative
|
|
|
|
|
definition of strncmp is provided here.
|
|
|
|
|
|
|
|
|
|
Note - these macros do NOT work if STR2 is not a constant string. */
|
|
|
|
|
#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
|
2006-09-28 14:59:25 +02:00
|
|
|
|
/* strcpy() can have a similar problem, but since we know we are
|
|
|
|
|
copying a constant string, we can use memcpy which will be faster
|
|
|
|
|
since there is no need to check for a NUL byte inside STR. We
|
|
|
|
|
can also save time if we do not need to copy the terminating NUL. */
|
|
|
|
|
#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
|
|
|
|
|
#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
|
2006-09-16 20:12:17 +02:00
|
|
|
|
|
|
|
|
|
|
2009-05-26 16:12:03 +02:00
|
|
|
|
#define BFD_SUPPORTS_PLUGINS @supports_plugins@
|
|
|
|
|
|
2001-08-17 05:54:53 +02:00
|
|
|
|
/* The word size used by BFD on the host. This may be 64 with a 32
|
|
|
|
|
bit target if the host is 64 bit, or if other 64 bit targets have
|
|
|
|
|
been selected with --enable-targets, or if --enable-64-bit-bfd. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define BFD_ARCH_SIZE @wordsize@
|
2001-08-17 05:54:53 +02:00
|
|
|
|
|
|
|
|
|
/* The word size of the default bfd target. */
|
|
|
|
|
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
|
2007-07-12 09:16:41 +02:00
|
|
|
|
#define BFD_HOST_64BIT_LONG_LONG @BFD_HOST_64BIT_LONG_LONG@
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#if @BFD_HOST_64_BIT_DEFINED@
|
|
|
|
|
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
|
|
|
|
|
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
|
* bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
(BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
(bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
(bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
(bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
* configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
(BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
when using long.
* libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
(bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
* dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
(read_8_bytes, read_indirect_string, read_address): Likewise.
(read_abbrevs, parse_comp_unit): Likewise.
* targets.c (struct bfd_target): Likewise.
* aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
* hppabsd-core.c: Likewise. Formatting.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* configure: Regenerate.
* bfd-in2.h: Regenerate.
2004-03-15 15:21:43 +01:00
|
|
|
|
typedef BFD_HOST_64_BIT bfd_int64_t;
|
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_uint64_t;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if BFD_ARCH_SIZE >= 64
|
|
|
|
|
#define BFD64
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef INLINE
|
|
|
|
|
#if __GNUC__ >= 2
|
|
|
|
|
#define INLINE __inline__
|
|
|
|
|
#else
|
|
|
|
|
#define INLINE
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-07-12 09:16:41 +02:00
|
|
|
|
/* Declaring a type wide enough to hold a host long and a host pointer. */
|
|
|
|
|
#define BFD_HOSTPTR_T @BFD_HOSTPTR_T@
|
|
|
|
|
typedef BFD_HOSTPTR_T bfd_hostptr_t;
|
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* Forward declaration. */
|
2003-02-27 22:24:36 +01:00
|
|
|
|
typedef struct bfd bfd;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
/* Boolean type used in bfd. Too many systems define their own
|
|
|
|
|
versions of "boolean" for us to safely typedef a "boolean" of
|
2002-12-08 04:34:38 +01:00
|
|
|
|
our own. Using an enum for "bfd_boolean" has its own set of
|
2002-11-30 09:39:46 +01:00
|
|
|
|
problems, with strange looking casts required to avoid warnings
|
|
|
|
|
on some older compilers. Thus we just use an int.
|
|
|
|
|
|
2002-12-08 04:34:38 +01:00
|
|
|
|
General rule: Functions which are bfd_boolean return TRUE on
|
2002-11-30 09:39:46 +01:00
|
|
|
|
success and FALSE on failure (unless they're a predicate). */
|
|
|
|
|
|
|
|
|
|
typedef int bfd_boolean;
|
|
|
|
|
#undef FALSE
|
|
|
|
|
#undef TRUE
|
|
|
|
|
#define FALSE 0
|
|
|
|
|
#define TRUE 1
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#ifdef BFD64
|
|
|
|
|
|
|
|
|
|
#ifndef BFD_HOST_64_BIT
|
|
|
|
|
#error No 64 bit integer type available
|
|
|
|
|
#endif /* ! defined (BFD_HOST_64_BIT) */
|
|
|
|
|
|
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_vma;
|
|
|
|
|
typedef BFD_HOST_64_BIT bfd_signed_vma;
|
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_size_type;
|
|
|
|
|
typedef BFD_HOST_U_64_BIT symvalue;
|
|
|
|
|
|
|
|
|
|
#if BFD_HOST_64BIT_LONG
|
2008-07-28 06:07:32 +02:00
|
|
|
|
#define BFD_VMA_FMT "l"
|
|
|
|
|
#elif defined (__MSVCRT__)
|
|
|
|
|
#define BFD_VMA_FMT "I64"
|
2008-01-25 17:18:41 +01:00
|
|
|
|
#else
|
2008-07-28 06:07:32 +02:00
|
|
|
|
#define BFD_VMA_FMT "ll"
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#endif
|
2008-07-28 06:07:32 +02:00
|
|
|
|
|
|
|
|
|
#ifndef fprintf_vma
|
|
|
|
|
#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
|
|
|
|
|
#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#else /* not BFD64 */
|
|
|
|
|
|
|
|
|
|
/* Represent a target address. Also used as a generic unsigned type
|
|
|
|
|
which is guaranteed to be big enough to hold any arithmetic types
|
|
|
|
|
we need to deal with. */
|
|
|
|
|
typedef unsigned long bfd_vma;
|
|
|
|
|
|
|
|
|
|
/* A generic signed type which is guaranteed to be big enough to hold any
|
|
|
|
|
arithmetic types we need to deal with. Can be assumed to be compatible
|
|
|
|
|
with bfd_vma in the same way that signed and unsigned ints are compatible
|
|
|
|
|
(as parameters, in assignment, etc). */
|
|
|
|
|
typedef long bfd_signed_vma;
|
|
|
|
|
|
|
|
|
|
typedef unsigned long symvalue;
|
|
|
|
|
typedef unsigned long bfd_size_type;
|
|
|
|
|
|
|
|
|
|
/* Print a bfd_vma x on stream s. */
|
2008-07-28 06:07:32 +02:00
|
|
|
|
#define BFD_VMA_FMT "l"
|
|
|
|
|
#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
|
|
|
|
|
#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#endif /* not BFD64 */
|
|
|
|
|
|
* libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2, bfd_alloc2,
bfd_zalloc2): New prototypes.
* bfd-in.h (HALF_BFD_SIZE_TYPE): Define.
* libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): New functions.
* opncls.c (bfd_alloc2, bfd_zalloc2): New functions.
* elf.c (bfd_elf_get_elf_syms, setup_group, assign_section_numbers,
elf_map_symbols, map_sections_to_segments,
assign_file_positions_for_segments, copy_private_bfd_data,
swap_out_syms, _bfd_elf_slurp_version_tables): Use bfd_*alloc2
where appropriate.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf.c (_bfd_elf_print_private_bfd_data): Don't crash on bogus
verdef or verneed section.
(_bfd_elf_slurp_version_tables): Handle corrupt verdef and/or
verneed sections gracefully.
* elfxx-sparc.c (_bfd_sparc_elf_info_to_howto_ptr): Don't crash on
bogus relocation values.
* elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
* elf64-s390.c (elf_s390_info_to_howto): Likewise.
* elf32-s390.c (elf_s390_info_to_howto): Likewise.
* elf64-x86-64.c (elf64_x86_64_info_to_howto): Likewise.
* elfxx-ia64.c (lookup_howto): Likewise.
2005-07-05 11:44:20 +02:00
|
|
|
|
#define HALF_BFD_SIZE_TYPE \
|
|
|
|
|
(((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
|
|
|
|
|
|
* bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
(BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
(bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
(bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
(bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
* configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
(BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
when using long.
* libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
(bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
* dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
(read_8_bytes, read_indirect_string, read_address): Likewise.
(read_abbrevs, parse_comp_unit): Likewise.
* targets.c (struct bfd_target): Likewise.
* aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
* hppabsd-core.c: Likewise. Formatting.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* configure: Regenerate.
* bfd-in2.h: Regenerate.
2004-03-15 15:21:43 +01:00
|
|
|
|
#ifndef BFD_HOST_64_BIT
|
|
|
|
|
/* Fall back on a 32 bit type. The idea is to make these types always
|
|
|
|
|
available for function return types, but in the case that
|
|
|
|
|
BFD_HOST_64_BIT is undefined such a function should abort or
|
|
|
|
|
otherwise signal an error. */
|
|
|
|
|
typedef bfd_signed_vma bfd_int64_t;
|
|
|
|
|
typedef bfd_vma bfd_uint64_t;
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-16 19:46:40 +01:00
|
|
|
|
/* An offset into a file. BFD always uses the largest possible offset
|
|
|
|
|
based on the build time availability of fseek, fseeko, or fseeko64. */
|
|
|
|
|
typedef @bfd_file_ptr@ file_ptr;
|
|
|
|
|
typedef unsigned @bfd_file_ptr@ ufile_ptr;
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|
|
2003-06-29 12:06:40 +02:00
|
|
|
|
extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
|
|
|
|
|
extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
|
2001-08-09 18:00:21 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define printf_vma(x) fprintf_vma(stdout,x)
|
2001-08-09 18:00:21 +02:00
|
|
|
|
#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
typedef unsigned int flagword; /* 32 bits of flags */
|
|
|
|
|
typedef unsigned char bfd_byte;
|
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* File formats. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
typedef enum bfd_format
|
|
|
|
|
{
|
|
|
|
|
bfd_unknown = 0, /* File format is unknown. */
|
2003-11-24 19:06:40 +01:00
|
|
|
|
bfd_object, /* Linker/assembler/compiler output. */
|
2002-01-30 19:12:17 +01:00
|
|
|
|
bfd_archive, /* Object archive file. */
|
|
|
|
|
bfd_core, /* Core dump. */
|
|
|
|
|
bfd_type_end /* Marks the end; don't use it! */
|
|
|
|
|
}
|
|
|
|
|
bfd_format;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* Symbols and relocation. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* A count of carsyms (canonical archive symbols). */
|
|
|
|
|
typedef unsigned long symindex;
|
|
|
|
|
|
|
|
|
|
/* How to perform a relocation. */
|
|
|
|
|
typedef const struct reloc_howto_struct reloc_howto_type;
|
|
|
|
|
|
|
|
|
|
#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
|
|
|
|
|
|
|
|
|
|
/* General purpose part of a symbol X;
|
|
|
|
|
target specific parts are in libcoff.h, libaout.h, etc. */
|
|
|
|
|
|
|
|
|
|
#define bfd_get_section(x) ((x)->section)
|
|
|
|
|
#define bfd_get_output_section(x) ((x)->section->output_section)
|
|
|
|
|
#define bfd_set_section(x,y) ((x)->section) = (y)
|
|
|
|
|
#define bfd_asymbol_base(x) ((x)->section->vma)
|
|
|
|
|
#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
|
|
|
|
|
#define bfd_asymbol_name(x) ((x)->name)
|
|
|
|
|
/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
|
|
|
|
|
#define bfd_asymbol_bfd(x) ((x)->the_bfd)
|
2008-06-30 22:51:58 +02:00
|
|
|
|
#define bfd_asymbol_flavour(x) \
|
|
|
|
|
(((x)->flags & BSF_SYNTHETIC) != 0 \
|
|
|
|
|
? bfd_target_unknown_flavour \
|
|
|
|
|
: bfd_asymbol_bfd (x)->xvec->flavour)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* A canonical archive symbol. */
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* This is a type pun with struct ranlib on purpose! */
|
|
|
|
|
typedef struct carsym
|
|
|
|
|
{
|
1999-05-03 09:29:11 +02:00
|
|
|
|
char *name;
|
2002-01-30 19:12:17 +01:00
|
|
|
|
file_ptr file_offset; /* Look here to find the file. */
|
|
|
|
|
}
|
|
|
|
|
carsym; /* To make these you call a carsymogen. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Used in generating armaps (archive tables of contents).
|
2002-01-30 19:12:17 +01:00
|
|
|
|
Perhaps just a forward definition would do? */
|
|
|
|
|
struct orl /* Output ranlib. */
|
|
|
|
|
{
|
|
|
|
|
char **name; /* Symbol name. */
|
|
|
|
|
union
|
|
|
|
|
{
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|
file_ptr pos;
|
|
|
|
|
bfd *abfd;
|
2002-01-30 19:12:17 +01:00
|
|
|
|
} u; /* bfd* or file position. */
|
|
|
|
|
int namidx; /* Index into string table. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
};
|
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* Linenumber stuff. */
|
|
|
|
|
typedef struct lineno_cache_entry
|
|
|
|
|
{
|
|
|
|
|
unsigned int line_number; /* Linenumber from start of function. */
|
|
|
|
|
union
|
|
|
|
|
{
|
Index: sim/frv/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* traps.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/d10v/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* simops.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/common/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: ld/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: bfd/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* syms.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
* bfd-in2.h: Re-generate.
2003-10-31 06:32:46 +01:00
|
|
|
|
struct bfd_symbol *sym; /* Function name. */
|
2002-01-30 19:12:17 +01:00
|
|
|
|
bfd_vma offset; /* Offset into section. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
} u;
|
2002-01-30 19:12:17 +01:00
|
|
|
|
}
|
|
|
|
|
alent;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* Object and core file sections. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#define align_power(addr, align) \
|
2002-08-30 20:36:18 +02:00
|
|
|
|
(((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2003-10-19 Andrew Cagney <cagney@redhat.com>
* targets.c: Replace "struct sec" with "struct bfd_section"
* syms.c, sparclynx.c, section.c, opncls.c: Ditto.
* libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
* elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
* aout-tic30.c, aout-target.h:
* bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
Index: binutils/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* coffgrok.h (coff_section): Replace 'struct sec" with "struct
bfd_section".
Index: gdb/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* symtab.c: Replace "struct sec" with "struct bfd_section".
* objfiles.c, linespec.c, blockframe.c, block.c: Ditto.
Index: ld/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* pe-dll.c: Replace "struct sec" with "struct bfd_section".
Index: sim/common/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* sim-base.h: Replace "struct sec" with "struct bfd_section".
2003-10-20 16:38:46 +02:00
|
|
|
|
typedef struct bfd_section *sec_ptr;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
|
|
|
|
|
#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
|
2002-04-13 01:02:12 +02:00
|
|
|
|
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
|
|
|
|
|
#define bfd_section_name(bfd, ptr) ((ptr)->name)
|
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
|
|
|
|
#define bfd_section_size(bfd, ptr) ((ptr)->size)
|
|
|
|
|
#define bfd_get_section_size(ptr) ((ptr)->size)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
|
|
|
|
|
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
|
|
|
|
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
|
|
|
|
|
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
|
|
|
|
|
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
|
|
|
|
|
|
|
|
|
|
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
|
|
|
|
|
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
|
|
|
|
|
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
|
* bfd-in.h (bfd_get_section_limit): Define.
* reloc.c (bfd_perform_relocation, bfd_install_relocation)
(_bfd_final_link_relocate): Use bfd_get_section_limit.
* aout-tic30.c (tic30_aout_final_link_relocate): Likewise.
* coff-arm.c (coff_arm_relocate_section): Likewise.
* coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise.
* cpu-ns32k.c (do_ns32k_reloc): Likewise.
(bfd_ns32k_final_link_relocate): Likewise.
* elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise.
* elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise.
* elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc)
(i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise.
* elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc)
(m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise.
* elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise.
* elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
* elf32-or32.c (or32_elf_consth_reloc): Likewise.
* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise.
* elf32-s390.c (s390_elf_ldisp_reloc): Likewise.
* elf32-sh.c (sh_elf_reloc_loop): Likewise.
* elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise.
(sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise.
* elf32-v850.c (v850_elf_reloc): Likewise.
* elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise.
* elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise.
* elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise.
* elf64-mips.c (mips_elf64_gprel32_reloc)
(mips16_gprel_reloc): Likewise.
* elf64-mmix.c (mmix_elf_reloc): Likewise.
* elf64-s390.c (s390_elf_ldisp_reloc): Likewise.
* elf64-sparc.c (init_insn_reloc): Likewise.
* elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
* elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp)
(_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc)
(_bfd_mips_elf_generic_reloc): Likewise.
* bfd-in2.h: Regenerate.
2004-06-29 15:46:34 +02:00
|
|
|
|
/* Find the address one past the end of SEC. */
|
|
|
|
|
#define bfd_get_section_limit(bfd, sec) \
|
|
|
|
|
(((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
|
|
|
|
|
/ bfd_octets_per_byte (bfd))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2010-03-26 09:34:24 +01:00
|
|
|
|
/* Return TRUE if input section SEC has been discarded. */
|
2007-03-07 09:54:35 +01:00
|
|
|
|
#define elf_discarded_section(sec) \
|
|
|
|
|
(!bfd_is_abs_section (sec) \
|
|
|
|
|
&& bfd_is_abs_section ((sec)->output_section) \
|
|
|
|
|
&& (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
|
|
|
|
|
&& (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
|
|
|
|
|
|
2006-11-20 03:09:56 +01:00
|
|
|
|
/* Forward define. */
|
|
|
|
|
struct stat;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
typedef enum bfd_print_symbol
|
2000-06-19 03:22:44 +02:00
|
|
|
|
{
|
1999-05-03 09:29:11 +02:00
|
|
|
|
bfd_print_symbol_name,
|
|
|
|
|
bfd_print_symbol_more,
|
|
|
|
|
bfd_print_symbol_all
|
|
|
|
|
} bfd_print_symbol_type;
|
2000-06-19 03:22:44 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* Information about a symbol that nm needs. */
|
|
|
|
|
|
|
|
|
|
typedef struct _symbol_info
|
|
|
|
|
{
|
|
|
|
|
symvalue value;
|
|
|
|
|
char type;
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|
const char *name; /* Symbol name. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
unsigned char stab_type; /* Stab type. */
|
2000-11-09 00:57:04 +01:00
|
|
|
|
char stab_other; /* Stab other. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
short stab_desc; /* Stab desc. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|
const char *stab_name; /* String for stab type. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
} symbol_info;
|
|
|
|
|
|
|
|
|
|
/* Get the name of a stabs type code. */
|
|
|
|
|
|
2003-06-29 12:06:40 +02:00
|
|
|
|
extern const char *bfd_get_stab_name (int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Hash table routines. There is no way to free up a hash table. */
|
|
|
|
|
|
|
|
|
|
/* An element in the hash table. Most uses will actually use a larger
|
|
|
|
|
structure, and an instance of this will be the first field. */
|
|
|
|
|
|
|
|
|
|
struct bfd_hash_entry
|
|
|
|
|
{
|
|
|
|
|
/* Next entry for this hash code. */
|
|
|
|
|
struct bfd_hash_entry *next;
|
|
|
|
|
/* String being hashed. */
|
|
|
|
|
const char *string;
|
|
|
|
|
/* Hash code. This is the full hash code, not the index into the
|
|
|
|
|
table. */
|
|
|
|
|
unsigned long hash;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* A hash table. */
|
|
|
|
|
|
|
|
|
|
struct bfd_hash_table
|
|
|
|
|
{
|
|
|
|
|
/* The hash array. */
|
|
|
|
|
struct bfd_hash_entry **table;
|
|
|
|
|
/* A function used to create new elements in the hash table. The
|
|
|
|
|
first entry is itself a pointer to an element. When this
|
|
|
|
|
function is first invoked, this pointer will be NULL. However,
|
|
|
|
|
having the pointer permits a hierarchy of method functions to be
|
|
|
|
|
built each of which calls the function in the superclass. Thus
|
|
|
|
|
each function should be written to allocate a new block of memory
|
|
|
|
|
only if the argument is NULL. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
struct bfd_hash_entry *(*newfunc)
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* An objalloc for this hash table. This is a struct objalloc *,
|
2003-06-29 12:06:40 +02:00
|
|
|
|
but we use void * to avoid requiring the inclusion of objalloc.h. */
|
|
|
|
|
void *memory;
|
2006-11-20 02:38:38 +01:00
|
|
|
|
/* The number of slots in the hash table. */
|
|
|
|
|
unsigned int size;
|
|
|
|
|
/* The number of entries in the hash table. */
|
|
|
|
|
unsigned int count;
|
|
|
|
|
/* The size of elements. */
|
|
|
|
|
unsigned int entsize;
|
|
|
|
|
/* If non-zero, don't grow the hash table. */
|
|
|
|
|
unsigned int frozen:1;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Initialize a hash table. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_hash_table_init
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_table *,
|
|
|
|
|
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
|
|
|
|
|
struct bfd_hash_table *,
|
2006-03-16 13:20:16 +01:00
|
|
|
|
const char *),
|
|
|
|
|
unsigned int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Initialize a hash table specifying a size. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_hash_table_init_n
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_table *,
|
|
|
|
|
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
|
|
|
|
|
struct bfd_hash_table *,
|
|
|
|
|
const char *),
|
2006-03-16 13:20:16 +01:00
|
|
|
|
unsigned int, unsigned int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Free up a hash table. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern void bfd_hash_table_free
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_table *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
/* Look up a string in a hash table. If CREATE is TRUE, a new entry
|
1999-05-03 09:29:11 +02:00
|
|
|
|
will be created for this string if one does not already exist. The
|
2002-11-30 09:39:46 +01:00
|
|
|
|
COPY argument must be TRUE if this routine should copy the string
|
1999-05-03 09:29:11 +02:00
|
|
|
|
into newly allocated memory when adding an entry. */
|
|
|
|
|
extern struct bfd_hash_entry *bfd_hash_lookup
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_table *, const char *, bfd_boolean create,
|
|
|
|
|
bfd_boolean copy);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2007-09-19 14:08:34 +02:00
|
|
|
|
/* Insert an entry in a hash table. */
|
|
|
|
|
extern struct bfd_hash_entry *bfd_hash_insert
|
|
|
|
|
(struct bfd_hash_table *, const char *, unsigned long);
|
|
|
|
|
|
2010-11-08 03:48:57 +01:00
|
|
|
|
/* Rename an entry in a hash table. */
|
|
|
|
|
extern void bfd_hash_rename
|
|
|
|
|
(struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* Replace an entry in a hash table. */
|
|
|
|
|
extern void bfd_hash_replace
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_table *, struct bfd_hash_entry *old,
|
|
|
|
|
struct bfd_hash_entry *nw);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Base method for creating a hash table entry. */
|
|
|
|
|
extern struct bfd_hash_entry *bfd_hash_newfunc
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Grab some space for a hash table entry. */
|
2003-06-29 12:06:40 +02:00
|
|
|
|
extern void *bfd_hash_allocate
|
|
|
|
|
(struct bfd_hash_table *, unsigned int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Traverse a hash table in a random order, calling a function on each
|
2002-11-30 09:39:46 +01:00
|
|
|
|
element. If the function returns FALSE, the traversal stops. The
|
1999-05-03 09:29:11 +02:00
|
|
|
|
INFO argument is passed to the function. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern void bfd_hash_traverse
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_hash_table *,
|
|
|
|
|
bfd_boolean (*) (struct bfd_hash_entry *, void *),
|
|
|
|
|
void *info);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2004-05-21 17:38:04 +02:00
|
|
|
|
/* Allows the default size of a hash table to be configured. New hash
|
|
|
|
|
tables allocated using bfd_hash_table_init will be created with
|
|
|
|
|
this size. */
|
|
|
|
|
extern void bfd_hash_set_default_size (bfd_size_type);
|
|
|
|
|
|
2004-06-28 15:57:59 +02:00
|
|
|
|
/* This structure is used to keep track of stabs in sections
|
|
|
|
|
information while linking. */
|
|
|
|
|
|
|
|
|
|
struct stab_info
|
|
|
|
|
{
|
|
|
|
|
/* A hash table used to hold stabs strings. */
|
|
|
|
|
struct bfd_strtab_hash *strings;
|
|
|
|
|
/* The header file hash table. */
|
|
|
|
|
struct bfd_hash_table includes;
|
|
|
|
|
/* The first .stabstr section. */
|
|
|
|
|
struct bfd_section *stabstr;
|
|
|
|
|
};
|
|
|
|
|
|
2003-06-29 12:06:40 +02:00
|
|
|
|
#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
|
2001-10-02 07:58:41 +02:00
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
/* User program access to BFD facilities. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Direct I/O routines, for programs which know more about the object
|
|
|
|
|
file than BFD does. Use higher level routines if possible. */
|
|
|
|
|
|
2003-06-29 12:06:40 +02:00
|
|
|
|
extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
|
|
|
|
|
extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
|
|
|
|
|
extern int bfd_seek (bfd *, file_ptr, int);
|
2004-02-12 00:23:20 +01:00
|
|
|
|
extern file_ptr bfd_tell (bfd *);
|
2003-06-29 12:06:40 +02:00
|
|
|
|
extern int bfd_flush (bfd *);
|
|
|
|
|
extern int bfd_stat (bfd *, struct stat *);
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|
|
|
|
|
|
/* Deprecated old routines. */
|
|
|
|
|
#if __GNUC__
|
|
|
|
|
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
|
|
|
|
|
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
|
|
|
|
|
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#else
|
|
|
|
|
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
|
|
|
|
|
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
|
|
|
|
|
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#endif
|
2003-06-29 12:06:40 +02:00
|
|
|
|
extern void warn_deprecated (const char *, const char *, int, const char *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Cast from const char * to char * so that caller can assign to
|
|
|
|
|
a char * without a warning. */
|
|
|
|
|
#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
|
|
|
|
|
#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
|
|
|
|
|
#define bfd_get_format(abfd) ((abfd)->format)
|
|
|
|
|
#define bfd_get_target(abfd) ((abfd)->xvec->name)
|
|
|
|
|
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
|
2000-06-16 22:35:08 +02:00
|
|
|
|
#define bfd_family_coff(abfd) \
|
|
|
|
|
(bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
|
|
|
|
|
bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
|
|
|
|
|
#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
|
|
|
|
|
#define bfd_header_big_endian(abfd) \
|
|
|
|
|
((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
|
|
|
|
|
#define bfd_header_little_endian(abfd) \
|
|
|
|
|
((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
|
|
|
|
|
#define bfd_get_file_flags(abfd) ((abfd)->flags)
|
|
|
|
|
#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
|
|
|
|
|
#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
|
|
|
|
|
#define bfd_my_archive(abfd) ((abfd)->my_archive)
|
|
|
|
|
#define bfd_has_map(abfd) ((abfd)->has_armap)
|
2008-03-28 07:49:44 +01:00
|
|
|
|
#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
|
|
|
|
|
#define bfd_usrdata(abfd) ((abfd)->usrdata)
|
|
|
|
|
|
|
|
|
|
#define bfd_get_start_address(abfd) ((abfd)->start_address)
|
|
|
|
|
#define bfd_get_symcount(abfd) ((abfd)->symcount)
|
|
|
|
|
#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
|
|
|
|
|
#define bfd_count_sections(abfd) ((abfd)->section_count)
|
|
|
|
|
|
2002-09-18 04:39:43 +02:00
|
|
|
|
#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_cache_close
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd);
|
2001-04-25 23:08:02 +02:00
|
|
|
|
/* NB: This declaration should match the autogenerated one in libbfd.h. */
|
|
|
|
|
|
2004-06-17 13:47:51 +02:00
|
|
|
|
extern bfd_boolean bfd_cache_close_all (void);
|
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_record_phdr
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
|
2003-10-19 Andrew Cagney <cagney@redhat.com>
* targets.c: Replace "struct sec" with "struct bfd_section"
* syms.c, sparclynx.c, section.c, opncls.c: Ditto.
* libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
* elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
* aout-tic30.c, aout-target.h:
* bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
Index: binutils/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* coffgrok.h (coff_section): Replace 'struct sec" with "struct
bfd_section".
Index: gdb/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* symtab.c: Replace "struct sec" with "struct bfd_section".
* objfiles.c, linespec.c, blockframe.c, block.c: Ditto.
Index: ld/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* pe-dll.c: Replace "struct sec" with "struct bfd_section".
Index: sim/common/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* sim-base.h: Replace "struct sec" with "struct bfd_section".
2003-10-20 16:38:46 +02:00
|
|
|
|
bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Byte swapping routines. */
|
|
|
|
|
|
* bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
(BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
(bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
(bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
(bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
* configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
(BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
when using long.
* libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
(bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
* dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
(read_8_bytes, read_indirect_string, read_address): Likewise.
(read_abbrevs, parse_comp_unit): Likewise.
* targets.c (struct bfd_target): Likewise.
* aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
* hppabsd-core.c: Likewise. Formatting.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* configure: Regenerate.
* bfd-in2.h: Regenerate.
2004-03-15 15:21:43 +01:00
|
|
|
|
bfd_uint64_t bfd_getb64 (const void *);
|
|
|
|
|
bfd_uint64_t bfd_getl64 (const void *);
|
|
|
|
|
bfd_int64_t bfd_getb_signed_64 (const void *);
|
|
|
|
|
bfd_int64_t bfd_getl_signed_64 (const void *);
|
* bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
(bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
(bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
(bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
(bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
* libbfd.c: Likewise in function definitions.
(bfd_put_8): Mask with 0xff rather than casting to char.
(bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
(H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
(H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
* libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
(H_GET_64, H_GET_32, H_GET_16): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
* archive.c (do_slurp_coff_armap): Update swap prototype.
* coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
(tic54x_getl_signed_32): Likewise.
(tic54x_putl32): Likewise. Mask with 0xff rather than casting to char.
* mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
* pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
(bfd_getp_signed_32, bfd_putp32): Likewise.
* targets.c (struct bfd_target): Use void* in place of bfd_byte* for
bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
bfd_h_getx_signed_16, bfd_h_putx16.
* aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
* hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* bfd-in2.h: Regenerate.
2004-03-15 13:23:11 +01:00
|
|
|
|
bfd_vma bfd_getb32 (const void *);
|
|
|
|
|
bfd_vma bfd_getl32 (const void *);
|
|
|
|
|
bfd_signed_vma bfd_getb_signed_32 (const void *);
|
|
|
|
|
bfd_signed_vma bfd_getl_signed_32 (const void *);
|
|
|
|
|
bfd_vma bfd_getb16 (const void *);
|
|
|
|
|
bfd_vma bfd_getl16 (const void *);
|
|
|
|
|
bfd_signed_vma bfd_getb_signed_16 (const void *);
|
|
|
|
|
bfd_signed_vma bfd_getl_signed_16 (const void *);
|
* bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
(BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
(bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
(bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
(bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
* configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
(BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
when using long.
* libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
(bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
* dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
(read_8_bytes, read_indirect_string, read_address): Likewise.
(read_abbrevs, parse_comp_unit): Likewise.
* targets.c (struct bfd_target): Likewise.
* aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
* hppabsd-core.c: Likewise. Formatting.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* configure: Regenerate.
* bfd-in2.h: Regenerate.
2004-03-15 15:21:43 +01:00
|
|
|
|
void bfd_putb64 (bfd_uint64_t, void *);
|
|
|
|
|
void bfd_putl64 (bfd_uint64_t, void *);
|
* bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
(bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
(bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
(bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
(bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
* libbfd.c: Likewise in function definitions.
(bfd_put_8): Mask with 0xff rather than casting to char.
(bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
(H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
(H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
* libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
(H_GET_64, H_GET_32, H_GET_16): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
* archive.c (do_slurp_coff_armap): Update swap prototype.
* coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
(tic54x_getl_signed_32): Likewise.
(tic54x_putl32): Likewise. Mask with 0xff rather than casting to char.
* mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
* pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
(bfd_getp_signed_32, bfd_putp32): Likewise.
* targets.c (struct bfd_target): Use void* in place of bfd_byte* for
bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
bfd_h_getx_signed_16, bfd_h_putx16.
* aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
* hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* bfd-in2.h: Regenerate.
2004-03-15 13:23:11 +01:00
|
|
|
|
void bfd_putb32 (bfd_vma, void *);
|
|
|
|
|
void bfd_putl32 (bfd_vma, void *);
|
|
|
|
|
void bfd_putb16 (bfd_vma, void *);
|
|
|
|
|
void bfd_putl16 (bfd_vma, void *);
|
2000-12-21 19:20:04 +01:00
|
|
|
|
|
|
|
|
|
/* Byte swapping routines which take size and endiannes as arguments. */
|
|
|
|
|
|
* bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
(BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
(bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
(bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
(bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
* configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
(BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
when using long.
* libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
(bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT.
(bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
* dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
(read_8_bytes, read_indirect_string, read_address): Likewise.
(read_abbrevs, parse_comp_unit): Likewise.
* targets.c (struct bfd_target): Likewise.
* aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
* hppabsd-core.c: Likewise. Formatting.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* configure: Regenerate.
* bfd-in2.h: Regenerate.
2004-03-15 15:21:43 +01:00
|
|
|
|
bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
|
|
|
|
|
void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
|
2004-07-21 17:42:58 +02:00
|
|
|
|
|
|
|
|
|
extern bfd_boolean bfd_section_already_linked_table_init (void);
|
|
|
|
|
extern void bfd_section_already_linked_table_free (void);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Externally visible ECOFF routines. */
|
|
|
|
|
|
|
|
|
|
#if defined(__STDC__) || defined(ALMOST_STDC)
|
|
|
|
|
struct ecoff_debug_info;
|
|
|
|
|
struct ecoff_debug_swap;
|
|
|
|
|
struct ecoff_extr;
|
Index: sim/frv/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* traps.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/d10v/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* simops.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/common/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: ld/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: bfd/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* syms.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
* bfd-in2.h: Re-generate.
2003-10-31 06:32:46 +01:00
|
|
|
|
struct bfd_symbol;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
struct bfd_link_info;
|
|
|
|
|
struct bfd_link_hash_entry;
|
|
|
|
|
struct bfd_elf_version_tree;
|
|
|
|
|
#endif
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_vma bfd_ecoff_get_gp_value
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd * abfd);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_set_gp_value
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, bfd_vma gp_value);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_set_regmasks
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, unsigned long gprmask, unsigned long fprmask,
|
|
|
|
|
unsigned long *cprmask);
|
|
|
|
|
extern void *bfd_ecoff_debug_init
|
|
|
|
|
(bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
extern void bfd_ecoff_debug_free
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_debug_accumulate
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
|
|
|
|
|
struct ecoff_debug_info *input_debug,
|
|
|
|
|
const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_debug_accumulate_other
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
|
|
|
|
|
struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_debug_externals
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
|
Index: sim/frv/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* traps.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/d10v/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* simops.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/common/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: ld/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: bfd/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* syms.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
* bfd-in2.h: Re-generate.
2003-10-31 06:32:46 +01:00
|
|
|
|
bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
|
|
|
|
|
void (*set_index) (struct bfd_symbol *, bfd_size_type));
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_debug_one_external
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap, const char *name,
|
|
|
|
|
struct ecoff_extr *esym);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
extern bfd_size_type bfd_ecoff_debug_size
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_write_debug
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap, file_ptr where);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_ecoff_write_accumulated_debug
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(void *handle, bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap,
|
|
|
|
|
struct bfd_link_info *info, file_ptr where);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Externally visible ELF routines. */
|
|
|
|
|
|
|
|
|
|
struct bfd_link_needed_list
|
|
|
|
|
{
|
|
|
|
|
struct bfd_link_needed_list *next;
|
|
|
|
|
bfd *by;
|
|
|
|
|
const char *name;
|
|
|
|
|
};
|
|
|
|
|
|
2004-03-18 13:50:20 +01:00
|
|
|
|
enum dynamic_lib_link_class {
|
|
|
|
|
DYN_NORMAL = 0,
|
|
|
|
|
DYN_AS_NEEDED = 1,
|
2004-07-19 18:40:52 +02:00
|
|
|
|
DYN_DT_NEEDED = 2,
|
|
|
|
|
DYN_NO_ADD_NEEDED = 4,
|
|
|
|
|
DYN_NO_NEEDED = 8
|
2004-03-18 13:50:20 +01:00
|
|
|
|
};
|
|
|
|
|
|
2006-07-19 03:50:23 +02:00
|
|
|
|
enum notice_asneeded_action {
|
|
|
|
|
notice_as_needed,
|
|
|
|
|
notice_not_needed,
|
|
|
|
|
notice_needed
|
|
|
|
|
};
|
|
|
|
|
|
* 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
|
|
|
|
extern bfd_boolean bfd_elf_record_link_assignment
|
2005-12-07 15:43:54 +01:00
|
|
|
|
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
|
|
|
|
|
bfd_boolean);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_elf_get_bfd_needed_list
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_needed_list **);
|
2004-03-26 05:42:57 +01:00
|
|
|
|
extern bfd_boolean bfd_elf_size_dynamic_sections
|
2009-09-23 15:54:29 +02:00
|
|
|
|
(bfd *, const char *, const char *, const char *, const char *, const char *,
|
|
|
|
|
const char * const *, struct bfd_link_info *, struct bfd_section **,
|
2005-05-04 13:00:28 +02:00
|
|
|
|
struct bfd_elf_version_tree *);
|
|
|
|
|
extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern void bfd_elf_set_dt_needed_name
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, const char *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern const char *bfd_elf_get_dt_soname
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *);
|
2004-03-18 13:50:20 +01:00
|
|
|
|
extern void bfd_elf_set_dyn_lib_class
|
2006-10-26 02:01:31 +02:00
|
|
|
|
(bfd *, enum dynamic_lib_link_class);
|
2004-07-19 18:40:52 +02:00
|
|
|
|
extern int bfd_elf_get_dyn_lib_class
|
|
|
|
|
(bfd *);
|
2000-08-22 21:33:16 +02:00
|
|
|
|
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
* 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
|
|
|
|
extern bfd_boolean bfd_elf_discard_info
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2005-07-29 04:46:04 +02:00
|
|
|
|
extern unsigned int _bfd_elf_default_action_discarded
|
|
|
|
|
(struct bfd_section *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2000-02-13 23:45:29 +01:00
|
|
|
|
/* Return an upper bound on the number of bytes required to store a
|
|
|
|
|
copy of ABFD's program header table entries. Return -1 if an error
|
|
|
|
|
occurs; bfd_get_error will return an appropriate code. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern long bfd_get_elf_phdr_upper_bound
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd);
|
2000-02-13 23:45:29 +01:00
|
|
|
|
|
|
|
|
|
/* Copy ABFD's program header table entries to *PHDRS. The entries
|
|
|
|
|
will be stored as an array of Elf_Internal_Phdr structures, as
|
|
|
|
|
defined in include/elf/internal.h. To find out how large the
|
|
|
|
|
buffer needs to be, call bfd_get_elf_phdr_upper_bound.
|
|
|
|
|
|
|
|
|
|
Return the number of program header table entries read, or -1 if an
|
|
|
|
|
error occurs; bfd_get_error will return an appropriate code. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern int bfd_get_elf_phdrs
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *abfd, void *phdrs);
|
2000-02-13 23:45:29 +01:00
|
|
|
|
|
2003-05-21 02:56:05 +02:00
|
|
|
|
/* Create a new BFD as if by bfd_openr. Rather than opening a file,
|
|
|
|
|
reconstruct an ELF file by reading the segments out of remote memory
|
|
|
|
|
based on the ELF file header at EHDR_VMA and the ELF program headers it
|
|
|
|
|
points to. If not null, *LOADBASEP is filled in with the difference
|
|
|
|
|
between the VMAs from which the segments were read, and the VMAs the
|
|
|
|
|
file headers (and hence BFD's idea of each section's VMA) put them at.
|
|
|
|
|
|
|
|
|
|
The function TARGET_READ_MEMORY is called to copy LEN bytes from the
|
|
|
|
|
remote memory at target address VMA into the local buffer at MYADDR; it
|
|
|
|
|
should return zero on success or an `errno' code on failure. TEMPL must
|
|
|
|
|
be a BFD for an ELF target with the word size and byte order found in
|
|
|
|
|
the remote memory. */
|
|
|
|
|
extern bfd *bfd_elf_bfd_from_remote_memory
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
|
2005-02-20 15:59:07 +01:00
|
|
|
|
int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
|
2003-05-21 02:56:05 +02:00
|
|
|
|
|
2000-05-05 20:12:53 +02:00
|
|
|
|
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern int bfd_get_arch_size
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *);
|
2000-05-05 20:12:53 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
|
|
|
|
|
extern int bfd_get_sign_extend_vma
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *);
|
2000-07-11 09:28:25 +02:00
|
|
|
|
|
2003-11-04 07:16:39 +01:00
|
|
|
|
extern struct bfd_section *_bfd_elf_tls_setup
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
|
|
|
|
|
2005-08-04 03:19:10 +02:00
|
|
|
|
extern void _bfd_fix_excluded_sec_syms
|
2005-07-14 15:54:23 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2005-05-04 15:19:02 +02:00
|
|
|
|
|
* bfd/archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
(bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
bfd_mach_mcf_isa_b_usp_float_emac): New.
(bfd_default_scan): Update coldfire mapping.
* bfd/bfd-in.h (bfd_m68k_mach_to_features,
bfd_m68k_features_to_mach): Declare.
* bfd/bfd-in2.h: Rebuilt.
* bfd/cpu-m68k.c (arch_info_struct): Add new coldfire machines,
adjust legacy names.
(m68k_arch_features): New.
(bfd_m68k_mach_to_features,
bfd_m68k_features_to_mach): Define.
* bfd/elf32-m68k.c (elf32_m68k_object_p): New.
(elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
(elf32_m68k_print_private_bfd_data): Print the CF EF flags.
(elf_backend_object_p): Define.
* bfd/ieee.c (ieee_write_processor): Update coldfire machines.
* bfd/libbfd.h: Rebuilt.
* gas/config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs,
mcf5329_control_regs): New.
(not_current_architecture, selected_arch, selected_cpu): New.
(m68k_archs, m68k_extensions): New.
(archs): Renamed to ...
(m68k_cpus): ... here. Adjust.
(n_arches): Remove.
(md_pseudo_table): Add arch and cpu directives.
(find_cf_chip, m68k_ip): Adjust table scanning.
(no_68851, no_68881): Remove.
(md_assemble): Lazily initialize.
(select_control_regs): Adjust cpu names. Add 5208, 5213, 5329.
(md_init_after_args): Move functionality to m68k_init_arch.
(mri_chip): Adjust table scanning.
(md_parse_option): Reimplement 'm' processing to add -march & -mcpu
options with saner parsing.
(m68k_lookup_cpu, m68k_set_arch, m68k_set_cpu, m68k_set_extension,
m68k_init_arch): New.
(s_m68k_cpu, s_m68k_arch): New.
(md_show_usage): Adjust.
(m68k_elf_final_processing): Set CF EF flags.
* gas/config/tc-m68k.h (m68k_init_after_args): Remove.
(tc_init_after_args): Remove.
* gas/doc/c-m68k.texi (M68K-Opts): Document -march, -mcpu options.
(M68k-Directives): Document .arch and .cpu directives.
* gas/testsuite/gas/m68k/all.exp: Add arch-cpu-1 test.
* gas/testsuite/gas/m68k/arch-cpu-1.[sd]: New.
* include/elf/m68k.h (EF_CPU32, EF_M68000, EF_CFV4E): Rename to ...
(EF_M68K_CPU32, EF_M68K_M68000, EF_M68K_CFV4E): ... here.
(EF_M68K_ISA_MASK, EF_M68K_ISA_A, EF_M68K_M68K_ISA_A_PLUS,
EF_M68K_ISA_B, EF_M68K_HW_DIV, EF_M68K_MAC_MASK, EF_M68K_MAC,
EF_M68K_EMAC, EF_M68K_USP, EF_M68K_FLOAT): New.
* include/opcode/m68k.h (m68008, m68ec030, m68882): Remove.
(m68k_mask): New.
(cpu_m68k, cpu_cf): New.
(mcf5200, mcf5206e, mcf521x, mcf5249, mcf528x, mcf5307, mcf5407,
mcf5470, mcf5480): Rename to cpu_<foo>. Add m680x0 variants.
* opcodes/m68k-dis.c (print_insn_m68k): Use
bfd_m68k_mach_to_features.
* binutils/readelf.c (get_machine_flags): Add logic for EF_M68K flags.
2006-02-07 20:01:10 +01:00
|
|
|
|
extern unsigned bfd_m68k_mach_to_features (int);
|
|
|
|
|
|
|
|
|
|
extern int bfd_m68k_features_to_mach (unsigned);
|
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
|
2005-07-14 15:54:23 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
|
|
|
|
|
char **);
|
2000-09-15 20:52:52 +02:00
|
|
|
|
|
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
|
|
|
|
extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
|
|
|
|
|
|
2005-09-30 17:36:41 +02:00
|
|
|
|
extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
|
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
|
|
|
|
|
char **);
|
|
|
|
|
|
2008-11-27 13:26:49 +01:00
|
|
|
|
extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
|
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
|
|
|
|
|
char **);
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* SunOS shared library support routines for the linker. */
|
|
|
|
|
|
|
|
|
|
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_sunos_record_link_assignment
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, const char *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_sunos_size_dynamic_sections
|
2005-07-14 15:54:23 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_section **,
|
|
|
|
|
struct bfd_section **, struct bfd_section **);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Linux shared library support routines for the linker. */
|
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_i386linux_size_dynamic_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_m68klinux_size_dynamic_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_sparclinux_size_dynamic_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* mmap hacks */
|
|
|
|
|
|
|
|
|
|
struct _bfd_window_internal;
|
|
|
|
|
typedef struct _bfd_window_internal bfd_window_internal;
|
|
|
|
|
|
2002-01-30 19:12:17 +01:00
|
|
|
|
typedef struct _bfd_window
|
|
|
|
|
{
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* What the user asked for. */
|
2003-06-29 12:06:40 +02:00
|
|
|
|
void *data;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
bfd_size_type size;
|
|
|
|
|
/* The actual window used by BFD. Small user-requested read-only
|
|
|
|
|
regions sharing a page may share a single window into the object
|
|
|
|
|
file. Read-write versions shouldn't until I've fixed things to
|
|
|
|
|
keep track of which portions have been claimed by the
|
|
|
|
|
application; don't want to give the same region back when the
|
|
|
|
|
application wants two writable copies! */
|
|
|
|
|
struct _bfd_window_internal *i;
|
2002-01-30 19:12:17 +01:00
|
|
|
|
}
|
|
|
|
|
bfd_window;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern void bfd_init_window
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd_window *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern void bfd_free_window
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd_window *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_get_file_window
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* XCOFF support routines for the linker. */
|
|
|
|
|
|
2009-04-01 21:53:53 +02:00
|
|
|
|
extern bfd_boolean bfd_xcoff_split_import_path
|
|
|
|
|
(bfd *, const char *, const char **, const char **);
|
|
|
|
|
extern bfd_boolean bfd_xcoff_set_archive_import_path
|
|
|
|
|
(struct bfd_link_info *, bfd *, const char *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_link_record_set
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_import_symbol
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
|
|
|
|
|
const char *, const char *, const char *, unsigned int);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_export_symbol
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_link_count_reloc
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, const char *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_record_link_assignment
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, const char *);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_size_dynamic_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, const char *, const char *,
|
|
|
|
|
unsigned long, unsigned long, unsigned long, bfd_boolean,
|
include/coff/
* xcoff.h (XCOFF_EXPALL, XCOFF_EXPFULL): New flags.
(xcoff_loader_info): Add auto_export_flags.
bfd/
* bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
bfd_boolean export_defineds parameter with an unsigned int
auto_export_flags parameter.
* bfd-in2.h: Regenerate.
* xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
split out from xcoff_build_ldsyms.
(xcoff_covered_by_expall_p): New function.
(xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
but with extra code to handle -bexpfull and -bexpall.
(xcoff_mark_auto_exports): New function.
(xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
a function should be automatically exported.
(bfd_xcoff_size_dynamic_sections): Replace the export_defineds
parameter with an auto_export_flags parameter. Update ldinfo
accordingly. Use xcoff_mark_auto_exports to mark all automatically-
exported symbols.
ld/
* emultempl/aix.em (auto_export_flags): New variable.
(explicit_auto_export_flags): Likewise.
(OPTION_EXPALL, OPTION_EXPFULL): New enum values.
(OPTION_NOEXPALL, OPTION_NOEXPFULL): Likewise.
(gld${EMULATION_NAME}_add_options): Add -bexpall, -bexpfull,
-bnoexpall and -bnoexpfull.
(gld${EMULATION_NAME}_handle_option): Handle them.
(gld${EMULATION_NAME}_before_allocation): Update the call to
bfd_size_dynamic_sections.
ld/testsuite/
* ld-powerpc/aix-export-1-all.dd, ld-powerpc/aix-export-1-full.dd,
ld-powerpc/aix-export-1a.s, ld-powerpc/aix-export-1b.s: New tests.
* ld-powerpc/aix52.exp: Run them.
2009-03-14 10:35:46 +01:00
|
|
|
|
int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_link_generate_rtinit
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, const char *, const char *, bfd_boolean);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-03-18 13:46:27 +01:00
|
|
|
|
/* XCOFF support routines for ar. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_xcoff_ar_archive_set_magic
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, char *);
|
2002-03-18 13:46:27 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* Externally visible COFF routines. */
|
|
|
|
|
|
|
|
|
|
#if defined(__STDC__) || defined(ALMOST_STDC)
|
|
|
|
|
struct internal_syment;
|
|
|
|
|
union internal_auxent;
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_coff_get_syment
|
Index: sim/frv/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* traps.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/d10v/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* simops.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/common/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: ld/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: bfd/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* syms.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
* bfd-in2.h: Re-generate.
2003-10-31 06:32:46 +01:00
|
|
|
|
(bfd *, struct bfd_symbol *, struct internal_syment *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_coff_get_auxent
|
Index: sim/frv/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* traps.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/d10v/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* simops.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/common/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: ld/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: bfd/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* syms.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
* bfd-in2.h: Re-generate.
2003-10-31 06:32:46 +01:00
|
|
|
|
(bfd *, struct bfd_symbol *, int, union internal_auxent *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_coff_set_symbol_class
|
Index: sim/frv/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* traps.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/d10v/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* simops.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
Index: sim/common/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: ld/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
with "struct bfd_symbol".
Index: bfd/ChangeLog
2003-10-30 Andrew Cagney <cagney@redhat.com>
* syms.c: Replace "struct symbol_cache_entry" with "struct
bfd_symbol".
* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
* bfd-in2.h: Re-generate.
2003-10-31 06:32:46 +01:00
|
|
|
|
(bfd *, struct bfd_symbol *, unsigned int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
|
2003-10-19 Andrew Cagney <cagney@redhat.com>
* targets.c: Replace "struct sec" with "struct bfd_section"
* syms.c, sparclynx.c, section.c, opncls.c: Ditto.
* libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
* elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
* aout-tic30.c, aout-target.h:
* bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
Index: binutils/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* coffgrok.h (coff_section): Replace 'struct sec" with "struct
bfd_section".
Index: gdb/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* symtab.c: Replace "struct sec" with "struct bfd_section".
* objfiles.c, linespec.c, blockframe.c, block.c: Ditto.
Index: ld/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* pe-dll.c: Replace "struct sec" with "struct bfd_section".
Index: sim/common/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* sim-base.h: Replace "struct sec" with "struct bfd_section".
2003-10-20 16:38:46 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
|
2000-07-22 01:40:12 +02:00
|
|
|
|
|
* bfd-in2.h: Regenerate.
* bfd-in.h (bfd_arm_vfp11_fix): New enum. Specify how VFP11
instruction scanning should be done.
(bfd_elf32_arm_init_maps, bfd_elf32_arm_vfp11_erratum_scan)
(bfd_elf32_arm_vfp11_fix_veneer_locations): Add prototypes.
(bfd_elf32_arm_set_target_relocs): Add vfp11 fix type argument to
prototype.
* elf-bfd.h (elf_backend_write_section): Add struct bfd_link_info
argument.
* elf32-arm.c (VFP11_ERRATUM_VENEER_SECTION_NAME)
(VFP11_ERRATUM_VENEER_ENTRY_NAME): Define macros.
(elf32_vfp11_erratum_type): New enum.
(elf32_vfp11_erratum_list): New struct. List of veneers or jumps to
veneers.
(_arm_elf_section_data): Add mapsize, erratumcount, erratumlist.
(elf32_arm_link_hash_table): Add vfp11_erratum_glue_size,
vfp11_fix and num_vfp11_fixes fields.
(elf32_arm_link_hash_table_create): Initialise vfp11_fix,
vfp11_erratum_glue_size, num_vfp11_fixes fields.
(VFP11_ERRATUM_VENEER_SIZE): Define. Size of an (ARM) veneer.
(bfd_elf32_arm_allocate_interworking_sections): Initialise erratum
glue section.
(elf32_arm_section_map_add): Add an code/data mapping symbol entry
to a section's map.
(record_vfp11_erratum_veneer): Create a single veneer, and its
associated symbols.
(bfd_elf32_arm_add_glue_sections_to_bfd): Add vfp11 erratum glue.
(bfd_elf32_arm_init_maps): Initialise mapping symbol table for input
BFDs.
(bfd_elf32_arm_set_vfp11_fix): Set the type of erratum workaround
required.
(bfd_arm_vfp11_pipe): Define VFP11 instruction pipes.
(bfd_arm_vfp11_regno): Recode a register number from a VFP11 insn.
(bfd_arm_vfp11_write_mask): Update write mask according to coded
register number.
(bfd_arm_vfp11_antidependency): New function.
(bfd_arm_vfp11_insn_decode): Decode a VFP11 insn.
(elf32_arm_compare_mapping): Declare.
(bfd_elf32_arm_vfp11_erratum_scan): Scan the sections of an input
BFD for potential erratum-triggering insns. Record results.
(bfd_elf32_arm_vfp11_fix_veneer_locations): Find out where veneers
and branches to veneers have been placed in virtual memory after
layout.
(bfd_elf32_arm_set_target_relocs): Set vfp11_fix field in global
hash table.
(elf32_arm_output_symbol_hook): Remove.
(elf32_arm_write_section): Output veneers, and branches to veneers.
Use maps from input sections, not output sections, for code
byte-swapping.
* elf32-ppc.c (ppc_elf_write_section): Add dummy link_info argument.
* elf32-score.c (_bfd_score_elf_write_section): Likewise.
* elfxx-mips.c (_bfd_mips_elf_write_section): Likewise.
* elfxx-mips.h (_bfd_mips_elf_write_section): Likewise.
2007-01-29 17:29:21 +01:00
|
|
|
|
/* ARM VFP11 erratum workaround support. */
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
BFD_ARM_VFP11_FIX_DEFAULT,
|
|
|
|
|
BFD_ARM_VFP11_FIX_NONE,
|
|
|
|
|
BFD_ARM_VFP11_FIX_SCALAR,
|
|
|
|
|
BFD_ARM_VFP11_FIX_VECTOR
|
|
|
|
|
} bfd_arm_vfp11_fix;
|
|
|
|
|
|
|
|
|
|
extern void bfd_elf32_arm_init_maps
|
|
|
|
|
(bfd *);
|
|
|
|
|
|
|
|
|
|
extern void bfd_elf32_arm_set_vfp11_fix
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
|
|
|
|
|
ld/
* emultempl/armelf.em (fix_cortex_a8): New.
(arm_elf_before_allocation): Call bfd_elf32_arm_set_cortex_a8_fix.
(arm_elf_create_output_section_statements): Add fix_cortex_a8 to
bfd_elf32_arm_set_target_relocs.
(OPTION_FIX_CORTEX_A8, OPTION_NO_FIX_CORTEX_A8): New.
(PARSE_AND_LIST_LONGOPTS): Add [no-]fix-cortex-a8 options.
(PARSE_AND_LIST_OPTIONS): Add [no-]fix-cortex-a8 options.
(PARSE_AND_LIST_ARGS_CASES): Handle OPTION_[NO_]FIX_CORTEX_A8.
* ld.texinfo (--[no-]fix-cortex-a8): Briefly document new options.
bfd/
* elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN):
New macros.
(elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
(elf32_arm_stub_a8_veneer_blx): New stub sequences.
(elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
(elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
(a8_erratum_fix, a8_erratum_reloc): New structs.
(elf32_arm_link_hash_table): Add a8_erratum_fixes,
num_a8_erratum_fixes, fix_cortex_a8 fields.
(elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
(elf32_arm_add_stub): Split into two parts, creating...
(elf32_arm_create_or_find_stub_sec): New function.
(elf32_arm_final_link_relocate): Add forward declaration.
(arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
relocations, multiple relocations per stub.
(find_stub_size_and_template): New (using parts of
arm_size_one_stub).
(arm_size_one_stub): Use find_stub_size_and_template.
(a8_reloc_compare): New.
(find_thumb_glue): Add forward declaration.
(cortex_a8_erratum_scan): New.
(elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
(bfd_elf32_arm_set_cortex_a8_fix): New.
(bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
(arm_map_one_stub): Add THUMB32_TYPE support.
(a8_branch_to_stub_data): New.
(make_branch_to_a8_stub): New.
(elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
* bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
(bfd_elf32_arm_set_target_relocs): Add argument for controlling
Cortex-A8 erratum workaround.
* bfd-in2.h: Regenerate.
ld/testsuite/
* ld-arm/cortex-a8-arm-target.s: New.
* ld-arm/cortex-a8-thumb-target.s: New.
* ld-arm/cortex-a8-fix-b-rel.s: New.
* ld-arm/cortex-a8-fix-b-rel-arm.d: New.
* ld-arm/cortex-a8-fix-b-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-b.s: New.
* ld-arm/cortex-a8-fix-b.d: New.
* ld-arm/cortex-a8-fix-bl-rel.s: New.
* ld-arm/cortex-a8-fix-bl-rel-arm.d: New.
* ld-arm/cortex-a8-fix-bl-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-bl.s: New.
* ld-arm/cortex-a8-fix-bl.d: New.
* ld-arm/cortex-a8-fix-bcc-rel.s: New.
* ld-arm/cortex-a8-fix-bcc-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-bcc.s: New.
* ld-arm/cortex-a8-fix-bcc.d: New.
* ld-arm/cortex-a8-fix-blx-rel.s: New.
* ld-arm/cortex-a8-fix-blx-rel-arm.d: New.
* ld-arm/cortex-a8-fix-blx-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-blx.s: New.
* ld-arm/cortex-a8-fix-blx.d: New.
* ld-arm/arm-elf.exp: Add new tests.
2009-05-22 13:58:45 +02:00
|
|
|
|
extern void bfd_elf32_arm_set_cortex_a8_fix
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
|
|
|
|
|
* bfd-in2.h: Regenerate.
* bfd-in.h (bfd_arm_vfp11_fix): New enum. Specify how VFP11
instruction scanning should be done.
(bfd_elf32_arm_init_maps, bfd_elf32_arm_vfp11_erratum_scan)
(bfd_elf32_arm_vfp11_fix_veneer_locations): Add prototypes.
(bfd_elf32_arm_set_target_relocs): Add vfp11 fix type argument to
prototype.
* elf-bfd.h (elf_backend_write_section): Add struct bfd_link_info
argument.
* elf32-arm.c (VFP11_ERRATUM_VENEER_SECTION_NAME)
(VFP11_ERRATUM_VENEER_ENTRY_NAME): Define macros.
(elf32_vfp11_erratum_type): New enum.
(elf32_vfp11_erratum_list): New struct. List of veneers or jumps to
veneers.
(_arm_elf_section_data): Add mapsize, erratumcount, erratumlist.
(elf32_arm_link_hash_table): Add vfp11_erratum_glue_size,
vfp11_fix and num_vfp11_fixes fields.
(elf32_arm_link_hash_table_create): Initialise vfp11_fix,
vfp11_erratum_glue_size, num_vfp11_fixes fields.
(VFP11_ERRATUM_VENEER_SIZE): Define. Size of an (ARM) veneer.
(bfd_elf32_arm_allocate_interworking_sections): Initialise erratum
glue section.
(elf32_arm_section_map_add): Add an code/data mapping symbol entry
to a section's map.
(record_vfp11_erratum_veneer): Create a single veneer, and its
associated symbols.
(bfd_elf32_arm_add_glue_sections_to_bfd): Add vfp11 erratum glue.
(bfd_elf32_arm_init_maps): Initialise mapping symbol table for input
BFDs.
(bfd_elf32_arm_set_vfp11_fix): Set the type of erratum workaround
required.
(bfd_arm_vfp11_pipe): Define VFP11 instruction pipes.
(bfd_arm_vfp11_regno): Recode a register number from a VFP11 insn.
(bfd_arm_vfp11_write_mask): Update write mask according to coded
register number.
(bfd_arm_vfp11_antidependency): New function.
(bfd_arm_vfp11_insn_decode): Decode a VFP11 insn.
(elf32_arm_compare_mapping): Declare.
(bfd_elf32_arm_vfp11_erratum_scan): Scan the sections of an input
BFD for potential erratum-triggering insns. Record results.
(bfd_elf32_arm_vfp11_fix_veneer_locations): Find out where veneers
and branches to veneers have been placed in virtual memory after
layout.
(bfd_elf32_arm_set_target_relocs): Set vfp11_fix field in global
hash table.
(elf32_arm_output_symbol_hook): Remove.
(elf32_arm_write_section): Output veneers, and branches to veneers.
Use maps from input sections, not output sections, for code
byte-swapping.
* elf32-ppc.c (ppc_elf_write_section): Add dummy link_info argument.
* elf32-score.c (_bfd_score_elf_write_section): Likewise.
* elfxx-mips.c (_bfd_mips_elf_write_section): Likewise.
* elfxx-mips.h (_bfd_mips_elf_write_section): Likewise.
2007-01-29 17:29:21 +01:00
|
|
|
|
extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
|
|
|
|
|
|
|
|
|
extern void bfd_elf32_arm_vfp11_fix_veneer_locations
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* ARM Interworking support. Called from linker. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_arm_allocate_interworking_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_link_info *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_arm_process_before_allocation
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_arm_get_bfd_for_interworking
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2000-03-01 21:39:07 +01:00
|
|
|
|
/* PE ARM Interworking support. Called from linker. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_link_info *);
|
2000-03-01 21:39:07 +01:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_arm_pe_process_before_allocation
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *, int);
|
2000-03-01 21:39:07 +01:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2000-03-01 21:39:07 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* ELF ARM Interworking support. Called from linker. */
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(struct bfd_link_info *);
|
1999-07-12 13:06:03 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_elf32_arm_process_before_allocation
|
2006-11-13 21:39:21 +01:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2004-09-17 14:35:00 +02:00
|
|
|
|
|
|
|
|
|
void bfd_elf32_arm_set_target_relocs
|
2007-03-20 15:24:57 +01:00
|
|
|
|
(bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
|
ld/
* emultempl/armelf.em (fix_cortex_a8): New.
(arm_elf_before_allocation): Call bfd_elf32_arm_set_cortex_a8_fix.
(arm_elf_create_output_section_statements): Add fix_cortex_a8 to
bfd_elf32_arm_set_target_relocs.
(OPTION_FIX_CORTEX_A8, OPTION_NO_FIX_CORTEX_A8): New.
(PARSE_AND_LIST_LONGOPTS): Add [no-]fix-cortex-a8 options.
(PARSE_AND_LIST_OPTIONS): Add [no-]fix-cortex-a8 options.
(PARSE_AND_LIST_ARGS_CASES): Handle OPTION_[NO_]FIX_CORTEX_A8.
* ld.texinfo (--[no-]fix-cortex-a8): Briefly document new options.
bfd/
* elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN):
New macros.
(elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
(elf32_arm_stub_a8_veneer_blx): New stub sequences.
(elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
(elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
(a8_erratum_fix, a8_erratum_reloc): New structs.
(elf32_arm_link_hash_table): Add a8_erratum_fixes,
num_a8_erratum_fixes, fix_cortex_a8 fields.
(elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
(elf32_arm_add_stub): Split into two parts, creating...
(elf32_arm_create_or_find_stub_sec): New function.
(elf32_arm_final_link_relocate): Add forward declaration.
(arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
relocations, multiple relocations per stub.
(find_stub_size_and_template): New (using parts of
arm_size_one_stub).
(arm_size_one_stub): Use find_stub_size_and_template.
(a8_reloc_compare): New.
(find_thumb_glue): Add forward declaration.
(cortex_a8_erratum_scan): New.
(elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
(bfd_elf32_arm_set_cortex_a8_fix): New.
(bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
(arm_map_one_stub): Add THUMB32_TYPE support.
(a8_branch_to_stub_data): New.
(make_branch_to_a8_stub): New.
(elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
* bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
(bfd_elf32_arm_set_target_relocs): Add argument for controlling
Cortex-A8 erratum workaround.
* bfd-in2.h: Regenerate.
ld/testsuite/
* ld-arm/cortex-a8-arm-target.s: New.
* ld-arm/cortex-a8-thumb-target.s: New.
* ld-arm/cortex-a8-fix-b-rel.s: New.
* ld-arm/cortex-a8-fix-b-rel-arm.d: New.
* ld-arm/cortex-a8-fix-b-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-b.s: New.
* ld-arm/cortex-a8-fix-b.d: New.
* ld-arm/cortex-a8-fix-bl-rel.s: New.
* ld-arm/cortex-a8-fix-bl-rel-arm.d: New.
* ld-arm/cortex-a8-fix-bl-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-bl.s: New.
* ld-arm/cortex-a8-fix-bl.d: New.
* ld-arm/cortex-a8-fix-bcc-rel.s: New.
* ld-arm/cortex-a8-fix-bcc-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-bcc.s: New.
* ld-arm/cortex-a8-fix-bcc.d: New.
* ld-arm/cortex-a8-fix-blx-rel.s: New.
* ld-arm/cortex-a8-fix-blx-rel-arm.d: New.
* ld-arm/cortex-a8-fix-blx-rel-thumb.d: New.
* ld-arm/cortex-a8-fix-blx.s: New.
* ld-arm/cortex-a8-fix-blx.d: New.
* ld-arm/arm-elf.exp: Add new tests.
2009-05-22 13:58:45 +02:00
|
|
|
|
int, int, int, int);
|
1999-07-12 13:06:03 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
|
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, struct bfd_link_info *);
|
2002-05-29 18:03:04 +02:00
|
|
|
|
|
2005-03-30 18:22:07 +02:00
|
|
|
|
/* ELF ARM mapping symbol support */
|
2006-05-15 21:57:35 +02:00
|
|
|
|
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
|
|
|
|
|
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
|
|
|
|
|
#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
|
|
|
|
|
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
|
|
|
|
|
extern bfd_boolean bfd_is_arm_special_symbol_name
|
|
|
|
|
(const char * name, int type);
|
2005-03-30 18:22:07 +02:00
|
|
|
|
|
2006-11-13 21:39:21 +01:00
|
|
|
|
extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
|
|
|
|
|
|
2003-04-01 15:08:06 +02:00
|
|
|
|
/* ARM Note section processing. */
|
|
|
|
|
extern bfd_boolean bfd_arm_merge_machines
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, bfd *);
|
2003-04-01 15:08:06 +02:00
|
|
|
|
|
|
|
|
|
extern bfd_boolean bfd_arm_update_notes
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, const char *);
|
2003-04-01 15:08:06 +02:00
|
|
|
|
|
|
|
|
|
extern unsigned int bfd_arm_get_mach_from_notes
|
2003-06-29 12:06:40 +02:00
|
|
|
|
(bfd *, const char *);
|
2003-04-01 15:08:06 +02:00
|
|
|
|
|
bfd/
* elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
(THM2_MAX_BWD_BRANCH_OFFSET): Define.
(ARM_MAX_FWD_BRANCH_OFFSET): Define.
(ARM_MAX_BWD_BRANCH_OFFSET): Define.
(THM_MAX_FWD_BRANCH_OFFSET): Define.
(THM_MAX_BWD_BRANCH_OFFSET): Define.
(arm_long_branch_stub): Define.
(arm_pic_long_branch_stub): Define.
(arm_thumb_v4t_long_branch_stub): Define.
(arm_thumb_thumb_long_branch_stub): Define.
(arm_thumb_arm_v4t_long_branch_stub): Define.
(STUB_SUFFIX): Define.
(elf32_arm_stub_type): Define.
(elf32_arm_stub_hash_entry): Define.
(elf32_arm_link_hash_entry): Add stub_cache field.
(arm_stub_hash_lookup): Define.
(elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
add_stub_section, layout_sections_again, stub_group, bfd_count,
top_index, input_list fields.
(elf32_arm_link_hash_newfunc): Init new field.
(stub_hash_newfunc): New function.
(elf32_arm_link_hash_table_create): Init stub_hash_table.
(elf32_arm_hash_table_free): New function.
(arm_type_of_stub): New function.
(elf32_arm_stub_name): New function.
(elf32_arm_get_stub_entry): New function.
(elf32_arm_stub_add_mapping_symbol): New function.
(elf32_arm_add_stub): New function.
(arm_build_one_stub): New function.
(arm_size_one_stub): New function.
(elf32_arm_setup_section_lists): New function.
(elf32_arm_next_input_section): New function.
(group_sections): New function.
(elf32_arm_size_stubs): New function.
(elf32_arm_build_stubs): New function.
(bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
(bfd_elf32_arm_process_before_allocation): No longer handle
R_ARM_CALL and R_ARM_THM_CALL.
(using_thumb_only): New function.
(elf32_arm_final_link_relocate): Redirect calls to stub if range
exceeds encoding capabilities.
(bfd_elf32_bfd_link_hash_table_free): Define.
* bfd-in.h (R_ARM_max): Fix value to 130.
(elf32_arm_setup_section_lists): Protype.
(elf32_arm_next_input_section): Protype.
(elf32_arm_size_stubs): Protype.
(elf32_arm_build_stubs): Protype.
ld/
* emultempl/armelf.em (build_section_lists): New function.
(stub_file): Define.
(need_laying_out): Define.
(group_size): Define.
(hook_stub_info): Define.
(hook_in_stub): New function.
(elf32_arm_add_stub_section): New function.
(gldarm_layout_sections_again): New function.
(gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate
stubs for long calls if needed.
(arm_elf_create_output_section_statements): create stub_file bfd.
(arm_for_each_input_file_wrapper): New function.
(arm_lang_for_each_input_file): New function.
(lang_for_each_input_file): Define.
(PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE.
(PARSE_AND_LIST_LONGOPTS): Add option stub-group-size.
(PARSE_AND_LIST_OPTIONS): Add option stub-group-size.
(PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case.
(LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish.
* ld/lang.c (print_input_statement): Skip if bfd has
BFD_LINKER_CREATED.
ld/testsuite
* ld-arm/arm-elf.exp (armelftests): Add farcall-arm-arm,
farcall-arm-arm-pic-veneer, farcall-arm-arm-be8 farcall-arm-thumb,
farcall-arm-thumb-blx, farcall-arm-thumb-pic-veneer,
farcall-arm-thumb-blx-pic-veneer, farcall-thumb-thumb,
farcall-thumb-thumb-pic-veneer, farcall-thumb-thumb-blx,
farcall-thumb-thumb-m, farcall-thumb-thumb-m-pic-veneer,
farcall-thumb-thumb-blx-pic-veneer, farcall-thumb-arm,
farcall-thumb-arm-pic-veneer, farcall-thumb-arm-blx,
farcall-thumb-arm-blx-pic-veneer.
Change thumb2-bl-as-thumb1-bad, thumb2-bl-bad.
* ld-arm/thumb2-bl-as-thumb1-bad.d: Reflects farcall stub
generation.
* ld-arm/thumb2-bl-bad.d: Likewise.
* ld-arm/thumb2-bl-as-thumb1-bad.s: Update comments.
* ld-arm/thumb2-bl-bad.s: Likewise.
2008-05-15 19:00:15 +02:00
|
|
|
|
/* ARM stub generation support. Called from the linker. */
|
|
|
|
|
extern int elf32_arm_setup_section_lists
|
|
|
|
|
(bfd *, struct bfd_link_info *);
|
|
|
|
|
extern void elf32_arm_next_input_section
|
|
|
|
|
(struct bfd_link_info *, struct bfd_section *);
|
|
|
|
|
extern bfd_boolean elf32_arm_size_stubs
|
|
|
|
|
(bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
|
|
|
|
|
struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void));
|
|
|
|
|
extern bfd_boolean elf32_arm_build_stubs
|
|
|
|
|
(struct bfd_link_info *);
|
2009-05-05 16:18:30 +02:00
|
|
|
|
|
|
|
|
|
/* ARM unwind section editing support. */
|
|
|
|
|
extern bfd_boolean elf32_arm_fix_exidx_coverage
|
2010-04-21 18:32:31 +02:00
|
|
|
|
(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
|
2009-05-05 16:18:30 +02:00
|
|
|
|
|
2009-11-18 13:42:52 +01:00
|
|
|
|
/* PowerPC @tls opcode transform/validate. */
|
|
|
|
|
extern unsigned int _bfd_elf_ppc_at_tls_transform
|
|
|
|
|
(unsigned int, unsigned int);
|
2010-01-25 07:47:16 +01:00
|
|
|
|
/* PowerPC @tprel opcode transform/validate. */
|
|
|
|
|
extern unsigned int _bfd_elf_ppc_at_tprel_transform
|
|
|
|
|
(unsigned int, unsigned int);
|
2009-11-18 13:42:52 +01:00
|
|
|
|
|
2000-11-09 00:57:04 +01:00
|
|
|
|
/* TI COFF load page support. */
|
2000-04-18 04:21:27 +02:00
|
|
|
|
extern void bfd_ticoff_set_section_load_page
|
2003-10-19 Andrew Cagney <cagney@redhat.com>
* targets.c: Replace "struct sec" with "struct bfd_section"
* syms.c, sparclynx.c, section.c, opncls.c: Ditto.
* libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
* elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
* aout-tic30.c, aout-target.h:
* bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
Index: binutils/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* coffgrok.h (coff_section): Replace 'struct sec" with "struct
bfd_section".
Index: gdb/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* symtab.c: Replace "struct sec" with "struct bfd_section".
* objfiles.c, linespec.c, blockframe.c, block.c: Ditto.
Index: ld/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* pe-dll.c: Replace "struct sec" with "struct bfd_section".
Index: sim/common/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* sim-base.h: Replace "struct sec" with "struct bfd_section".
2003-10-20 16:38:46 +02:00
|
|
|
|
(struct bfd_section *, int);
|
2000-04-18 04:21:27 +02:00
|
|
|
|
|
|
|
|
|
extern int bfd_ticoff_get_section_load_page
|
2003-10-19 Andrew Cagney <cagney@redhat.com>
* targets.c: Replace "struct sec" with "struct bfd_section"
* syms.c, sparclynx.c, section.c, opncls.c: Ditto.
* libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
* elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
* aout-tic30.c, aout-target.h:
* bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
Index: binutils/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* coffgrok.h (coff_section): Replace 'struct sec" with "struct
bfd_section".
Index: gdb/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* symtab.c: Replace "struct sec" with "struct bfd_section".
* objfiles.c, linespec.c, blockframe.c, block.c: Ditto.
Index: ld/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* pe-dll.c: Replace "struct sec" with "struct bfd_section".
Index: sim/common/ChangeLog
2003-10-19 Andrew Cagney <cagney@redhat.com>
* sim-base.h: Replace "struct sec" with "struct bfd_section".
2003-10-20 16:38:46 +02:00
|
|
|
|
(struct bfd_section *);
|
2003-05-21 02:57:20 +02:00
|
|
|
|
|
2003-07-11 16:59:41 +02:00
|
|
|
|
/* H8/300 functions. */
|
|
|
|
|
extern bfd_vma bfd_h8300_pad_address
|
|
|
|
|
(bfd *, bfd_vma);
|
|
|
|
|
|
2003-10-13 17:55:51 +02:00
|
|
|
|
/* IA64 Itanium code generation. Called from linker. */
|
|
|
|
|
extern void bfd_elf32_ia64_after_parse
|
|
|
|
|
(int);
|
|
|
|
|
|
|
|
|
|
extern void bfd_elf64_ia64_after_parse
|
|
|
|
|
(int);
|
|
|
|
|
|
2004-07-21 17:42:58 +02:00
|
|
|
|
/* This structure is used for a comdat section, as in PE. A comdat
|
|
|
|
|
section is associated with a particular symbol. When the linker
|
|
|
|
|
sees a comdat section, it keeps only one of the sections with a
|
|
|
|
|
given name and associated with a given symbol. */
|
|
|
|
|
|
|
|
|
|
struct coff_comdat_info
|
|
|
|
|
{
|
|
|
|
|
/* The name of the symbol associated with a comdat section. */
|
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
|
|
/* The local symbol table index of the symbol associated with a
|
|
|
|
|
comdat section. This is only meaningful to the object file format
|
|
|
|
|
specific code; it is not an index into the list returned by
|
|
|
|
|
bfd_canonicalize_symtab. */
|
|
|
|
|
long symbol;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern struct coff_comdat_info *bfd_coff_get_comdat_section
|
|
|
|
|
(bfd *, struct bfd_section *);
|
|
|
|
|
|