1999-05-03 15:29:11 +08:00
|
|
|
/* Main header file for the bfd library -- portable access to object files.
|
2003-02-28 05:24:36 +08:00
|
|
|
|
2024-01-04 19:52:08 +08:00
|
|
|
Copyright (C) 1990-2024 Free Software Foundation, Inc.
|
2003-02-28 05:24:36 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
Contributed by Cygnus Support.
|
|
|
|
|
2002-05-30 00:03:04 +08:00
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2002-05-30 00:03:04 +08: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 22:26:43 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-05-30 00:03:04 +08:00
|
|
|
(at your option) any later version.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2002-05-30 00:03:04 +08: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 15:29:11 +08:00
|
|
|
|
2002-05-30 00:03:04 +08: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 23:53:43 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
#ifndef __BFD_H_SEEN__
|
|
|
|
#define __BFD_H_SEEN__
|
|
|
|
|
2012-05-18 18:29:12 +08:00
|
|
|
/* PR 14072: Ensure that config.h is included first. */
|
|
|
|
#if !defined PACKAGE && !defined PACKAGE_VERSION
|
2012-05-17 23:13:28 +08:00
|
|
|
#error config.h must be included before this header
|
|
|
|
#endif
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ansidecl.h"
|
2001-10-02 13:58:41 +08:00
|
|
|
#include "symcat.h"
|
2021-03-31 07:37:02 +08:00
|
|
|
#include <stdint.h>
|
2021-03-31 07:49:10 +08:00
|
|
|
#include <stdbool.h>
|
2024-03-13 18:05:01 +08:00
|
|
|
#include <time.h>
|
2018-06-05 01:01:34 +08:00
|
|
|
#include "diagnostics.h"
|
2016-09-30 09:33:52 +08:00
|
|
|
#include <stdarg.h>
|
2021-03-31 07:32:08 +08:00
|
|
|
#include <string.h>
|
2011-10-24 19:23:40 +08:00
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2001-10-02 13:58:41 +08:00
|
|
|
#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 15:29:11 +08:00
|
|
|
|
2006-09-17 02:12:17 +08: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-26 05:01:55 +08:00
|
|
|
is error prone, so using this macro is safer. */
|
|
|
|
#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
|
2021-03-19 18:50:26 +08:00
|
|
|
|
2009-05-26 22:12:03 +08:00
|
|
|
#define BFD_SUPPORTS_PLUGINS @supports_plugins@
|
|
|
|
|
2001-08-17 11:54:53 +08: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 15:29:11 +08:00
|
|
|
#define BFD_ARCH_SIZE @wordsize@
|
2001-08-17 11:54:53 +08:00
|
|
|
|
|
|
|
/* The word size of the default bfd target. */
|
|
|
|
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
|
|
|
|
|
C99 bfd configury
Certain library headers and functions are required by C99. This
removes configure tests for them. The patch also removes AC_ISC_POSIX
and AC_HEADER_DIRENT, which the autoconf manual states are obsolescent.
sys/time.h is no longer tangled up with time.h so it can be handled by
the gprof configure.
* configure.ac: Don't check for long long or long double type.
Don't check for alloca.h, limits.h, stddef.h, stdlib.h, string.h,
strings.h, time.h, wchar.h, wctype.h or sys/time.h. Don't check
for strtoull, free, malloc, realloc, getenv, strstr, snprintf,
vsnprintf, strlen or setitimer. Sort AC_CHECK_DECLS.
(AC_ISC_POSIX): Don't invoke.
(AC_HEADER_TIME, AC_HEADER_DIRENT, ACX_HEADER_STRING): Likewise.
* sysdep.h: Remove many HAVE_*_H checks and fallback declarations.
Do test HAVE_SYS_TYPES_H. Don't include sys/time.h. Reorder
header order as per automake AC_INCLUDES_DEFAULT.
* bfd-in.h: Include inttypes.h unconditionally.
* bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Assume long long and
long double are available.
(bfd_scan_vma): Assume long long and strtoull are available.
* elflink.c: Include limits.h unconditionally.
* elfnn-riscv.c: Likewise.
* wasm-module.c: Likewise.
* hpux-core.c: Include dirent.h unconditionally.
* trad-core.c: Likewise.
* hosts/x86-64linux.h: Include stdlib.h unconditionally.
* peXXigen.c: Remove HAVE_WCHAR_H and HAVE_WCTYPE_H checks.
* elf32-m68hc1x.c: Don't include alloca-conf.h.
* elf64-hppa.c: Likewise.
* som.c: Likewise.
* wasm-module.c: Likewise.
* xsym.c: Likewise.
* bfd-in2.h: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
2021-04-05 13:57:37 +08:00
|
|
|
#include <inttypes.h>
|
%L conversions
* bfd-in.h: Include inttypes.h or if not available define
PRId64, PRIu64 and PRIx64.
* bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
modifier to print bfd_vma.
* coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
* coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
* compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
* elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
* elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
* elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
* elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
* elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
* elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
* elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
* elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
* elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
* elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
* peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
and cast input to uint64_t, and similarly for Ld and Lu.
* bfd-in2.h: Regenerate.
2018-02-19 16:04:15 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
#if BFD_ARCH_SIZE >= 64
|
|
|
|
#define BFD64
|
|
|
|
#endif
|
|
|
|
|
2021-03-31 07:49:10 +08:00
|
|
|
/* Boolean type used in bfd.
|
2002-12-08 11:34:38 +08:00
|
|
|
General rule: Functions which are bfd_boolean return TRUE on
|
2002-11-30 16:39:46 +08:00
|
|
|
success and FALSE on failure (unless they're a predicate). */
|
|
|
|
|
2021-03-31 07:49:10 +08:00
|
|
|
#ifdef POISON_BFD_BOOLEAN
|
2021-03-31 20:29:25 +08:00
|
|
|
# pragma GCC poison bfd_boolean
|
2021-03-31 07:49:10 +08:00
|
|
|
#else
|
|
|
|
# define bfd_boolean bool
|
|
|
|
# undef FALSE
|
|
|
|
# undef TRUE
|
|
|
|
# define FALSE 0
|
|
|
|
# define TRUE 1
|
|
|
|
#endif
|
2002-11-30 16:39:46 +08:00
|
|
|
|
2021-09-02 07:34:52 +08:00
|
|
|
/* Silence "applying zero offset to null pointer" UBSAN warnings. */
|
2021-10-24 17:57:06 +08:00
|
|
|
#define PTR_ADD(P,A) ((A) != 0 ? (P) + (A) : (P))
|
2021-09-02 07:34:52 +08:00
|
|
|
/* Also prevent non-zero offsets from being applied to a null pointer. */
|
2021-10-24 17:57:06 +08:00
|
|
|
#define NPTR_ADD(P,A) ((P) != NULL ? (P) + (A) : (P))
|
2021-09-02 07:34:52 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
#ifdef BFD64
|
|
|
|
|
2022-07-31 17:55:32 +08:00
|
|
|
/* 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. */
|
2022-05-27 11:07:21 +08:00
|
|
|
typedef uint64_t bfd_vma;
|
2022-07-31 17:55:32 +08:00
|
|
|
|
|
|
|
/* 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). */
|
2022-05-27 11:07:21 +08:00
|
|
|
typedef int64_t bfd_signed_vma;
|
2022-07-31 17:55:32 +08:00
|
|
|
|
2022-05-27 11:07:21 +08:00
|
|
|
typedef uint64_t bfd_size_type;
|
|
|
|
typedef uint64_t symvalue;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
#else /* not BFD64 */
|
|
|
|
|
2023-04-26 19:36:29 +08:00
|
|
|
typedef uint32_t bfd_vma;
|
|
|
|
typedef int32_t bfd_signed_vma;
|
|
|
|
typedef uint32_t bfd_size_type;
|
|
|
|
typedef uint32_t symvalue;
|
1999-05-03 15:29:11 +08: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 17:44:20 +08:00
|
|
|
#define HALF_BFD_SIZE_TYPE \
|
|
|
|
(((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
|
|
|
|
|
2004-02-17 02:46:40 +08: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;
|
2022-05-27 12:40:17 +08:00
|
|
|
typedef @bfd_ufile_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 17:57:26 +08:00
|
|
|
|
2023-04-26 19:36:29 +08:00
|
|
|
typedef uint32_t flagword; /* 32 bits of flags */
|
|
|
|
typedef uint8_t bfd_byte;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2023-04-30 19:12:30 +08:00
|
|
|
/* Forward declarations. */
|
|
|
|
typedef struct bfd bfd;
|
|
|
|
struct bfd_link_info;
|
|
|
|
struct bfd_link_hash_entry;
|
2016-07-16 11:55:11 +08:00
|
|
|
typedef struct bfd_section *sec_ptr;
|
2023-04-30 19:12:30 +08:00
|
|
|
typedef struct reloc_cache_entry arelent;
|
|
|
|
struct orl;
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
#define align_power(addr, align) \
|
2015-11-10 00:12:56 +08:00
|
|
|
(((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2016-07-16 11:55:11 +08:00
|
|
|
/* Align an address upward to a boundary, expressed as a number of bytes.
|
|
|
|
E.g. align to an 8-byte boundary with argument of 8. Take care never
|
|
|
|
to wrap around if the address is within boundary-1 of the end of the
|
|
|
|
address space. */
|
|
|
|
#define BFD_ALIGN(this, boundary) \
|
|
|
|
((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
|
|
|
|
? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
|
|
|
|
: ~ (bfd_vma) 0)
|
2021-03-19 15:09:24 +08:00
|
|
|
|
|
|
|
/* Return TRUE if the start of STR matches PREFIX, FALSE otherwise. */
|
|
|
|
|
Use bool in bfd
* sysdep.h: POISON_BFD_BOOLEAN: Define.
* aix5ppc-core.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h,
* aoutx.h, * arc-got.h, * archive.c, * archive64.c, * archures.c,
* bfd-in.h, * bfd.c, * bfdwin.c, * binary.c, * cache.c,
* coff-alpha.c, * coff-arm.c, * coff-arm.h, * coff-bfd.c,
* coff-bfd.h, * coff-go32.c, * coff-i386.c, * coff-ia64.c,
* coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c,
* coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c,
* coffcode.h, * coffgen.c, * cofflink.c, * compress.c,
* corefile.c, * cpu-aarch64.c, * cpu-aarch64.h, * cpu-alpha.c,
* cpu-arc.c, * cpu-arm.c, * cpu-arm.h, * cpu-avr.c, * cpu-bfin.c,
* cpu-bpf.c, * cpu-cr16.c, * cpu-cris.c, * cpu-crx.c,
* cpu-csky.c, * cpu-d10v.c, * cpu-d30v.c, * cpu-dlx.c,
* cpu-epiphany.c, * cpu-fr30.c, * cpu-frv.c, * cpu-ft32.c,
* cpu-h8300.c, * cpu-hppa.c, * cpu-i386.c, * cpu-ia64.c,
* cpu-iamcu.c, * cpu-ip2k.c, * cpu-iq2000.c, * cpu-k1om.c,
* cpu-l1om.c, * cpu-lm32.c, * cpu-m10200.c, * cpu-m10300.c,
* cpu-m32c.c, * cpu-m32r.c, * cpu-m68hc11.c, * cpu-m68hc12.c,
* cpu-m68k.c, * cpu-m9s12x.c, * cpu-m9s12xg.c, * cpu-mcore.c,
* cpu-mep.c, * cpu-metag.c, * cpu-microblaze.c, * cpu-mips.c,
* cpu-mmix.c, * cpu-moxie.c, * cpu-msp430.c, * cpu-mt.c,
* cpu-nds32.c, * cpu-nfp.c, * cpu-nios2.c, * cpu-ns32k.c,
* cpu-or1k.c, * cpu-pdp11.c, * cpu-pj.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-riscv.c, * cpu-rl78.c, * cpu-rs6000.c,
* cpu-rx.c, * cpu-s12z.c, * cpu-s390.c, * cpu-score.c,
* cpu-sh.c, * cpu-sparc.c, * cpu-spu.c, * cpu-tic30.c,
* cpu-tic4x.c, * cpu-tic54x.c, * cpu-tic6x.c, * cpu-tilegx.c,
* cpu-tilepro.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-vax.c,
* cpu-visium.c, * cpu-wasm32.c, * cpu-xc16x.c, * cpu-xgate.c,
* cpu-xstormy16.c, * cpu-xtensa.c, * cpu-z80.c, * cpu-z8k.c,
* dwarf1.c, * dwarf2.c, * ecoff-bfd.h, * ecoff.c, * ecofflink.c,
* elf-attrs.c, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-nacl.c,
* elf-nacl.h, * elf-properties.c, * elf-s390-common.c,
* elf-s390.h, * elf-strtab.c, * elf-vxworks.c, * elf-vxworks.h,
* elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c,
* elf32-arm.h, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c,
* elf32-bfin.h, * elf32-cr16.c, * elf32-cr16.h, * elf32-cris.c,
* elf32-crx.c, * elf32-csky.c, * elf32-csky.h, * elf32-d10v.c,
* elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
* elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-hppa.h, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
* elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c,
* elf32-m68k.h, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
* elf32-metag.h, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-nios2.h, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c,
* elf32-score.h, * elf32-score7.c, * elf32-sh-relocs.h,
* elf32-sh.c, * elf32-sparc.c, * elf32-spu.c, * elf32-spu.h,
* elf32-tic6x.c, * elf32-tic6x.h, * elf32-tilegx.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-v850.h,
* elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
* elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
* elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c,
* elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c,
* elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c,
* elf64-ppc.h, * elf64-s390.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-x86-64.c, * elfcode.h,
* elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c,
* elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c,
* elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h,
* elfxx-mips.c, * elfxx-mips.h, * elfxx-riscv.c, * elfxx-riscv.h,
* elfxx-sparc.c, * elfxx-sparc.h, * elfxx-target.h,
* elfxx-tilegx.c, * elfxx-tilegx.h, * elfxx-x86.c, * elfxx-x86.h,
* format.c, * genlink.h, * hash.c, * i386aout.c, * i386lynx.c,
* i386msdos.c, * ihex.c, * libaout.h, * libbfd-in.h,
* libbfd.c, * libcoff-in.h, * libecoff.h, * libpei.h,
* libxcoff.h, * linker.c, * mach-o-aarch64.c, * mach-o-arm.c,
* mach-o-i386.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h,
* merge.c, * mmo.c, * netbsd.h, * opncls.c, * pc532-mach.c,
* pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-sh.c,
* pe-x86_64.c, * peXXigen.c, * pef.c, * pei-arm.c, * pei-i386.c,
* pei-ia64.c, * pei-mcore.c, * pei-sh.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * plugin.h, * ppcboot.c, * reloc.c,
* reloc16.c, * rs6000-core.c, * section.c, * simple.c, * som.c,
* som.h, * srec.c, * stabs.c, * syms.c, * targets.c, * tekhex.c,
* verilog.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * vms.h,
* wasm-module.c, * xcofflink.c, * xcofflink.h, * xsym.c,
* xsym.h: Replace bfd_boolean with bool, FALSE with false, and
TRUE with true throughout.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2021-03-31 08:00:54 +08:00
|
|
|
static inline bool
|
2021-03-19 15:09:24 +08:00
|
|
|
startswith (const char *str, const char *prefix)
|
|
|
|
{
|
|
|
|
return strncmp (str, prefix, strlen (prefix)) == 0;
|
|
|
|
}
|
2023-04-30 19:12:30 +08:00
|
|
|
|