+2016-07-16 Alan Modra <amodra@gmail.com>
+
+ * libbfd-in.h (BFD_ALIGN): Move to..
+ * bfd-in.h: ..here.
+ * elf32-ppc.h (struct ppc_elf_params): Add pagesize.
+ * elf32-ppc.c (default_params): Adjust init.
+ (ppc_elf_link_params): Set pagesize_p2.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Regenerate.
+
2016-07-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
* elf-bfd.h (elf_backend_filter_implib_symbols): Declare backend hook.
} u; /* bfd* or file position. */
int namidx; /* Index into string table. */
};
-\f
+
/* Linenumber stuff. */
typedef struct lineno_cache_entry
{
alent;
\f
/* Object and core file sections. */
+typedef struct bfd_section *sec_ptr;
#define align_power(addr, align) \
(((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
-typedef struct bfd_section *sec_ptr;
+/* 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)
#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
} u; /* bfd* or file position. */
int namidx; /* Index into string table. */
};
-\f
+
/* Linenumber stuff. */
typedef struct lineno_cache_entry
{
alent;
\f
/* Object and core file sections. */
+typedef struct bfd_section *sec_ptr;
#define align_power(addr, align) \
(((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
-typedef struct bfd_section *sec_ptr;
+/* 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)
#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
ppc_elf_link_hash_table_create (bfd *abfd)
{
struct ppc_elf_link_hash_table *ret;
- static struct ppc_elf_params default_params = { PLT_OLD, 0, 1, 0, 0, 12, 0 };
+ static struct ppc_elf_params default_params
+ = { PLT_OLD, 0, 1, 0, 0, 12, 0, 0 };
ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table));
if (ret == NULL)
if (htab)
htab->params = params;
+ params->pagesize_p2 = bfd_log2 (params->pagesize);
}
/* Create .got and the related sections. */
/* The bfd backend detected a non-PIC reference to a protected symbol
defined in a shared library. */
int pic_fixup;
+
+ bfd_vma pagesize;
};
void ppc_elf_link_params (struct bfd_link_info *, struct ppc_elf_params *);
extern "C" {
#endif
-/* 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)
-
/* If you want to read and write large blocks, you might want to do it
in quanta of this amount */
#define DEFAULT_BUFFERSIZE 8192
extern "C" {
#endif
-/* 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)
-
/* If you want to read and write large blocks, you might want to do it
in quanta of this amount */
#define DEFAULT_BUFFERSIZE 8192
+2016-07-16 Alan Modra <amodra@gmail.com>
+
+ * ar.c: Don't include libbfd.h.
+ * objcopy.c: Likewise.
+ * bucomm.c (bfd_get_archive_filename): Use xmalloc rather than
+ bfd_malloc.
+
2016-07-15 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/remove-relocs-01.s: Use .dc.a, not .word.
#include "progress.h"
#include "getopt.h"
#include "aout/ar.h"
-#include "libbfd.h"
#include "bucomm.h"
#include "arsup.h"
#include "filenames.h"
if (curr)
free (buf);
curr = needed + (needed >> 1);
- buf = (char *) bfd_malloc (curr);
- /* If we can't malloc, fail safe by returning just the file name.
- This function is only used when building error messages. */
- if (!buf)
- {
- curr = 0;
- return bfd_get_filename (abfd);
- }
+ buf = (char *) xmalloc (curr);
}
sprintf (buf, "%s(%s)", bfd_get_filename (abfd->my_archive),
bfd_get_filename (abfd));
#include "filenames.h"
#include "fnmatch.h"
#include "elf-bfd.h"
-#include "libbfd.h"
#include "coff/internal.h"
#include "libcoff.h"
+2016-07-16 Alan Modra <amodra@gmail.com>
+
+ * config/bfin-parse.y: Don't include libbfd.h.
+ * config/tc-bfin.c: Likewise.
+ * config/tc-rl78.c: Likewise.
+ * config/tc-rx.c: Likewise.
+ * config/tc-metag.c: Likewise.
+ (create_dspreg_htabs, create_scond_htab): Use gas_assert not BFD_ASSERT.
+ * Makefile.am: Update dependencies.
+ * Makefile.in: Regenerate.
+
2016-07-14 Maciej W. Rozycki <macro@imgtec.com>
* config/tc-mips.h (TC_FORCE_RELOCATION_ABS): New macro.
bfin-parse.h: bfin-parse.c
bfin-parse.@OBJEXT@: bfin-parse.c \
$(srcdir)/config/bfin-aux.h $(srcdir)/config/bfin-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h
bfin-parse.h: ; @true
$(srcdir)/config/bfin-parse.h: ; @true
$(SHELL) $(YLWRAP) $(srcdir)/config/rl78-parse.y y.tab.c rl78-parse.c y.tab.h rl78-parse.h -- $(YACCCOMPILE) -d ;
rl78-parse.h: rl78-parse.c
rl78-parse.@OBJEXT@: rl78-parse.c rl78-parse.h $(srcdir)/config/rl78-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/rl78.h $(BFDDIR)/libbfd.h
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/rl78.h
rl78-defs.h: ; @true
$(SHELL) $(YLWRAP) $(srcdir)/config/rx-parse.y y.tab.c rx-parse.c y.tab.h rx-parse.h -- $(YACCCOMPILE) -d ;
rx-parse.h: rx-parse.c
rx-parse.@OBJEXT@: rx-parse.c rx-parse.h $(srcdir)/config/rx-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/rx.h $(BFDDIR)/libbfd.h
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/rx.h
rx-defs.h: ; @true
$(srcdir)/config/rx-defs.h: ; @true
bfin-parse.h: bfin-parse.c
bfin-parse.@OBJEXT@: bfin-parse.c \
$(srcdir)/config/bfin-aux.h $(srcdir)/config/bfin-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h
bfin-parse.h: ; @true
$(srcdir)/config/bfin-parse.h: ; @true
$(SHELL) $(YLWRAP) $(srcdir)/config/rl78-parse.y y.tab.c rl78-parse.c y.tab.h rl78-parse.h -- $(YACCCOMPILE) -d ;
rl78-parse.h: rl78-parse.c
rl78-parse.@OBJEXT@: rl78-parse.c rl78-parse.h $(srcdir)/config/rl78-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/rl78.h $(BFDDIR)/libbfd.h
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/rl78.h
rl78-defs.h: ; @true
$(SHELL) $(YLWRAP) $(srcdir)/config/rx-parse.y y.tab.c rx-parse.c y.tab.h rx-parse.h -- $(YACCCOMPILE) -d ;
rx-parse.h: rx-parse.c
rx-parse.@OBJEXT@: rx-parse.c rx-parse.h $(srcdir)/config/rx-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/rx.h $(BFDDIR)/libbfd.h
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/rx.h
rx-defs.h: ; @true
$(srcdir)/config/rx-defs.h: ; @true
#include "as.h"
#include "bfin-aux.h" /* Opcode generating auxiliaries. */
-#include "libbfd.h"
#include "elf/common.h"
#include "elf/bfin.h"
#ifdef OBJ_ELF
#include "dwarf2dbg.h"
#endif
-#include "libbfd.h"
#include "elf/common.h"
#include "elf/bfin.h"
#include "symcat.h"
#include "safe-ctype.h"
#include "hashtab.h"
-#include "libbfd.h"
#include <stdio.h>
/* Make sure there are no hash table collisions, which would
require chaining entries. */
- BFD_ASSERT (*slot == NULL);
+ gas_assert (*slot == NULL);
*slot = reg;
}
/* Make sure there are no hash table collisions, which would
require chaining entries. */
- BFD_ASSERT (*slot == NULL);
+ gas_assert (*slot == NULL);
*slot = reg;
}
}
scond, INSERT);
/* Make sure there are no hash table collisions, which would
require chaining entries. */
- BFD_ASSERT (*slot == NULL);
+ gas_assert (*slot == NULL);
*slot = scond;
}
}
#include "struc-symbol.h"
#include "safe-ctype.h"
#include "dwarf2dbg.h"
-#include "libbfd.h"
#include "elf/common.h"
#include "elf/rl78.h"
#include "rl78-defs.h"
#include "struc-symbol.h"
#include "safe-ctype.h"
#include "dwarf2dbg.h"
-#include "libbfd.h"
#include "elf/common.h"
#include "elf/rx.h"
#include "rx-defs.h"
+2016-07-16 Alan Modra <amodra@gmail.com>
+
+ * ldlang.c: Don't include libbfd.h.
+ * emultempl/nds32elf.em: Likewise.
+ * emultempl/ppc64elf.em: Likewise.
+ * emultempl/ppc32elf.em: Likewise.
+ (pagesize): Delete.
+ (params): Update init.
+ (ppc_after_open_output): Use params.pagesize. Don't call bfd_log2.
+ (PARSE_AND_LIST_ARGS_CASES): Use params.pagesize.
+ * emultempl/sh64elf.em: Don't include libbfd.h.
+ (after_allocation): Use ASSERT, not BFD_ASSERT.
+ * emultempl/xtensaelf.em: Don't include libbfd.h.
+ (replace_insn_sec_with_prop_sec): Use xmalloc, not bfd_malloc.
+ * Makefile.am: Update dependencies.
+ * Makefile.in: Regenerate.
+
2016-07-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
Nick Clifton <nickc@redhat.com>
eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh $(ELF_DEPS) \
$(srcdir)/emultempl/xtensaelf.em $(INCDIR)/xtensa-config.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/xtensa.h \
+ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/xtensa.h \
$(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshelf32.c: $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \
$(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
+ $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \
$(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh $(ELF_DEPS) \
$(srcdir)/emultempl/xtensaelf.em $(INCDIR)/xtensa-config.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/xtensa.h \
+ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/xtensa.h \
$(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshelf32.c: $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \
$(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
+ $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \
$(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/libiberty.h \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
fragment <<EOF
-#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/nds32.h"
#include "bfd_stdint.h"
#
fragment <<EOF
-#include "libbfd.h"
#include "elf32-ppc.h"
#include "ldlex.h"
#include "ldlang.h"
/* Choose the correct place for .got. */
static int old_got = 0;
-static bfd_vma pagesize = 0;
-
-static struct ppc_elf_params params = { PLT_UNSET, -1, 0, 0, 0, 0, 0 };
+static struct ppc_elf_params params = { PLT_UNSET, -1, 0, 0, 0, 0, 0, 0 };
static void
ppc_after_open_output (void)
if (params.emit_stub_syms < 0)
params.emit_stub_syms = (link_info.emitrelocations
|| bfd_link_pic (&link_info));
- if (pagesize == 0)
- pagesize = config.commonpagesize;
- params.pagesize_p2 = bfd_log2 (pagesize);
+ if (params.pagesize == 0)
+ params.pagesize = config.commonpagesize;
ppc_elf_link_params (&link_info, ¶ms);
}
if (optarg != NULL)
{
char *end;
- pagesize = strtoul (optarg, &end, 0);
+ params.pagesize = strtoul (optarg, &end, 0);
if (*end
- || (pagesize < 4096 && pagesize != 0)
- || pagesize != (pagesize & -pagesize))
+ || (params.pagesize < 4096 && params.pagesize != 0)
+ || params.pagesize != (params.pagesize & -params.pagesize))
einfo (_("%P%F: invalid pagesize `%s'\''\n"), optarg);
}
break;
fragment <<EOF
#include "ldctor.h"
-#include "libbfd.h"
#include "elf-bfd.h"
#include "elf64-ppc.h"
#include "ldlex.h"
fragment <<EOF
#include "libiberty.h"
-#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/sh.h"
#include "elf32-sh64.h"
{
oflags_isa = SHF_SH5_ISA32_MIXED;
- BFD_ASSERT (sh64_elf_section_data (osec)->sh64_info);
+ ASSERT (sh64_elf_section_data (osec)->sh64_info);
sh64_elf_section_data (osec)->sh64_info->contents_flags
= SHF_SH5_ISA32_MIXED;
if (cranges->contents != NULL)
free (cranges->contents);
- BFD_ASSERT (sh64_elf_section_data (cranges)->sh64_info != NULL);
+ ASSERT (sh64_elf_section_data (cranges)->sh64_info != NULL);
/* Make sure we have .cranges in memory even if there were only
assembler-generated .cranges. */
#include <xtensa-config.h>
#include "../bfd/elf-bfd.h"
-#include "../bfd/libbfd.h"
#include "elf/xtensa.h"
#include "bfd.h"
if (insn_sec->size != 0)
{
- insn_contents = (bfd_byte *) bfd_malloc (insn_sec->size);
- if (insn_contents == NULL)
- {
- *error_message = _("out of memory");
- goto cleanup;
- }
+ insn_contents = (bfd_byte *) xmalloc (insn_sec->size);
if (! bfd_get_section_contents (abfd, insn_sec, insn_contents,
(file_ptr) 0, insn_sec->size))
{
#include "fnmatch.h"
#include "demangle.h"
#include "hashtab.h"
-#include "libbfd.h"
#include "elf-bfd.h"
#ifdef ENABLE_PLUGINS
#include "plugin.h"