Import GDB 6.5

This commit is contained in:
nathanw 2006-07-02 20:11:53 +00:00
parent a2847deb82
commit c8002faec9
1102 changed files with 88863 additions and 45191 deletions

View File

@ -4,7 +4,7 @@ AutoGen definitions Makefile.tpl;
// Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
// This file was originally written by Nathanael Nerode.
//
// Copyright 2002, 2003 Free Software Foundation
// Copyright 2002, 2003, 2004, 2005, 2006 Free Software Foundation
//
// This file is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -75,6 +75,7 @@ host_modules= { module= tcl;
host_modules= { module= itcl; };
host_modules= { module= ld; bootstrap=true; };
host_modules= { module= libcpp; bootstrap=true; };
host_modules= { module= libdecnumber; bootstrap=true; };
host_modules= { module= libgui; };
host_modules= { module= libiberty; bootstrap=true; };
host_modules= { module= libtool; };
@ -116,6 +117,7 @@ host_modules= { module= gnattools; };
target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; };
target_modules = { module= libmudflap; lib_path=.libs; };
target_modules = { module= libssp; lib_path=.libs; };
target_modules = { module= libgcc-math; lib_path=.libs; };
target_modules = { module= newlib; };
target_modules = { module= libgfortran; };
target_modules = { module= libobjc; };
@ -136,6 +138,7 @@ target_modules = { module= boehm-gc; };
target_modules = { module= qthreads; };
target_modules = { module= rda; };
target_modules = { module= libada; };
target_modules = { module= libgomp; lib_path=.libs; };
// These are (some of) the make targets to be done in each subdirectory.
// Not all; these are the ones which don't have special options.
@ -152,6 +155,9 @@ recursive_targets = { make_target= TAGS;
recursive_targets = { make_target= install-info;
depend=configure;
depend=info; };
recursive_targets = { make_target= install-html;
depend=configure;
depend=html; };
recursive_targets = { make_target= installcheck;
depend=configure; };
recursive_targets = { make_target= mostlyclean; };
@ -169,7 +175,10 @@ flags_to_pass = { flag= bindir ; };
flags_to_pass = { flag= datadir ; };
flags_to_pass = { flag= exec_prefix ; };
flags_to_pass = { flag= includedir ; };
flags_to_pass = { flag= datarootdir ; };
flags_to_pass = { flag= docdir ; };
flags_to_pass = { flag= infodir ; };
flags_to_pass = { flag= htmldir ; };
flags_to_pass = { flag= libdir ; };
flags_to_pass = { flag= libexecdir ; };
flags_to_pass = { flag= lispdir ; };
@ -204,12 +213,18 @@ flags_to_pass = { flag= SHELL ; };
flags_to_pass = { flag= YACC ; };
// Host tools
flags_to_pass = { flag= ADAFLAGS ; optional=true ; };
flags_to_pass = { flag= AR_FLAGS ; };
flags_to_pass = { flag= BOOT_ADAFLAGS ; optional=true ; };
flags_to_pass = { flag= BOOT_CFLAGS ; };
flags_to_pass = { flag= BOOT_LDFLAGS ; };
flags_to_pass = { flag= CFLAGS ; };
flags_to_pass = { flag= CXXFLAGS ; };
flags_to_pass = { flag= LDFLAGS ; };
flags_to_pass = { flag= LIBCFLAGS ; };
flags_to_pass = { flag= LIBCXXFLAGS ; };
flags_to_pass = { flag= STAGE1_CFLAGS ; };
flags_to_pass = { flag= STAGE1_LANGUAGES ; };
// Target tools
flags_to_pass = { flag= AR_FOR_TARGET ; };
@ -233,6 +248,10 @@ flags_to_pass = { flag= RANLIB_FOR_TARGET ; };
flags_to_pass = { flag= STRIP_FOR_TARGET ; };
flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
// Miscellaneous
flags_to_pass = { flag= LANGUAGES ; optional=true ; };
flags_to_pass = { flag= LEAN ; };
// Inter-module dependencies
// Build modules
@ -261,6 +280,7 @@ dependencies = { module=all-gcc; on=all-build-libiberty; };
dependencies = { module=all-gcc; on=all-build-fixincludes; };
dependencies = { module=all-gcc; on=all-zlib; };
dependencies = { module=all-gcc; on=all-libcpp; hard=true; };
dependencies = { module=all-gcc; on=all-libdecnumber; hard=true; };
dependencies = { module=all-gcc; on=all-libiberty; };
dependencies = { module=all-gcc; on=all-fixincludes; };
dependencies = { module=install-gcc ; on=install-fixincludes; };
@ -275,9 +295,6 @@ dependencies = { module=all-fixincludes; on=all-libiberty; };
dependencies = { module=all-gnattools; on=all-target-libada; };
// Host modules specific to gdb.
dependencies = { module=configure-gdb; on=configure-itcl; };
dependencies = { module=configure-gdb; on=configure-tcl; };
dependencies = { module=configure-gdb; on=configure-tk; };
dependencies = { module=configure-gdb; on=configure-sim; };
dependencies = { module=all-gdb; on=all-libiberty; };
dependencies = { module=all-gdb; on=all-opcodes; };
@ -286,10 +303,6 @@ dependencies = { module=all-gdb; on=all-readline; };
dependencies = { module=all-gdb; on=all-build-bison; };
dependencies = { module=all-gdb; on=all-build-byacc; };
dependencies = { module=all-gdb; on=all-sim; };
dependencies = { module=install-gdb; on=install-tcl; };
dependencies = { module=install-gdb; on=install-tk; };
dependencies = { module=install-gdb; on=install-itcl; };
dependencies = { module=install-gdb; on=install-libgui; };
dependencies = { module=configure-libgui; on=configure-tcl; };
dependencies = { module=configure-libgui; on=configure-tk; };
@ -457,7 +470,7 @@ bootstrap_stage = {
id=1 ;
stage_configure_flags='--disable-intermodule \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ;
stage_make_flags='CFLAGS="$(STAGE1_CFLAGS)"' ; };
stage_make_flags='CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)"' ; };
bootstrap_stage = {
id=2 ; prev=1 ;
bootstrap_target=bootstrap2 ;

11744
gnu/dist/gdb6/Makefile.in vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5063
gnu/dist/gdb6/bfd/ChangeLog-2004 vendored Normal file

File diff suppressed because it is too large Load Diff

5269
gnu/dist/gdb6/bfd/ChangeLog-2005 vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,14 @@ MKDEP = gcc -MM
SUBDIRS = doc po
docdir = doc
bfddocdir = doc
bfdlibdir = @bfdlibdir@
bfdincludedir = @bfdincludedir@
datarootdir = @datarootdir@
docdir = @docdir@
htmldir = @htmldir@
bfdlib_LTLIBRARIES = libbfd.la
WARN_CFLAGS = @WARN_CFLAGS@
@ -89,7 +93,7 @@ ALL_MACHINES = \
cpu-mcore.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-ms1.lo \
cpu-mt.lo \
cpu-msp430.lo \
cpu-or32.lo \
cpu-ns32k.lo \
@ -111,6 +115,7 @@ ALL_MACHINES = \
cpu-w65.lo \
cpu-xstormy16.lo \
cpu-xtensa.lo \
cpu-xc16x.lo \
cpu-z80.lo \
cpu-z8k.lo
@ -150,7 +155,7 @@ ALL_MACHINES_CFILES = \
cpu-mcore.c \
cpu-mips.c \
cpu-mmix.c \
cpu-ms1.c \
cpu-mt.c \
cpu-msp430.c \
cpu-or32.c \
cpu-ns32k.c \
@ -172,6 +177,7 @@ ALL_MACHINES_CFILES = \
cpu-w65.c \
cpu-xstormy16.c \
cpu-xtensa.c \
cpu-xc16x.c \
cpu-z80.c \
cpu-z8k.c
@ -258,7 +264,7 @@ BFD32_BACKENDS = \
elf32-mcore.lo \
elfxx-mips.lo \
elf32-mips.lo \
elf32-ms1.lo \
elf32-mt.lo \
elf32-msp430.lo \
elf32-openrisc.lo \
elf32-or32.lo \
@ -275,6 +281,7 @@ BFD32_BACKENDS = \
elf32-vax.lo \
elf32-xstormy16.lo \
elf32-xtensa.lo \
elf32-xc16x.lo \
elf32.lo \
elflink.lo \
elf-strtab.lo \
@ -429,7 +436,7 @@ BFD32_BACKENDS_CFILES = \
elf32-mcore.c \
elfxx-mips.c \
elf32-mips.c \
elf32-ms1.c \
elf32-mt.c \
elf32-msp430.c \
elf32-openrisc.c \
elf32-or32.c \
@ -446,6 +453,7 @@ BFD32_BACKENDS_CFILES = \
elf32-vax.c \
elf32-xstormy16.c \
elf32-xtensa.c \
elf32-xc16x.c \
elf32.c \
elflink.c \
elf-strtab.c \
@ -657,6 +665,35 @@ po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
all diststuff: info
.PHONY: install-html install-html-am install-html-recursive
install-html: install-html-recursive
install-html-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
# Various kinds of .o files to put in libbfd.a:
# BFD_BACKENDS Routines the configured targets need.
# BFD_MACHINES Architecture-specific routines the configured targets need.
@ -855,12 +892,12 @@ LIBCOFF_H_FILES = libcoff-in.h coffcode.h
# Could really use a "copy-if-change"...
headers:
(cd $(docdir); $(MAKE) protos $(FLAGS_TO_PASS))
cp $(docdir)/bfd.h bfd-in2.h-new
(cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
cp $(bfddocdir)/bfd.h bfd-in2.h-new
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
cp $(docdir)/libbfd.h libbfd.h-new
cp $(bfddocdir)/libbfd.h libbfd.h-new
$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
cp $(docdir)/libcoff.h libcoff.h-new
cp $(bfddocdir)/libcoff.h libcoff.h-new
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
# We only rebuild the header files automatically if we have been
@ -868,22 +905,22 @@ headers:
$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
cp $(docdir)/bfd.h bfd-in2.h-new
(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
cp $(bfddocdir)/bfd.h bfd-in2.h-new
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
touch stmp-bin2-h
$(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
stmp-lbfd-h: $(LIBBFD_H_FILES)
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
cp $(docdir)/libbfd.h libbfd.h-new
(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
cp $(bfddocdir)/libbfd.h libbfd.h-new
$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
touch stmp-lbfd-h
$(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
stmp-lcoff-h: $(LIBCOFF_H_FILES)
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
cp $(docdir)/libcoff.h libcoff.h-new
(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
cp $(bfddocdir)/libcoff.h libcoff.h-new
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
touch stmp-lcoff-h
@ -996,7 +1033,8 @@ cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/opcode/m68k.h
cpu-m88k.lo: cpu-m88k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1004,7 +1042,7 @@ cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-ms1.lo: cpu-ms1.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-msp430.lo: cpu-msp430.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-or32.lo: cpu-or32.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
@ -1032,6 +1070,7 @@ cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-xtensa.lo: cpu-xtensa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-xc16x.lo: cpu-xc16x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-z80.lo: cpu-z80.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
@ -1088,8 +1127,7 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \
@ -1214,10 +1252,11 @@ elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
elf32-target.h
elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/arm.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf-vxworks.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \
@ -1225,7 +1264,8 @@ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \
elf32-target.h
elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \
$(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \
@ -1308,7 +1348,8 @@ elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68k.h \
elf32-target.h
elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \
@ -1342,18 +1383,18 @@ elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
ecoffswap.h elf32-target.h
elf32-ms1.lo: elf32-ms1.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/ms1.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \
$(INCDIR)/libiberty.h $(INCDIR)/hashtab.h elf-bfd.h \
@ -1406,15 +1447,15 @@ elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \
$(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
elf32-target.h
elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h elf32-target.h
elfxx-sparc.h elf-vxworks.h elf32-target.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
@ -1434,13 +1475,18 @@ elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/filenames.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/xtensa.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/xtensa-isa.h \
$(INCDIR)/xtensa-config.h elf32-target.h
elf32-xc16x.lo: elf32-xc16x.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/elf/dwarf2.h $(INCDIR)/libiberty.h elf32-target.h
elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h
elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/libiberty.h
$(INCDIR)/libiberty.h $(INCDIR)/objalloc.h
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h
@ -1779,12 +1825,12 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
$(INCDIR)/hashtab.h elf32-target.h
elf32-target.h
elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
$(INCDIR)/hashtab.h elf64-target.h
elf64-target.h
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h

View File

@ -217,6 +217,8 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
@ -224,6 +226,7 @@ host_cpu = @host_cpu@
host_noncanonical = @host_noncanonical@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@ -255,7 +258,7 @@ INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
MKDEP = gcc -MM
SUBDIRS = doc po
docdir = doc
bfddocdir = doc
bfdlib_LTLIBRARIES = libbfd.la
AM_CFLAGS = $(WARN_CFLAGS)
@ -326,7 +329,7 @@ ALL_MACHINES = \
cpu-mcore.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-ms1.lo \
cpu-mt.lo \
cpu-msp430.lo \
cpu-or32.lo \
cpu-ns32k.lo \
@ -348,6 +351,7 @@ ALL_MACHINES = \
cpu-w65.lo \
cpu-xstormy16.lo \
cpu-xtensa.lo \
cpu-xc16x.lo \
cpu-z80.lo \
cpu-z8k.lo
@ -387,7 +391,7 @@ ALL_MACHINES_CFILES = \
cpu-mcore.c \
cpu-mips.c \
cpu-mmix.c \
cpu-ms1.c \
cpu-mt.c \
cpu-msp430.c \
cpu-or32.c \
cpu-ns32k.c \
@ -409,6 +413,7 @@ ALL_MACHINES_CFILES = \
cpu-w65.c \
cpu-xstormy16.c \
cpu-xtensa.c \
cpu-xc16x.c \
cpu-z80.c \
cpu-z8k.c
@ -496,7 +501,7 @@ BFD32_BACKENDS = \
elf32-mcore.lo \
elfxx-mips.lo \
elf32-mips.lo \
elf32-ms1.lo \
elf32-mt.lo \
elf32-msp430.lo \
elf32-openrisc.lo \
elf32-or32.lo \
@ -513,6 +518,7 @@ BFD32_BACKENDS = \
elf32-vax.lo \
elf32-xstormy16.lo \
elf32-xtensa.lo \
elf32-xc16x.lo \
elf32.lo \
elflink.lo \
elf-strtab.lo \
@ -667,7 +673,7 @@ BFD32_BACKENDS_CFILES = \
elf32-mcore.c \
elfxx-mips.c \
elf32-mips.c \
elf32-ms1.c \
elf32-mt.c \
elf32-msp430.c \
elf32-openrisc.c \
elf32-or32.c \
@ -684,6 +690,7 @@ BFD32_BACKENDS_CFILES = \
elf32-vax.c \
elf32-xstormy16.c \
elf32-xtensa.c \
elf32-xc16x.c \
elf32.c \
elflink.c \
elf-strtab.c \
@ -1261,6 +1268,35 @@ po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
all diststuff: info
.PHONY: install-html install-html-am install-html-recursive
install-html: install-html-recursive
install-html-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
stamp-ofiles: Makefile
rm -f tofiles
f=""; \
@ -1429,12 +1465,12 @@ stmp-bfd-h: bfd-in3.h
# Could really use a "copy-if-change"...
headers:
(cd $(docdir); $(MAKE) protos $(FLAGS_TO_PASS))
cp $(docdir)/bfd.h bfd-in2.h-new
(cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
cp $(bfddocdir)/bfd.h bfd-in2.h-new
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
cp $(docdir)/libbfd.h libbfd.h-new
cp $(bfddocdir)/libbfd.h libbfd.h-new
$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
cp $(docdir)/libcoff.h libcoff.h-new
cp $(bfddocdir)/libcoff.h libcoff.h-new
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
# We only rebuild the header files automatically if we have been
@ -1442,22 +1478,22 @@ headers:
$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
cp $(docdir)/bfd.h bfd-in2.h-new
(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
cp $(bfddocdir)/bfd.h bfd-in2.h-new
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
touch stmp-bin2-h
$(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
stmp-lbfd-h: $(LIBBFD_H_FILES)
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
cp $(docdir)/libbfd.h libbfd.h-new
(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
cp $(bfddocdir)/libbfd.h libbfd.h-new
$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
touch stmp-lbfd-h
$(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
stmp-lcoff-h: $(LIBCOFF_H_FILES)
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
cp $(docdir)/libcoff.h libcoff.h-new
(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
cp $(bfddocdir)/libcoff.h libcoff.h-new
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
touch stmp-lcoff-h
@ -1563,7 +1599,8 @@ cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/opcode/m68k.h
cpu-m88k.lo: cpu-m88k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1571,7 +1608,7 @@ cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-ms1.lo: cpu-ms1.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-msp430.lo: cpu-msp430.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-or32.lo: cpu-or32.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
@ -1599,6 +1636,7 @@ cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-xtensa.lo: cpu-xtensa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-xc16x.lo: cpu-xc16x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-z80.lo: cpu-z80.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
@ -1655,8 +1693,7 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \
@ -1781,10 +1818,11 @@ elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
elf32-target.h
elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/arm.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf-vxworks.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \
@ -1792,7 +1830,8 @@ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \
elf32-target.h
elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \
$(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \
@ -1875,7 +1914,8 @@ elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68k.h \
elf32-target.h
elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \
@ -1909,18 +1949,18 @@ elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
ecoffswap.h elf32-target.h
elf32-ms1.lo: elf32-ms1.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/ms1.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \
$(INCDIR)/libiberty.h $(INCDIR)/hashtab.h elf-bfd.h \
@ -1973,15 +2013,15 @@ elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \
$(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
elf32-target.h
elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h elf32-target.h
elfxx-sparc.h elf-vxworks.h elf32-target.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
@ -2001,13 +2041,18 @@ elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/filenames.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/xtensa.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/xtensa-isa.h \
$(INCDIR)/xtensa-config.h elf32-target.h
elf32-xc16x.lo: elf32-xc16x.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/elf/dwarf2.h $(INCDIR)/libiberty.h elf32-target.h
elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h
elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/libiberty.h
$(INCDIR)/libiberty.h $(INCDIR)/objalloc.h
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h
@ -2346,12 +2391,12 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
$(INCDIR)/hashtab.h elf32-target.h
elf32-target.h
elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
$(INCDIR)/hashtab.h elf64-target.h
elf64-target.h
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h

View File

@ -204,14 +204,7 @@ aix386_core_file_failing_signal (abfd)
return core_hdr (abfd)->cd_cursig;
}
static bfd_boolean
aix386_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
/* FIXME: We have no way of telling at this point. */
return TRUE;
}
#define aix386_core_file_matches_executable_p generic_core_file_matches_executable_p
/* If somebody calls any byte-swapping routines, shoot them. */

View File

@ -23,16 +23,16 @@
#include "bfd.h"
#ifdef AIX_5_CORE
#include "sysdep.h"
#include "libbfd.h"
const bfd_target *xcoff64_core_p (bfd *);
bfd_boolean xcoff64_core_file_matches_executable_p (bfd *, bfd *);
char *xcoff64_core_file_failing_command (bfd *);
int xcoff64_core_file_failing_signal (bfd *);
#ifdef AIX_5_CORE
#include "sysdep.h"
#include "libbfd.h"
/* Aix 5.1 system include file. */
/* Need to define this macro so struct ld_info64 get included. */
@ -318,11 +318,6 @@ xcoff64_core_file_failing_signal (bfd *abfd)
#else /* AIX_5_CORE */
const bfd_target *xcoff64_core_p (bfd *);
bfd_boolean xcoff64_core_file_matches_executable_p (bfd *, bfd *);
char *xcoff64_core_file_failing_command (bfd *);
int xcoff64_core_file_failing_signal (bfd *);
const bfd_target *
xcoff64_core_p (bfd *abfd ATTRIBUTE_UNUSED)
{
@ -331,10 +326,9 @@ xcoff64_core_p (bfd *abfd ATTRIBUTE_UNUSED)
}
bfd_boolean
xcoff64_core_file_matches_executable_p (bfd *core_bfd ATTRIBUTE_UNUSED,
bfd *exec_bfd ATTRIBUTE_UNUSED)
xcoff64_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
{
return FALSE;
return generic_core_file_matches_executable_p (core_bfd, exec_bfd);
}
char *

View File

@ -274,11 +274,8 @@ MY_swap_std_reloc_out (bfd *abfd,
int r_index;
asymbol *sym = *(g->sym_ptr_ptr);
int r_extern;
unsigned int r_addend;
asection *output_section = sym->section->output_section;
r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
/* Name was clobbered by aout_write_syms to be symbol index. */
/* If this relocation is relative to a symbol then set the
@ -341,7 +338,6 @@ _bfd_ns32k_relocate_contents (reloc_howto_type *howto,
case 2:
return _bfd_relocate_contents (howto, input_bfd, relocation,
location);
break;
default:
return bfd_reloc_notsupported;
}

View File

@ -286,7 +286,7 @@ struct external_sparc_core
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SPARC_CORE_LEN 432
int c_regs[19]; /* General purpose registers -- MACHDEP SIZE. */
struct regs c_regs; /* General purpose registers -- MACHDEP SIZE. */
struct external_exec c_aouthdr; /* A.out header. */
int c_signo; /* Killing signal, if any. */
int c_tsize; /* Text size (bytes). */
@ -309,7 +309,7 @@ struct external_solaris_bcp_core
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SOLARIS_BCP_CORE_LEN 456
int c_regs[19]; /* General purpose registers -- MACHDEP SIZE. */
struct regs c_regs; /* General purpose registers -- MACHDEP SIZE. */
int c_exdata_vp; /* Exdata structure. */
int c_exdata_tsize;
int c_exdata_dsize;
@ -387,7 +387,7 @@ swapcore_sun3 (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
intcore->c_regs_pos = (long) (((struct external_sun3_core *) 0)->c_regs);
intcore->c_regs_pos = offsetof (struct external_sun3_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
#if ARCH_SIZE == 64
aout_64_swap_exec_header_in
@ -401,10 +401,10 @@ swapcore_sun3 (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = (long) (((struct external_sun3_core *) 0)->fp_stuff);
intcore->fp_stuff_pos = offsetof (struct external_sun3_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
(file_ptr) (((struct external_sun3_core *) 0)->fp_stuff);
offsetof (struct external_sun3_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end. */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
@ -422,7 +422,7 @@ swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
intcore->c_regs_pos = (long) (((struct external_sparc_core *) 0)->c_regs);
intcore->c_regs_pos = offsetof (struct external_sparc_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
#if ARCH_SIZE == 64
aout_64_swap_exec_header_in
@ -436,10 +436,10 @@ swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = (long) (((struct external_sparc_core *) 0)->fp_stuff);
intcore->fp_stuff_pos = offsetof (struct external_sparc_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
(file_ptr) (((struct external_sparc_core *) 0)->fp_stuff);
offsetof (struct external_sparc_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end. */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
@ -462,7 +462,7 @@ swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6);
bfd_vma sp = H_GET_32 (abfd, &extcore->c_regs.r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else
@ -480,7 +480,7 @@ swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
intcore->c_regs_pos = (long) (((struct external_solaris_bcp_core *) 0)->c_regs);
intcore->c_regs_pos = offsetof (struct external_solaris_bcp_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
/* The Solaris BCP exdata structure does not contain an a_syms field,
@ -501,10 +501,10 @@ swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos =
(long) (((struct external_solaris_bcp_core *) 0)->fp_stuff);
offsetof (struct external_solaris_bcp_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
(file_ptr) (((struct external_solaris_bcp_core *) 0)->fp_stuff);
offsetof (struct external_solaris_bcp_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
@ -527,7 +527,7 @@ swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6);
bfd_vma sp = H_GET_32 (abfd, &extcore->c_regs.r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else

View File

@ -1,6 +1,6 @@
/* BFD semi-generic back-end for a.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -1193,26 +1193,21 @@ NAME (aout, new_section_hook) (bfd *abfd, asection *newsect)
{
obj_textsec (abfd)= newsect;
newsect->target_index = N_TEXT;
return TRUE;
}
if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data"))
else if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data"))
{
obj_datasec (abfd) = newsect;
newsect->target_index = N_DATA;
return TRUE;
}
if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss"))
else if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss"))
{
obj_bsssec (abfd) = newsect;
newsect->target_index = N_BSS;
return TRUE;
}
}
/* We allow more than three sections internally. */
return TRUE;
return _bfd_generic_new_section_hook (abfd, newsect);
}
bfd_boolean
@ -2859,9 +2854,10 @@ NAME (aout, link_hash_table_init) (struct aout_link_hash_table *table,
bfd *abfd,
struct bfd_hash_entry *(*newfunc)
(struct bfd_hash_entry *, struct bfd_hash_table *,
const char *))
const char *),
unsigned int entsize)
{
return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
return _bfd_link_hash_table_init (&table->root, abfd, newfunc, entsize);
}
/* Create an a.out link hash table. */
@ -2876,8 +2872,9 @@ NAME (aout, link_hash_table_create) (bfd *abfd)
if (ret == NULL)
return NULL;
if (! NAME (aout, link_hash_table_init) (ret, abfd,
NAME (aout, link_hash_newfunc)))
if (!NAME (aout, link_hash_table_init) (ret, abfd,
NAME (aout, link_hash_newfunc),
sizeof (struct aout_link_hash_entry)))
{
free (ret);
return NULL;
@ -5252,9 +5249,10 @@ NAME (aout, final_link) (bfd *abfd,
aout_info.symbol_map = NULL;
aout_info.output_syms = NULL;
if (! bfd_hash_table_init_n (&aout_info.includes.root,
aout_link_includes_newfunc,
251))
if (!bfd_hash_table_init_n (&aout_info.includes.root,
aout_link_includes_newfunc,
sizeof (struct aout_link_includes_entry),
251))
goto error_return;
includes_hash_initialized = TRUE;

View File

@ -666,10 +666,7 @@ bfd_generic_archive_p (bfd *abfd)
first = bfd_openr_next_archived_file (abfd, NULL);
if (first != NULL)
{
bfd_boolean fail;
first->target_defaulted = FALSE;
fail = FALSE;
if (bfd_check_format (first, bfd_object)
&& first->xvec != abfd->xvec)
{

View File

@ -1,6 +1,6 @@
/* BFD library support routines for architectures.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
@ -80,16 +80,22 @@ DESCRIPTION
.#define bfd_mach_m68040 6
.#define bfd_mach_m68060 7
.#define bfd_mach_cpu32 8
.#define bfd_mach_mcf5200 9
.#define bfd_mach_mcf5206e 10
.#define bfd_mach_mcf5307 11
.#define bfd_mach_mcf5407 12
.#define bfd_mach_mcf528x 13
.#define bfd_mach_mcfv4e 14
.#define bfd_mach_mcf521x 15
.#define bfd_mach_mcf5249 16
.#define bfd_mach_mcf547x 17
.#define bfd_mach_mcf548x 18
.#define bfd_mach_mcf_isa_a_nodiv 9
.#define bfd_mach_mcf_isa_a 10
.#define bfd_mach_mcf_isa_a_mac 11
.#define bfd_mach_mcf_isa_a_emac 12
.#define bfd_mach_mcf_isa_aplus 13
.#define bfd_mach_mcf_isa_aplus_mac 14
.#define bfd_mach_mcf_isa_aplus_emac 15
.#define bfd_mach_mcf_isa_b_nousp 16
.#define bfd_mach_mcf_isa_b_nousp_mac 17
.#define bfd_mach_mcf_isa_b_nousp_emac 18
.#define bfd_mach_mcf_isa_b 19
.#define bfd_mach_mcf_isa_b_mac 20
.#define bfd_mach_mcf_isa_b_emac 21
.#define bfd_mach_mcf_isa_b_float 22
.#define bfd_mach_mcf_isa_b_float_mac 23
.#define bfd_mach_mcf_isa_b_float_emac 24
. bfd_arch_vax, {* DEC Vax *}
. bfd_arch_i960, {* Intel 960 *}
. {* The order of the following is important.
@ -317,9 +323,10 @@ DESCRIPTION
. bfd_arch_iq2000, {* Vitesse IQ2000. *}
.#define bfd_mach_iq2000 1
.#define bfd_mach_iq10 2
. bfd_arch_ms1,
. bfd_arch_mt,
.#define bfd_mach_ms1 1
.#define bfd_mach_mrisc2 2
.#define bfd_mach_ms2 3
. bfd_arch_pj,
. bfd_arch_avr, {* Atmel AVR microcontrollers. *}
.#define bfd_mach_avr1 1
@ -351,7 +358,7 @@ DESCRIPTION
.#define bfd_mach_msp13 13
.#define bfd_mach_msp14 14
.#define bfd_mach_msp15 15
.#define bfd_mach_msp16 16
.#define bfd_mach_msp16 16
.#define bfd_mach_msp21 21
.#define bfd_mach_msp31 31
.#define bfd_mach_msp32 32
@ -360,6 +367,10 @@ DESCRIPTION
.#define bfd_mach_msp42 42
.#define bfd_mach_msp43 43
.#define bfd_mach_msp44 44
. bfd_arch_xc16x, {* Infineon's XC16X Series. *}
.#define bfd_mach_xc16x 1
.#define bfd_mach_xc16xl 2
.#define bfd_mach_xc16xs 3
. bfd_arch_xtensa, {* Tensilica's Xtensa cores. *}
.#define bfd_mach_xtensa 1
. bfd_arch_maxq, {* Dallas MAXQ 10/20 *}
@ -444,7 +455,7 @@ extern const bfd_arch_info_type bfd_mmix_arch;
extern const bfd_arch_info_type bfd_mn10200_arch;
extern const bfd_arch_info_type bfd_mn10300_arch;
extern const bfd_arch_info_type bfd_msp430_arch;
extern const bfd_arch_info_type bfd_ms1_arch;
extern const bfd_arch_info_type bfd_mt_arch;
extern const bfd_arch_info_type bfd_ns32k_arch;
extern const bfd_arch_info_type bfd_openrisc_arch;
extern const bfd_arch_info_type bfd_or32_arch;
@ -466,6 +477,7 @@ extern const bfd_arch_info_type bfd_we32k_arch;
extern const bfd_arch_info_type bfd_w65_arch;
extern const bfd_arch_info_type bfd_xstormy16_arch;
extern const bfd_arch_info_type bfd_xtensa_arch;
extern const bfd_arch_info_type bfd_xc16x_arch;
extern const bfd_arch_info_type bfd_z80_arch;
extern const bfd_arch_info_type bfd_z8k_arch;
@ -509,7 +521,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_mmix_arch,
&bfd_mn10200_arch,
&bfd_mn10300_arch,
&bfd_ms1_arch,
&bfd_mt_arch,
&bfd_msp430_arch,
&bfd_ns32k_arch,
&bfd_openrisc_arch,
@ -530,6 +542,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_we32k_arch,
&bfd_xstormy16_arch,
&bfd_xtensa_arch,
&bfd_xc16x_arch,
&bfd_z80_arch,
&bfd_z8k_arch,
#endif
@ -1003,23 +1016,23 @@ bfd_default_scan (const bfd_arch_info_type *info, const char *string)
break;
case 5200:
arch = bfd_arch_m68k;
number = bfd_mach_mcf5200;
number = bfd_mach_mcf_isa_a_nodiv;
break;
case 5206:
arch = bfd_arch_m68k;
number = bfd_mach_mcf5206e;
number = bfd_mach_mcf_isa_a_mac;
break;
case 5307:
arch = bfd_arch_m68k;
number = bfd_mach_mcf5307;
number = bfd_mach_mcf_isa_a_mac;
break;
case 5407:
arch = bfd_arch_m68k;
number = bfd_mach_mcf5407;
number = bfd_mach_mcf_isa_b_nousp_mac;
break;
case 5282:
arch = bfd_arch_m68k;
number = bfd_mach_mcf528x;
number = bfd_mach_mcf_isa_aplus_emac;
break;
case 32000:

View File

@ -1,7 +1,8 @@
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@ -375,6 +376,10 @@ struct bfd_hash_table
struct bfd_hash_entry **table;
/* 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;
/* 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,
@ -394,7 +399,8 @@ extern bfd_boolean bfd_hash_table_init
(struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
const char *),
unsigned int);
/* Initialize a hash table specifying a size. */
extern bfd_boolean bfd_hash_table_init_n
@ -402,7 +408,7 @@ extern bfd_boolean bfd_hash_table_init_n
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int size);
unsigned int, unsigned int);
/* Free up a hash table. */
extern void bfd_hash_table_free
@ -633,7 +639,8 @@ enum dynamic_lib_link_class {
};
extern bfd_boolean bfd_elf_record_link_assignment
(struct bfd_link_info *, const char *, bfd_boolean);
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
bfd_boolean);
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_get_bfd_needed_list
@ -705,6 +712,10 @@ extern struct bfd_section *_bfd_elf_tls_setup
extern void _bfd_fix_excluded_sec_syms
(bfd *, struct bfd_link_info *);
extern unsigned bfd_m68k_mach_to_features (int);
extern int bfd_m68k_features_to_mach (unsigned);
extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
char **);

View File

@ -8,7 +8,8 @@
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@ -382,6 +383,10 @@ struct bfd_hash_table
struct bfd_hash_entry **table;
/* 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;
/* 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,
@ -401,7 +406,8 @@ extern bfd_boolean bfd_hash_table_init
(struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
const char *),
unsigned int);
/* Initialize a hash table specifying a size. */
extern bfd_boolean bfd_hash_table_init_n
@ -409,7 +415,7 @@ extern bfd_boolean bfd_hash_table_init_n
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int size);
unsigned int, unsigned int);
/* Free up a hash table. */
extern void bfd_hash_table_free
@ -640,7 +646,8 @@ enum dynamic_lib_link_class {
};
extern bfd_boolean bfd_elf_record_link_assignment
(struct bfd_link_info *, const char *, bfd_boolean);
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
bfd_boolean);
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_get_bfd_needed_list
@ -712,6 +719,10 @@ extern struct bfd_section *_bfd_elf_tls_setup
extern void _bfd_fix_excluded_sec_syms
(bfd *, struct bfd_link_info *);
extern unsigned bfd_m68k_mach_to_features (int);
extern int bfd_m68k_features_to_mach (unsigned);
extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
char **);
@ -1456,11 +1467,6 @@ extern asection bfd_ind_section;
|| ((SEC) == bfd_com_section_ptr) \
|| ((SEC) == bfd_ind_section_ptr))
extern const struct bfd_symbol * const bfd_abs_symbol;
extern const struct bfd_symbol * const bfd_com_symbol;
extern const struct bfd_symbol * const bfd_und_symbol;
extern const struct bfd_symbol * const bfd_ind_symbol;
/* Macros to handle insertion and deletion of a bfd's sections. These
only handle the list pointers, ie. do not adjust section_count,
target_index etc. */
@ -1551,7 +1557,7 @@ extern const struct bfd_symbol * const bfd_ind_symbol;
#define bfd_section_removed_from_list(ABFD, S) \
((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
/* name, id, index, next, prev, flags, user_set_vma, */ \
{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
\
@ -1582,11 +1588,8 @@ extern const struct bfd_symbol * const bfd_ind_symbol;
/* target_index, used_by_bfd, constructor_chain, owner, */ \
0, NULL, NULL, NULL, \
\
/* symbol, */ \
(struct bfd_symbol *) SYM, \
\
/* symbol_ptr_ptr, */ \
(struct bfd_symbol **) SYM_PTR, \
/* symbol, symbol_ptr_ptr, */ \
(struct bfd_symbol *) SYM, &SEC.symbol, \
\
/* map_head, map_tail */ \
{ NULL }, { NULL } \
@ -1668,16 +1671,22 @@ enum bfd_architecture
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf5200 9
#define bfd_mach_mcf5206e 10
#define bfd_mach_mcf5307 11
#define bfd_mach_mcf5407 12
#define bfd_mach_mcf528x 13
#define bfd_mach_mcfv4e 14
#define bfd_mach_mcf521x 15
#define bfd_mach_mcf5249 16
#define bfd_mach_mcf547x 17
#define bfd_mach_mcf548x 18
#define bfd_mach_mcf_isa_a_nodiv 9
#define bfd_mach_mcf_isa_a 10
#define bfd_mach_mcf_isa_a_mac 11
#define bfd_mach_mcf_isa_a_emac 12
#define bfd_mach_mcf_isa_aplus 13
#define bfd_mach_mcf_isa_aplus_mac 14
#define bfd_mach_mcf_isa_aplus_emac 15
#define bfd_mach_mcf_isa_b_nousp 16
#define bfd_mach_mcf_isa_b_nousp_mac 17
#define bfd_mach_mcf_isa_b_nousp_emac 18
#define bfd_mach_mcf_isa_b 19
#define bfd_mach_mcf_isa_b_mac 20
#define bfd_mach_mcf_isa_b_emac 21
#define bfd_mach_mcf_isa_b_float 22
#define bfd_mach_mcf_isa_b_float_mac 23
#define bfd_mach_mcf_isa_b_float_emac 24
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@ -1905,9 +1914,10 @@ enum bfd_architecture
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
bfd_arch_ms1,
bfd_arch_mt,
#define bfd_mach_ms1 1
#define bfd_mach_mrisc2 2
#define bfd_mach_ms2 3
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers. */
#define bfd_mach_avr1 1
@ -1939,7 +1949,7 @@ enum bfd_architecture
#define bfd_mach_msp13 13
#define bfd_mach_msp14 14
#define bfd_mach_msp15 15
#define bfd_mach_msp16 16
#define bfd_mach_msp16 16
#define bfd_mach_msp21 21
#define bfd_mach_msp31 31
#define bfd_mach_msp32 32
@ -1948,6 +1958,10 @@ enum bfd_architecture
#define bfd_mach_msp42 42
#define bfd_mach_msp43 43
#define bfd_mach_msp44 44
bfd_arch_xc16x, /* Infineon's XC16X Series. */
#define bfd_mach_xc16x 1
#define bfd_mach_xc16xl 2
#define bfd_mach_xc16xs 3
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
bfd_arch_maxq, /* Dallas MAXQ 10/20 */
@ -2071,11 +2085,12 @@ enum complain_overflow
/* Do not complain on overflow. */
complain_overflow_dont,
/* Complain if the bitfield overflows, whether it is considered
as signed or unsigned. */
/* Complain if the value overflows when considered as a signed
number one bit larger than the field. ie. A bitfield of N bits
is allowed to represent -2**n to 2**n-1. */
complain_overflow_bitfield,
/* Complain if the value overflows when considered as signed
/* Complain if the value overflows when considered as a signed
number. */
complain_overflow_signed,
@ -2567,6 +2582,11 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MIPS_TLS_TPREL_LO16,
/* MIPS ELF relocations (VxWorks extensions). */
BFD_RELOC_MIPS_COPY,
BFD_RELOC_MIPS_JUMP_SLOT,
/* Fujitsu Frv Relocations. */
BFD_RELOC_FRV_LABEL16,
BFD_RELOC_FRV_LABEL24,
@ -2658,6 +2678,9 @@ in the instruction. */
BFD_RELOC_386_TLS_DTPMOD32,
BFD_RELOC_386_TLS_DTPOFF32,
BFD_RELOC_386_TLS_TPOFF32,
BFD_RELOC_386_TLS_GOTDESC,
BFD_RELOC_386_TLS_DESC_CALL,
BFD_RELOC_386_TLS_DESC,
/* x86-64/elf relocations */
BFD_RELOC_X86_64_GOT32,
@ -2678,6 +2701,14 @@ in the instruction. */
BFD_RELOC_X86_64_TPOFF32,
BFD_RELOC_X86_64_GOTOFF64,
BFD_RELOC_X86_64_GOTPC32,
BFD_RELOC_X86_64_GOT64,
BFD_RELOC_X86_64_GOTPCREL64,
BFD_RELOC_X86_64_GOTPC64,
BFD_RELOC_X86_64_GOTPLT64,
BFD_RELOC_X86_64_PLTOFF64,
BFD_RELOC_X86_64_GOTPC32_TLSDESC,
BFD_RELOC_X86_64_TLSDESC_CALL,
BFD_RELOC_X86_64_TLSDESC,
/* ns32k relocations */
BFD_RELOC_NS32K_IMM_8,
@ -2824,6 +2855,12 @@ not stored in the instruction. The 2nd lowest bit comes from a 1 bit
field in the instruction. */
BFD_RELOC_THUMB_PCREL_BLX,
/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
BFD_RELOC_ARM_PCREL_CALL,
/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
BFD_RELOC_ARM_PCREL_JUMP,
/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
The lowest bit must be zero and is not stored in the instruction.
Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
@ -2860,6 +2897,16 @@ pc-relative or some form of GOT-indirect relocation. */
/* 31-bit PC relative address. */
BFD_RELOC_ARM_PREL31,
/* Low and High halfword relocations for MOVW and MOVT instructions. */
BFD_RELOC_ARM_MOVW,
BFD_RELOC_ARM_MOVT,
BFD_RELOC_ARM_MOVW_PCREL,
BFD_RELOC_ARM_MOVT_PCREL,
BFD_RELOC_ARM_THUMB_MOVW,
BFD_RELOC_ARM_THUMB_MOVT,
BFD_RELOC_ARM_THUMB_MOVW_PCREL,
BFD_RELOC_ARM_THUMB_MOVT_PCREL,
/* Relocations for setting up GOTs and PLTs for shared libraries. */
BFD_RELOC_ARM_JUMP_SLOT,
BFD_RELOC_ARM_GLOB_DAT,
@ -3042,6 +3089,22 @@ through 0. */
/* ADI Blackfin Long Jump pcrel. */
BFD_RELOC_BFIN_24_PCREL_JUMP_L,
/* ADI Blackfin FD-PIC relocations. */
BFD_RELOC_BFIN_GOT17M4,
BFD_RELOC_BFIN_GOTHI,
BFD_RELOC_BFIN_GOTLO,
BFD_RELOC_BFIN_FUNCDESC,
BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
BFD_RELOC_BFIN_FUNCDESC_GOTHI,
BFD_RELOC_BFIN_FUNCDESC_GOTLO,
BFD_RELOC_BFIN_FUNCDESC_VALUE,
BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
BFD_RELOC_BFIN_GOTOFF17M4,
BFD_RELOC_BFIN_GOTOFFHI,
BFD_RELOC_BFIN_GOTOFFLO,
/* ADI Blackfin GOT relocation. */
BFD_RELOC_BFIN_GOT,
@ -3187,6 +3250,9 @@ of the container. */
/* Renesas M16C/M32C Relocations. */
BFD_RELOC_M32C_HI8,
BFD_RELOC_M32C_RL_JUMP,
BFD_RELOC_M32C_RL_1ADDR,
BFD_RELOC_M32C_RL_2ADDR,
/* Renesas M32R (formerly Mitsubishi M32R) relocs.
This is a 24 bit absolute address. */
@ -3451,6 +3517,10 @@ of data memory address) into 8 bit immediate value of LDI insn. */
of program memory address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HH8_LDI,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
of 32 bit value) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_MS8_LDI,
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(usually data memory address) into 8 bit immediate value of SUBI insn. */
BFD_RELOC_AVR_LO8_LDI_NEG,
@ -3465,6 +3535,10 @@ SUBI insn. */
of LDI or SUBI insn. */
BFD_RELOC_AVR_HH8_LDI_NEG,
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
of 32 bit value) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_MS8_LDI_NEG,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_LO8_LDI_PM,
@ -3950,25 +4024,34 @@ This is the 5 bits of a value. */
BFD_RELOC_XSTORMY16_24,
BFD_RELOC_XSTORMY16_FPTR16,
/* Infineon Relocations. */
BFD_RELOC_XC16X_PAG,
BFD_RELOC_XC16X_POF,
BFD_RELOC_XC16X_SEG,
BFD_RELOC_XC16X_SOF,
/* Relocations used by VAX ELF. */
BFD_RELOC_VAX_GLOB_DAT,
BFD_RELOC_VAX_JMP_SLOT,
BFD_RELOC_VAX_RELATIVE,
/* Morpho MS1 - 16 bit immediate relocation. */
BFD_RELOC_MS1_PC16,
/* Morpho MT - 16 bit immediate relocation. */
BFD_RELOC_MT_PC16,
/* Morpho MS1 - Hi 16 bits of an address. */
BFD_RELOC_MS1_HI16,
/* Morpho MT - Hi 16 bits of an address. */
BFD_RELOC_MT_HI16,
/* Morpho MS1 - Low 16 bits of an address. */
BFD_RELOC_MS1_LO16,
/* Morpho MT - Low 16 bits of an address. */
BFD_RELOC_MT_LO16,
/* Morpho MS1 - Used to tell the linker which vtable entries are used. */
BFD_RELOC_MS1_GNU_VTINHERIT,
/* Morpho MT - Used to tell the linker which vtable entries are used. */
BFD_RELOC_MT_GNU_VTINHERIT,
/* Morpho MS1 - Used to tell the linker which vtable entries are used. */
BFD_RELOC_MS1_GNU_VTENTRY,
/* Morpho MT - Used to tell the linker which vtable entries are used. */
BFD_RELOC_MT_GNU_VTENTRY,
/* Morpho MT - 8 bit immediate relocation. */
BFD_RELOC_MT_PCINSN8,
/* msp430 specific relocation codes */
BFD_RELOC_MSP430_10_PCREL,
@ -4052,14 +4135,14 @@ replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
BFD_RELOC_XTENSA_OP1,
BFD_RELOC_XTENSA_OP2,
/* Xtensa relocation to mark that the assembler expanded the
/* Xtensa relocation to mark that the assembler expanded the
instructions from an original target. The expansion size is
encoded in the reloc size. */
BFD_RELOC_XTENSA_ASM_EXPAND,
/* Xtensa relocation to mark that the linker should simplify
assembler-expanded instructions. This is commonly used
internally by the linker after analysis of a
/* Xtensa relocation to mark that the linker should simplify
assembler-expanded instructions. This is commonly used
internally by the linker after analysis of a
BFD_RELOC_XTENSA_ASM_EXPAND. */
BFD_RELOC_XTENSA_ASM_SIMPLIFY,
@ -4609,11 +4692,6 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *);
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
void bfd_hide_symbol (bfd *,
struct bfd_link_info *,
struct bfd_link_hash_entry *,
bfd_boolean);
/* Extracted from archive.c. */
symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym);
@ -4630,6 +4708,9 @@ int bfd_core_file_failing_signal (bfd *abfd);
bfd_boolean core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
bfd_boolean generic_core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
/* Extracted from targets.c. */
#define BFD_SEND(bfd, message, arglist) \
((*((bfd)->xvec->message)) arglist)
@ -4941,7 +5022,6 @@ typedef struct bfd_target
NAME##_bfd_link_split_section, \
NAME##_bfd_gc_sections, \
NAME##_bfd_merge_sections, \
_bfd_generic_match_sections_by_type, \
NAME##_bfd_is_group_section, \
NAME##_bfd_discard_group, \
NAME##_section_already_linked \
@ -4981,12 +5061,6 @@ typedef struct bfd_target
/* Attempt to merge SEC_MERGE sections. */
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
#define bfd_match_sections_by_type(abfd, asec, bbfd, bsec) \
BFD_SEND (abfd, _bfd_match_sections_by_type, (abfd, asec, bbfd, bsec))
/* Return TRUE if 2 section types are compatible. */
bfd_boolean (*_bfd_match_sections_by_type)
(bfd *, const asection *, bfd *, const asection *);
/* Is this section a member of a group? */
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);

View File

@ -1,6 +1,6 @@
/* Generic BFD library interface and support routines.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -216,6 +216,11 @@ CODE_FRAGMENT
#include "libecoff.h"
#undef obj_symbols
#include "elf-bfd.h"
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
/* provide storage for subsystem, stack and heap data which may have been
passed in on the command line. Ld puts this data into a bfd_link_info
@ -437,7 +442,7 @@ _bfd_default_error_handler (const char *fmt, ...)
/* Reserve enough space for the existing format string. */
avail -= strlen (fmt) + 1;
if (avail > 1000)
abort ();
_exit (EXIT_FAILURE);
p = fmt;
while (1)
@ -775,10 +780,6 @@ bfd_assert (const char *file, int line)
/* A more or less friendly abort message. In libbfd.h abort is
defined to call this function. */
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
void
_bfd_abort (const char *file, int line, const char *fn)
{
@ -791,7 +792,7 @@ _bfd_abort (const char *file, int line, const char *fn)
(_("BFD %s internal error, aborting at %s line %d\n"),
BFD_VERSION_STRING, file, line);
(*_bfd_error_handler) (_("Please report this bug.\n"));
xexit (EXIT_FAILURE);
_exit (EXIT_FAILURE);
}
/*
@ -1439,7 +1440,8 @@ bfd_preserve_save (bfd *abfd, struct bfd_preserve *preserve)
preserve->section_count = abfd->section_count;
preserve->section_htab = abfd->section_htab;
if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc))
if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc,
sizeof (struct section_hash_entry)))
return FALSE;
abfd->tdata.any = NULL;
@ -1511,29 +1513,3 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve)
objalloc. */
bfd_hash_table_free (&preserve->section_htab);
}
/*
FUNCTION
bfd_hide_symbol
SYNOPSIS
void bfd_hide_symbol (bfd *,
struct bfd_link_info *,
struct bfd_link_hash_entry *,
bfd_boolean);
DESCRIPTION
This function hides a symbol so that it won't be exported.
*/
void
bfd_hide_symbol (bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_hash_entry *h,
bfd_boolean force_local)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
(get_elf_backend_data (abfd)->elf_backend_hide_symbol)
(link_info, (struct elf_link_hash_entry *) h, force_local);
}

View File

@ -75,7 +75,7 @@ static const bfd_target *cisco_core_file_validate PARAMS ((bfd *, int));
static const bfd_target *cisco_core_file_p PARAMS ((bfd *));
char *cisco_core_file_failing_command PARAMS ((bfd *));
int cisco_core_file_failing_signal PARAMS ((bfd *));
bfd_boolean cisco_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
#define cisco_core_file_matches_executable_p generic_core_file_matches_executable_p
/* Examine the file for a crash info struct at the offset given by
CRASH_INFO_LOC. */
@ -317,14 +317,6 @@ cisco_core_file_failing_signal (abfd)
{
return abfd->tdata.cisco_core_data->sig;
}
bfd_boolean
cisco_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED;
bfd *exec_bfd ATTRIBUTE_UNUSED;
{
return TRUE;
}
extern const bfd_target cisco_core_little_vec;

View File

@ -1,6 +1,6 @@
/* BFD back-end for ARM COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -220,7 +220,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_dont,
aoutarm_fix_pcrel_26_done,
"ARM_26D",
FALSE,
TRUE, /* partial_inplace. */
0x00ffffff,
0x0,
PCRELOFFSET),
@ -233,7 +233,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_32",
FALSE,
TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
@ -246,7 +246,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_RVA32",
FALSE,
TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
@ -294,7 +294,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_SECTION",
FALSE,
TRUE, /* partial_inplace. */
0x0000ffff,
0x0000ffff,
PCRELOFFSET),
@ -307,7 +307,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_SECREL",
FALSE,
TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
@ -879,8 +879,10 @@ coff_arm_link_hash_table_create (bfd * abfd)
if (ret == NULL)
return NULL;
if (! _bfd_coff_link_hash_table_init
(& ret->root, abfd, _bfd_coff_link_hash_newfunc))
if (!_bfd_coff_link_hash_table_init (&ret->root,
abfd,
_bfd_coff_link_hash_newfunc,
sizeof (struct coff_link_hash_entry)))
{
free (ret);
return NULL;
@ -1207,12 +1209,14 @@ coff_arm_relocate_section (bfd *output_bfd,
generation of bl's instruction offset. */
addend -= 8;
#endif
howto = &fake_arm26_reloc;
howto = & fake_arm26_reloc;
}
#ifdef ARM_WINCE
/* MS ARM-CE makes the reloc relative to the opcode's pc, not
the next opcode's pc, so is off by one. */
if (howto->pc_relative && !info->relocatable)
addend -= 8;
#endif
/* If we are doing a relocatable link, then we can just ignore

View File

@ -1,6 +1,6 @@
/* BFD back-end for Renesas H8/300 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
@ -63,13 +63,6 @@ static struct bfd_hash_entry *
funcvec_hash_newfunc
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
static bfd_boolean
funcvec_hash_table_init
(struct funcvec_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
static bfd_reloc_status_type special
(bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
static int select_reloc
@ -181,13 +174,14 @@ funcvec_hash_table_init (struct funcvec_hash_table *table,
struct bfd_hash_entry *(*newfunc)
(struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *))
const char *),
unsigned int entsize)
{
/* Initialize our local fields, then call the generic initialization
routine. */
table->offset = 0;
table->abfd = abfd;
return (bfd_hash_table_init (&table->root, newfunc));
return (bfd_hash_table_init (&table->root, newfunc, entsize));
}
/* Create the derived linker hash table. We use a derived hash table
@ -204,7 +198,8 @@ h8300_coff_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
if (!_bfd_link_hash_table_init (&ret->root.root, abfd,
_bfd_generic_link_hash_newfunc))
_bfd_generic_link_hash_newfunc,
sizeof (struct generic_link_hash_entry)))
{
free (ret);
return NULL;
@ -671,7 +666,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma);
@ -703,7 +698,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the instruction (not the reloc). */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma + 1);
@ -817,7 +812,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the next instruction. */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma + 1);
@ -864,7 +859,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the instruction (not the reloc). */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma - 1);
@ -925,7 +920,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the instruction (not the reloc). */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma + 2);
@ -1064,7 +1059,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma) + 1;
@ -1298,7 +1293,8 @@ h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
/* And initialize the funcvec hash table. */
if (!funcvec_hash_table_init (funcvec_hash_table, abfd,
funcvec_hash_newfunc))
funcvec_hash_newfunc,
sizeof (struct funcvec_hash_entry)))
{
bfd_release (abfd, funcvec_hash_table);
return FALSE;

View File

@ -1,5 +1,5 @@
/* BFD back-end for Renesas H8/500 COFF binaries.
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
@ -245,9 +245,9 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ *dst_ptr
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1 since were in the odd byte of the
word and the pc's been incremented. */
@ -269,9 +269,9 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ *dst_ptr
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1 since were in the odd byte of the
word and the pc's been incremented. */

View File

@ -317,11 +317,7 @@ reloc_processing (relent,reloc, symbols, abfd, section)
}
else
{
asymbol *ptr;
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
ptr = *(relent->sym_ptr_ptr);
relent->addend = 0;
relent->address-= section->vma;

View File

@ -1,6 +1,6 @@
/* BFD back-end for PowerPC Microsoft Portable Executable files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
@ -127,11 +127,6 @@ struct ppc_coff_link_hash_table
static struct bfd_hash_entry *ppc_coff_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
const char *));
static bfd_boolean ppc_coff_link_hash_table_init
PARAMS ((struct ppc_coff_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *)));
static struct bfd_link_hash_table *ppc_coff_link_hash_table_create
PARAMS ((bfd *));
static bfd_boolean coff_ppc_relocate_section
@ -184,14 +179,14 @@ ppc_coff_link_hash_newfunc (entry, table, string)
/* Initialize a PE linker hash table. */
static bfd_boolean
ppc_coff_link_hash_table_init (table, abfd, newfunc)
struct ppc_coff_link_hash_table *table;
bfd *abfd;
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
ppc_coff_link_hash_table_init (struct ppc_coff_link_hash_table *table,
bfd *abfd,
struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int entsize)
{
return _bfd_coff_link_hash_table_init (&table->root, abfd, newfunc);
return _bfd_coff_link_hash_table_init (&table->root, abfd, newfunc, entsize);
}
/* Create a PE linker hash table. */
@ -206,8 +201,9 @@ ppc_coff_link_hash_table_create (abfd)
ret = (struct ppc_coff_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! ppc_coff_link_hash_table_init (ret, abfd,
ppc_coff_link_hash_newfunc))
if (!ppc_coff_link_hash_table_init (ret, abfd,
ppc_coff_link_hash_newfunc,
sizeof (struct ppc_coff_link_hash_entry)))
{
free (ret);
return (struct bfd_link_hash_table *) NULL;

View File

@ -1,5 +1,5 @@
/* BFD back-end for IBM RS/6000 "XCOFF" files.
Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005
Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced
@ -2083,7 +2083,7 @@ xcoff_write_archive_contents_old (abfd)
char decbuf[XCOFFARMAG_ELEMENT_SIZE + 1];
memset (&fhdr, 0, sizeof fhdr);
strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG);
(void) strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG);
sprintf (fhdr.firstmemoff, "%d", SIZEOF_AR_FILE_HDR);
sprintf (fhdr.freeoff, "%d", 0);
@ -4196,7 +4196,6 @@ const bfd_target rs6000coff_vec =
_bfd_generic_link_split_section,
bfd_generic_gc_sections,
bfd_generic_merge_sections,
_bfd_generic_match_sections_by_type,
bfd_generic_is_group_section,
bfd_generic_discard_group,
_bfd_generic_section_already_linked,
@ -4447,7 +4446,6 @@ const bfd_target pmac_xcoff_vec =
_bfd_generic_link_split_section,
bfd_generic_gc_sections,
bfd_generic_merge_sections,
_bfd_generic_match_sections_by_type,
bfd_generic_is_group_section,
bfd_generic_discard_group,
_bfd_generic_section_already_linked,

View File

@ -1,6 +1,6 @@
/* BFD back-end for WDC 65816 COFF binaries.
Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -105,7 +105,7 @@ reloc_processing (relent, reloc, symbols, abfd, section)
if (((int) reloc->r_symndx) > 0)
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
else
relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol);
relent->sym_ptr_ptr = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr;
relent->addend = reloc->r_offset;
@ -316,9 +316,9 @@ w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
{
int gap = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (dst_address
+ input_section->output_offset
+ input_section->output_section->vma);
gap -= dot + 1;
if (gap < -128 || gap > 127)
@ -340,9 +340,9 @@ w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
{
bfd_vma gap = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (dst_address
+ input_section->output_offset
+ input_section->output_section->vma);
/* This wraps within the page, so ignore the relativeness, look at the
high part. */

View File

@ -34,6 +34,11 @@ HOWTO (R_IMM32, 0, 1, 32, FALSE, 0,
complain_overflow_dont, 0, "r_imm32", TRUE, 0xffffffff, 0xffffffff,
FALSE);
static reloc_howto_type r_imm24 =
HOWTO (R_IMM24, 0, 1, 24, FALSE, 0,
complain_overflow_dont, 0, "r_imm24", TRUE, 0x00ffffff, 0x00ffffff,
FALSE);
static reloc_howto_type r_imm16 =
HOWTO (R_IMM16, 0, 1, 16, FALSE, 0,
complain_overflow_dont, 0, "r_imm16", TRUE, 0x0000ffff, 0x0000ffff,
@ -84,6 +89,9 @@ rtype2howto (arelent *internal, struct internal_reloc *dst)
case R_IMM16:
internal->howto = &r_imm16;
break;
case R_IMM24:
internal->howto = &r_imm24;
break;
case R_IMM32:
internal->howto = &r_imm32;
break;
@ -106,6 +114,7 @@ coff_z80_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
{
case BFD_RELOC_8: return & r_imm8;
case BFD_RELOC_16: return & r_imm16;
case BFD_RELOC_24: return & r_imm24;
case BFD_RELOC_32: return & r_imm32;
case BFD_RELOC_8_PCREL: return & r_jr;
case BFD_RELOC_Z80_DISP8: return & r_off8;
@ -173,7 +182,7 @@ extra_case (bfd *in_abfd,
break;
case R_IMM8:
val = bfd_get_16 ( in_abfd, data+*src_ptr)
val = bfd_get_8 ( in_abfd, data+*src_ptr)
+ bfd_coff_reloc16_get_value (reloc, link_info, input_section);
bfd_put_8 (in_abfd, val, data + *dst_ptr);
(*dst_ptr) += 1;
@ -188,6 +197,16 @@ extra_case (bfd *in_abfd,
(*src_ptr) += 2;
break;
case R_IMM24:
val = bfd_get_16 ( in_abfd, data+*src_ptr)
+ (bfd_get_8 ( in_abfd, data+*src_ptr+2) << 16)
+ bfd_coff_reloc16_get_value (reloc, link_info, input_section);
bfd_put_16 (in_abfd, val, data + *dst_ptr);
bfd_put_8 (in_abfd, val >> 16, data + *dst_ptr+2);
(*dst_ptr) += 3;
(*src_ptr) += 3;
break;
case R_IMM32:
val = bfd_get_32 ( in_abfd, data+*src_ptr)
+ bfd_coff_reloc16_get_value (reloc, link_info, input_section);
@ -200,8 +219,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, Since the offset is relative
to the value of PC after reading

View File

@ -230,8 +230,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
word and the pc's been incremented. */
@ -258,8 +258,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
word and the pc's been incremented. */
@ -289,8 +289,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 2;
@ -318,8 +318,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 2;

View File

@ -2743,7 +2743,6 @@ const bfd_target rs6000coff64_vec =
_bfd_generic_link_split_section,
bfd_generic_gc_sections,
bfd_generic_merge_sections,
_bfd_generic_match_sections_by_type,
bfd_generic_is_group_section,
bfd_generic_discard_group,
_bfd_generic_section_already_linked,
@ -2995,7 +2994,6 @@ const bfd_target aix5coff64_vec =
_bfd_generic_link_split_section,
bfd_generic_gc_sections,
bfd_generic_merge_sections,
_bfd_generic_match_sections_by_type,
bfd_generic_is_group_section,
bfd_generic_discard_group,
_bfd_generic_section_already_linked,

View File

@ -1,6 +1,6 @@
/* Support for the generic parts of most COFF variants, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -1560,6 +1560,10 @@ coff_new_section_hook (bfd * abfd, asection * section)
section->alignment_power = bfd_xcoff_data_align_power (abfd);
#endif
/* Set up the section symbol. */
if (!_bfd_generic_new_section_hook (abfd, section))
return FALSE;
/* Allocate aux records for section symbols, to store size and
related info.
@ -2528,11 +2532,15 @@ coff_write_relocs (bfd * abfd, int first_undef)
else
{
n.r_symndx = get_index ((*(q->sym_ptr_ptr)));
/* Take notice if the symbol reloc points to a symbol
we don't have in our symbol table. What should we
do for this?? */
/* Check to see if the symbol reloc points to a symbol
we don't have in our symbol table. */
if (n.r_symndx > obj_conv_table_size (abfd))
abort ();
{
bfd_set_error (bfd_error_bad_value);
_bfd_error_handler (_("%B: reloc against a non-existant symbol index: %ld"),
abfd, n.r_symndx);
return FALSE;
}
}
}

View File

@ -1,6 +1,6 @@
/* COFF specific linker code.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -94,10 +94,11 @@ _bfd_coff_link_hash_table_init (struct coff_link_hash_table *table,
bfd *abfd,
struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *))
const char *),
unsigned int entsize)
{
memset (&table->stab_info, 0, sizeof (table->stab_info));
return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
return _bfd_link_hash_table_init (&table->root, abfd, newfunc, entsize);
}
/* Create a COFF linker hash table. */
@ -113,7 +114,8 @@ _bfd_coff_link_hash_table_create (bfd *abfd)
return NULL;
if (! _bfd_coff_link_hash_table_init (ret, abfd,
_bfd_coff_link_hash_newfunc))
_bfd_coff_link_hash_newfunc,
sizeof (struct coff_link_hash_entry)))
{
free (ret);
return (struct bfd_link_hash_table *) NULL;
@ -1237,9 +1239,7 @@ process_embedded_commands (bfd *output_bfd,
asection *asec;
int loop = 1;
int had_write = 0;
int had_read = 0;
int had_exec= 0;
int had_shared= 0;
s += 5;
s = get_name (s, &name);
@ -1253,10 +1253,8 @@ process_embedded_commands (bfd *output_bfd,
had_write = 1;
break;
case 'R':
had_read = 1;
break;
case 'S':
had_shared = 1;
break;
case 'X':
had_exec = 1;

File diff suppressed because it is too large Load Diff

View File

@ -19,16 +19,20 @@ HOST_U_64BIT_TYPE=
case "${host}" in
hppa*-*-hpux*) # HP/UX's ftello64 et.al. declarations are only
hppa*64*-*-hpux*) # HP/UX's ftello64 et.al. declarations are only
# visible when _LARGEFILE64_SOURCE is defined.
# Without those declarations, real_ftell et.al.
# get mis-compiled.
HDEFINES="-DHOST_HPPAHPUX -D_LARGEFILE64_SOURCE" ;;
HDEFINES="-DHOST_HPPAHPUX -D_LARGEFILE64_SOURCE"
host64=true;;
hppa*-*-hpux*) HDEFINES="-DHOST_HPPAHPUX -D_LARGEFILE64_SOURCE" ;;
hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;;
hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;;
hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;;
hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;;
ia64-*-hpux*) HDEFINES=-D_LARGEFILE64_SOURCE
host64=true;;
ia64-*-*) host64=true;;
# Workaround for limitations on win9x where file contents are

View File

@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
AC_CANONICAL_TARGET
AC_ISC_POSIX
AM_INIT_AUTOMAKE(bfd, 2.16.91)
AM_INIT_AUTOMAKE(bfd, 2.17.50)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
@ -584,14 +584,17 @@ do
bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
bfd_elf32_bfin_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
bfd_elf32_bfinfdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_bigarm_symbian_vec)
tb="$tb elf32-arm.lo elf32.lo $elf" ;;
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_bigarm_vxworks_vec)
tb="$tb elf32-arm.lo elf32.lo $elf" ;;
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_bigmips_vxworks_vec)
tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
@ -619,11 +622,13 @@ do
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_littlearm_symbian_vec)
tb="$tb elf32-arm.lo elf32.lo $elf" ;;
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_littlearm_vxworks_vec)
tb="$tb elf32-arm.lo elf32.lo $elf" ;;
bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_littlemips_vxworks_vec)
tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
@ -637,12 +642,12 @@ do
bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
bfd_elf32_ms1_vec) tb="$tb elf32-ms1.lo elf32.lo $elf" ;;
bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;;
bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
@ -667,26 +672,28 @@ do
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;;
bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
bfd_elf32_xc16x_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
@ -697,9 +704,9 @@ do
bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
@ -956,5 +963,11 @@ esac
rm -f doc/config.status
AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
AC_CONFIG_COMMANDS([default],[[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]],[[]])
dnl Required by html and install-html
AC_SUBST(datarootdir)
AC_SUBST(docdir)
AC_SUBST(htmldir)
AC_OUTPUT

View File

@ -1,5 +1,5 @@
/* Core file generic interface routines for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -107,3 +107,59 @@ core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
return BFD_SEND (core_bfd, _core_file_matches_executable_p,
(core_bfd, exec_bfd));
}
/*
FUNCTION
generic_core_file_matches_executable_p
SYNOPSIS
bfd_boolean generic_core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
DESCRIPTION
Return TRUE if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached
to @var{exec_bfd}. The match is based on executable
basenames only.
Note: When not able to determine the core file failing
command or the executable name, we still return TRUE even
though we're not sure that core file and executable match.
This is to avoid generating a false warning in situations
where we really don't know whether they match or not.
*/
bfd_boolean
generic_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
{
char *exec;
char *core;
char *last_slash;
if (exec_bfd == NULL || core_bfd == NULL)
return TRUE;
/* The cast below is to avoid a compiler warning due to the assignment
of the const char * returned by bfd_core_file_failing_command to a
non-const char *. In this case, the assignement does not lead to
breaking the const, as we're only reading the string. */
core = (char *) bfd_core_file_failing_command (core_bfd);
if (core == NULL)
return TRUE;
exec = bfd_get_filename (exec_bfd);
if (exec == NULL)
return TRUE;
last_slash = strrchr (core, '/');
if (last_slash != NULL)
core = last_slash + 1;
last_slash = strrchr (exec, '/');
if (last_slash != NULL)
exec = last_slash + 1;
return strcmp (exec, core) == 0;
}

View File

@ -404,9 +404,12 @@ bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section)
bfd_boolean
bfd_is_arm_mapping_symbol_name (const char * name)
{
/* The ARM compiler outputs several obsolete forms. Recognize them
in addition to the standard $a, $t and $d. We are somewhat loose
in what we accept here, since the full set is not documented. */
return (name != NULL)
&& (name[0] == '$')
&& ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd'))
&& (name[2] == 0);
&& (name[1] >= 'a' && name[1] <= 'z')
&& (name[2] == 0 || name[2] == '.');
}

View File

@ -1,75 +1,34 @@
/* BFD library support routines for the AVR architecture.
Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
Copyright 1999, 2000, 2002, 2006 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
static const bfd_arch_info_type *compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
#define N(addr_bits, machine, print, default, next) \
{ \
8, /* 8 bits in a word */ \
addr_bits, /* bits in an address */ \
8, /* 8 bits in a byte */ \
bfd_arch_avr, \
machine, /* machine */ \
"avr", /* arch_name */ \
print, /* printable name */ \
1, /* section align power */ \
default, /* the default machine */ \
compatible, \
bfd_default_scan, \
next \
}
static const bfd_arch_info_type arch_info_struct[] =
{
/* AT90S1200, ATtiny1x, ATtiny28 */
N (16, bfd_mach_avr1, "avr:1", FALSE, & arch_info_struct[1]),
/* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22 */
N (16, bfd_mach_avr2, "avr:2", FALSE, & arch_info_struct[2]),
/* ATmega103, ATmega603 */
N (22, bfd_mach_avr3, "avr:3", FALSE, & arch_info_struct[3]),
/* ATmega83, ATmega85 */
N (16, bfd_mach_avr4, "avr:4", FALSE, & arch_info_struct[4]),
/* ATmega161, ATmega163, ATmega32, AT94K */
N (22, bfd_mach_avr5, "avr:5", FALSE, NULL)
};
const bfd_arch_info_type bfd_avr_arch =
N (16, bfd_mach_avr2, "avr", TRUE, & arch_info_struct[0]);
/* This routine is provided two arch_infos and works out which AVR
machine which would be compatible with both and returns a pointer
to its info structure. */
static const bfd_arch_info_type *
compatible (a,b)
const bfd_arch_info_type * a;
const bfd_arch_info_type * b;
compatible (const bfd_arch_info_type * a,
const bfd_arch_info_type * b)
{
/* If a & b are for different architectures we can do nothing. */
if (a->arch != b->arch)
@ -91,3 +50,40 @@ compatible (a,b)
/* Never reached! */
return NULL;
}
#define N(addr_bits, machine, print, default, next) \
{ \
8, /* 8 bits in a word. */ \
addr_bits, /* bits in an address. */ \
8, /* 8 bits in a byte. */ \
bfd_arch_avr, \
machine, /* Machine number. */ \
"avr", /* Architecture name. */ \
print, /* Printable name. */ \
1, /* Section align power. */ \
default, /* Is this the default ? */ \
compatible, \
bfd_default_scan, \
next \
}
static const bfd_arch_info_type arch_info_struct[] =
{
/* AT90S1200, ATtiny1x, ATtiny28. */
N (16, bfd_mach_avr1, "avr:1", FALSE, & arch_info_struct[1]),
/* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22. */
N (16, bfd_mach_avr2, "avr:2", FALSE, & arch_info_struct[2]),
/* ATmega103, ATmega603. */
N (22, bfd_mach_avr3, "avr:3", FALSE, & arch_info_struct[3]),
/* ATmega83, ATmega85. */
N (16, bfd_mach_avr4, "avr:4", FALSE, & arch_info_struct[4]),
/* ATmega161, ATmega163, ATmega32, AT94K. */
N (22, bfd_mach_avr5, "avr:5", FALSE, NULL)
};
const bfd_arch_info_type bfd_avr_arch =
N (16, bfd_mach_avr2, "avr", TRUE, & arch_info_struct[0]);

View File

@ -1,4 +1,4 @@
/* Copyright 1998, 1999, 2000, 2001, 2002, 2003
/* Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
@ -113,6 +113,29 @@ ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
return 0;
}
static const char*
ins_immu5b (const struct ia64_operand *self, ia64_insn value,
ia64_insn *code)
{
if (value < 32 || value > 63)
return "value must be between 32 and 63";
return ins_immu (self, value - 32, code);
}
static const char*
ext_immu5b (const struct ia64_operand *self, ia64_insn code,
ia64_insn *valuep)
{
const char *result;
result = ext_immu (self, code, valuep);
if (result)
return result;
*valuep = *valuep + 32;
return 0;
}
static const char*
ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
{
@ -506,6 +529,8 @@ const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] =
"a 1-bit integer (-1, 0)" },
{ ABS, ins_immu, ext_immu, 0, {{ 2, 13}}, UDEC, /* IMMU2 */
"a 2-bit unsigned (0-3)" },
{ ABS, ins_immu5b, ext_immu5b, 0, {{ 5, 14}}, UDEC, /* IMMU5b */
"a 5-bit unsigned (32 + (0-31))" },
{ ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, 0, /* IMMU7a */
"a 7-bit unsigned (0-127)" },
{ ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, 0, /* IMMU7b */

View File

@ -1,6 +1,6 @@
/* BFD library support routines for architectures.
Copyright 1990, 1991, 1992, 1993, 1994, 1997, 1998, 2000, 2001, 2002,
2003, 2004 Free Software Foundation, Inc.
2003, 2004, 2006 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -22,9 +22,14 @@
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "opcode/m68k.h"
static const bfd_arch_info_type *
bfd_m68k_compatible (const bfd_arch_info_type *a,
const bfd_arch_info_type *b);
#define N(name, print,d,next) \
{ 32, 32, 8, bfd_arch_m68k, name, "m68k",print,2,d,bfd_default_compatible,bfd_default_scan, next, }
{ 32, 32, 8, bfd_arch_m68k, name, "m68k",print,2,d,bfd_m68k_compatible,bfd_default_scan, next, }
static const bfd_arch_info_type arch_info_struct[] =
{
@ -34,19 +39,187 @@ static const bfd_arch_info_type arch_info_struct[] =
N(bfd_mach_m68020, "m68k:68020", FALSE, &arch_info_struct[4]),
N(bfd_mach_m68030, "m68k:68030", FALSE, &arch_info_struct[5]),
N(bfd_mach_m68040, "m68k:68040", FALSE, &arch_info_struct[6]),
N(bfd_mach_cpu32, "m68k:cpu32", FALSE, &arch_info_struct[7]),
N(bfd_mach_mcf5200, "m68k:5200", FALSE, &arch_info_struct[8]),
N(bfd_mach_mcf5206e,"m68k:5206e", FALSE, &arch_info_struct[9]),
N(bfd_mach_mcf5307, "m68k:5307", FALSE, &arch_info_struct[10]),
N(bfd_mach_mcf5407, "m68k:5407", FALSE, &arch_info_struct[11]),
N(bfd_mach_m68060, "m68k:68060", FALSE, &arch_info_struct[12]),
N(bfd_mach_mcf528x, "m68k:528x", FALSE, &arch_info_struct[13]),
N(bfd_mach_mcf521x, "m68k:521x", FALSE, &arch_info_struct[14]),
N(bfd_mach_mcf5249, "m68k:5249", FALSE, &arch_info_struct[15]),
N(bfd_mach_mcf547x, "m68k:547x", FALSE, &arch_info_struct[16]),
N(bfd_mach_mcf548x, "m68k:548x", FALSE, &arch_info_struct[17]),
N(bfd_mach_mcfv4e, "m68k:cfv4e", FALSE, 0),
N(bfd_mach_m68060, "m68k:68060", FALSE, &arch_info_struct[7]),
N(bfd_mach_cpu32, "m68k:cpu32", FALSE, &arch_info_struct[8]),
/* Various combinations of CF architecture features */
N(bfd_mach_mcf_isa_a_nodiv, "m68k:isa-a:nodiv",
FALSE, &arch_info_struct[9]),
N(bfd_mach_mcf_isa_a, "m68k:isa-a",
FALSE, &arch_info_struct[10]),
N(bfd_mach_mcf_isa_a_mac, "m68k:isa-a:mac",
FALSE, &arch_info_struct[11]),
N(bfd_mach_mcf_isa_a_emac, "m68k:isa-a:emac",
FALSE, &arch_info_struct[12]),
N(bfd_mach_mcf_isa_aplus, "m68k:isa-aplus",
FALSE, &arch_info_struct[13]),
N(bfd_mach_mcf_isa_aplus_mac, "m68k:isa-aplus:mac",
FALSE, &arch_info_struct[14]),
N(bfd_mach_mcf_isa_aplus_emac, "m68k:isa-aplus:emac",
FALSE, &arch_info_struct[15]),
N(bfd_mach_mcf_isa_b_nousp, "m68k:isa-b:nousp",
FALSE, &arch_info_struct[16]),
N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:isa-b:nousp:mac",
FALSE, &arch_info_struct[17]),
N(bfd_mach_mcf_isa_b_nousp_emac, "m68k:isa-b:nousp:emac",
FALSE, &arch_info_struct[18]),
N(bfd_mach_mcf_isa_b, "m68k:isa-b",
FALSE, &arch_info_struct[19]),
N(bfd_mach_mcf_isa_b_mac, "m68k:isa-b:mac",
FALSE, &arch_info_struct[20]),
N(bfd_mach_mcf_isa_b_emac, "m68k:isa-b:emac",
FALSE, &arch_info_struct[21]),
N(bfd_mach_mcf_isa_b_float, "m68k:isa-b:float",
FALSE, &arch_info_struct[22]),
N(bfd_mach_mcf_isa_b_float_mac, "m68k:isa-b:float:mac",
FALSE, &arch_info_struct[23]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:isa-b:float:emac",
FALSE, &arch_info_struct[24]),
/* Legacy names for CF architectures */
N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[25]),
N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[26]),
N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[27]),
N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[28]),
N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[29]),
N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[30]),
N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[31]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:547x",
FALSE, &arch_info_struct[32]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:548x",
FALSE, &arch_info_struct[33]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:cfv4e", FALSE, 0),
};
const bfd_arch_info_type bfd_m68k_arch =
N(0, "m68k", TRUE, &arch_info_struct[0]);
/* Table indexed by bfd_mach_arch number indicating which
architectural features are supported. */
static const unsigned m68k_arch_features[] =
{
0,
m68000|m68881|m68851,
m68000|m68881|m68851,
m68010|m68881|m68851,
m68020|m68881|m68851,
m68030|m68881|m68851,
m68040|m68881|m68851,
m68060|m68881|m68851,
cpu32|m68881,
mcfisa_a,
mcfisa_a|mcfhwdiv,
mcfisa_a|mcfhwdiv|mcfmac,
mcfisa_a|mcfhwdiv|mcfemac,
mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp,
mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp|mcfmac,
mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp|mcfemac,
mcfisa_a|mcfhwdiv|mcfisa_b,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|mcfmac,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|mcfemac,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfmac,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfemac,
};
/* Return the count of bits set in MASK */
static unsigned
bit_count (unsigned mask)
{
unsigned ix;
for (ix = 0; mask; ix++)
/* Clear the LSB set */
mask ^= mask & -mask;
return ix;
}
/* Return the architectural features supported by MACH */
unsigned
bfd_m68k_mach_to_features (int mach)
{
if ((unsigned)mach
>= sizeof (m68k_arch_features) / sizeof (m68k_arch_features[0]))
mach = 0;
return m68k_arch_features[mach];
}
/* Return the bfd machine that most closely represents the
architectural features. We find the machine with the smallest
number of additional features. If there is no such machine, we
find the one with the smallest number of missing features. */
int bfd_m68k_features_to_mach (unsigned features)
{
int superset = 0, subset = 0;
unsigned extra = 99, missing = 99;
unsigned ix;
for (ix = 0;
ix != sizeof (m68k_arch_features) / sizeof (m68k_arch_features[0]);
ix++)
{
unsigned this_extra, this_missing;
if (m68k_arch_features[ix] == features)
return ix;
this_extra = bit_count (m68k_arch_features[ix] & ~features);
if (this_extra < extra)
{
extra = this_extra;
superset = ix;
}
this_missing = bit_count (features & ~m68k_arch_features[ix]);
if (this_missing < missing)
{
missing = this_missing;
superset = ix;
}
}
return superset ? superset : subset;
}
static const bfd_arch_info_type *
bfd_m68k_compatible (const bfd_arch_info_type *a,
const bfd_arch_info_type *b)
{
if (a->arch != b->arch)
return NULL;
if (a->bits_per_word != b->bits_per_word)
return NULL;
if (!a->mach)
return b;
if (!b->mach)
return a;
if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
/* Merge m68k machine. */
return a->mach > b->mach ? a : b;
else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
&& b->mach >= bfd_mach_mcf_isa_a_nodiv)
{
/* Merge cf machine. */
unsigned features = (bfd_m68k_mach_to_features (a->mach)
| bfd_m68k_mach_to_features (b->mach));
/* ISA A+ and ISA B are incompatible. */
if ((~features & (mcfisa_aa | mcfisa_b)) == 0)
return NULL;
/* MAC and EMAC code cannot be merged. */
if ((~features & (mcfmac | mcfemac)) == 0)
return NULL;
return bfd_lookup_arch (a->arch, bfd_m68k_features_to_mach (features));
}
else
/* They are incompatible. */
return NULL;
}

71
gnu/dist/gdb6/bfd/cpu-mt.c vendored Normal file
View File

@ -0,0 +1,71 @@
/* BFD support for the Morpho Technologies MT processor.
Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
const bfd_arch_info_type arch_info_struct[] =
{
{
32, /* Bits per word - not really true. */
32, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_mt, /* Architecture. */
bfd_mach_mrisc2, /* Machine. */
"mt", /* Architecture name. */
"ms1-003", /* Printable name. */
1, /* Section align power. */
FALSE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
&arch_info_struct[1] /* Next in list. */
},
{
32, /* Bits per word - not really true. */
32, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_mt, /* Architecture. */
bfd_mach_ms2, /* Machine. */
"mt", /* Architecture name. */
"ms2", /* Printable name. */
1, /* Section align power. */
FALSE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
NULL /* Next in list. */
},
};
const bfd_arch_info_type bfd_mt_arch =
{
32, /* Bits per word - not really true. */
32, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_mt, /* Architecture. */
bfd_mach_ms1, /* Machine. */
"mt", /* Architecture name. */
"ms1", /* Printable name. */
1, /* Section align power. */
TRUE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
&arch_info_struct[0] /* Next in list. */
};

View File

@ -295,6 +295,20 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
FALSE, /* not the default */
powerpc_compatible,
bfd_default_scan,
&bfd_powerpc_archs[15]
},
{
32, /* 32 bits in a word */
32, /* 32 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_750,
"powerpc",
"powerpc:750",
3,
FALSE, /* not the default */
powerpc_compatible,
bfd_default_scan,
0
}
};

73
gnu/dist/gdb6/bfd/cpu-xc16x.c vendored Normal file
View File

@ -0,0 +1,73 @@
/* BFD support for the Infineon XC16X Microcontroller.
Copyright 2006 Free Software Foundation, Inc.
Contributed by KPIT Cummins Infosystems
This file is part of BFD, the Binary File Descriptor library.
Contributed by Anil Paranjpe(anilp1@kpitcummins.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
const bfd_arch_info_type xc16xs_info_struct =
{
16, /* Bits per word. */
16, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_xc16x, /* Architecture. */
bfd_mach_xc16xs, /* Machine. */
"xc16x", /* Architecture name. */
"xc16xs", /* Printable name. */
1, /* Section alignment - 16 bit. */
TRUE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
NULL /* Next in list. */
};
const bfd_arch_info_type xc16xl_info_struct =
{
16, /* Bits per word. */
32, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_xc16x, /* Architecture. */
bfd_mach_xc16xl, /* Machine. */
"xc16x", /* Architecture name. */
"xc16xl", /* Printable name. */
1, /* Section alignment - 16 bit. */
TRUE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
& xc16xs_info_struct /* Next in list. */
};
const bfd_arch_info_type bfd_xc16x_arch =
{
16, /* Bits per word. */
16, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_xc16x, /* Architecture. */
bfd_mach_xc16x, /* Machine. */
"xc16x", /* Architecture name. */
"xc16x", /* Printable name. */
1, /* Section alignment - 16 bit. */
TRUE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
& xc16xl_info_struct /* Next in list. */
};

View File

@ -1,3 +1,18 @@
2006-05-11 Carlos O'Donell <carlos@codesourcery.com>
* bfd.texinfo: Rename "Index" to "BFD Index"
2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
* Makefile.am: Add install-html and install-html-am targets.
Define datarootdir, docdir and htmldir.
* Makefile.in: Regenerate.
2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
* Makefile.am: Add html target.
* Makefile.in: Regenerate.
2005-07-24 Daniel Jacobowitz <dan@codesourcery.com>
* chew.c: Include <string.h>.

View File

@ -68,7 +68,7 @@ chew.o: chew.c
protos: libbfd.h libcoff.h bfd.h
$(srcdir)/bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo
# We can't replace these rules with an implicit rule, because
# makes without VPATH support couldn't find the .h files in `..'.
@ -287,3 +287,28 @@ MAINTAINERCLEANFILES = $(DOCFILES)
# We want install to imply install-info as per GNU standards, despite the
# cygnus option.
install: install-info
html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
install-html: install-html-am
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
@list='$(HTMLS)'; for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
f=$(html__strip_dir) \
if test -d "$$d$$p"; then \
echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
$(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
else \
echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
fi; \
done

View File

@ -181,6 +181,8 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
@ -188,6 +190,7 @@ host_cpu = @host_cpu@
host_noncanonical = @host_noncanonical@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@ -313,6 +316,7 @@ MOSTLYCLEANFILES = $(MKDOC) *.o
CLEANFILES = *.p *.ip
DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
MAINTAINERCLEANFILES = $(DOCFILES)
html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
all: all-am
.SUFFIXES:
@ -596,7 +600,7 @@ chew.o: chew.c
protos: libbfd.h libcoff.h bfd.h
$(srcdir)/bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo
# We can't replace these rules with an implicit rule, because
# makes without VPATH support couldn't find the .h files in `..'.
@ -761,6 +765,25 @@ bfd.h: $(BFD_H_DEP)
# We want install to imply install-info as per GNU standards, despite the
# cygnus option.
install: install-info
install-html: install-html-am
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
@list='$(HTMLS)'; for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
f=$(html__strip_dir) \
if test -d "$$d$$p"; then \
echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
$(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
else \
echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
fi; \
done
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -46,16 +46,22 @@ enum bfd_architecture
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf5200 9
#define bfd_mach_mcf5206e 10
#define bfd_mach_mcf5307 11
#define bfd_mach_mcf5407 12
#define bfd_mach_mcf528x 13
#define bfd_mach_mcfv4e 14
#define bfd_mach_mcf521x 15
#define bfd_mach_mcf5249 16
#define bfd_mach_mcf547x 17
#define bfd_mach_mcf548x 18
#define bfd_mach_mcf_isa_a_nodiv 9
#define bfd_mach_mcf_isa_a 10
#define bfd_mach_mcf_isa_a_mac 11
#define bfd_mach_mcf_isa_a_emac 12
#define bfd_mach_mcf_isa_aplus 13
#define bfd_mach_mcf_isa_aplus_mac 14
#define bfd_mach_mcf_isa_aplus_emac 15
#define bfd_mach_mcf_isa_b_nousp 16
#define bfd_mach_mcf_isa_b_nousp_mac 17
#define bfd_mach_mcf_isa_b_nousp_emac 18
#define bfd_mach_mcf_isa_b 19
#define bfd_mach_mcf_isa_b_mac 20
#define bfd_mach_mcf_isa_b_emac 21
#define bfd_mach_mcf_isa_b_float 22
#define bfd_mach_mcf_isa_b_float_mac 23
#define bfd_mach_mcf_isa_b_float_emac 24
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@ -283,9 +289,10 @@ enum bfd_architecture
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
bfd_arch_ms1,
bfd_arch_mt,
#define bfd_mach_ms1 1
#define bfd_mach_mrisc2 2
#define bfd_mach_ms2 3
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers. */
#define bfd_mach_avr1 1
@ -317,7 +324,7 @@ enum bfd_architecture
#define bfd_mach_msp13 13
#define bfd_mach_msp14 14
#define bfd_mach_msp15 15
#define bfd_mach_msp16 16
#define bfd_mach_msp16 16
#define bfd_mach_msp21 21
#define bfd_mach_msp31 31
#define bfd_mach_msp32 32
@ -326,6 +333,10 @@ enum bfd_architecture
#define bfd_mach_msp42 42
#define bfd_mach_msp43 43
#define bfd_mach_msp44 44
bfd_arch_xc16x, /* Infineon's XC16X Series. */
#define bfd_mach_xc16x 1
#define bfd_mach_xc16xl 2
#define bfd_mach_xc16xs 3
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
bfd_arch_maxq, /* Dallas MAXQ 10/20 */

View File

@ -19,71 +19,71 @@ section entitled "GNU Free Documentation License".

Indirect:
bfd.info-1: 724
bfd.info-2: 277335
bfd.info-2: 279689

Tag Table:
(Indirect)
Node: Top724
Node: Overview1056
Node: History2107
Node: How It Works3053
Node: What BFD Version 2 Can Do4595
Node: BFD information loss5910
Node: Canonical format8442
Node: BFD front end12814
Node: Memory Usage38700
Node: Initialization39928
Node: Sections40387
Node: Section Input40870
Node: Section Output42235
Node: typedef asection44721
Node: section prototypes69678
Node: Symbols79358
Node: Reading Symbols80953
Node: Writing Symbols82060
Node: Mini Symbols83769
Node: typedef asymbol84743
Node: symbol handling functions89661
Node: Archives95003
Node: Formats98729
Node: Relocations101677
Node: typedef arelent102404
Node: howto manager118122
Node: Core Files178580
Node: Targets179714
Node: bfd_target181684
Node: Architectures202127
Node: Opening and Closing223020
Node: Internal234022
Node: File Caching240355
Node: Linker Functions242269
Node: Creating a Linker Hash Table243942
Node: Adding Symbols to the Hash Table245680
Node: Differing file formats246580
Node: Adding symbols from an object file248328
Node: Adding symbols from an archive250479
Node: Performing the Final Link252893
Node: Information provided by the linker254135
Node: Relocating the section contents255289
Node: Writing the symbol table257040
Node: Hash Tables260033
Node: Creating and Freeing a Hash Table261231
Node: Looking Up or Entering a String262481
Node: Traversing a Hash Table263734
Node: Deriving a New Hash Table Type264523
Node: Define the Derived Structures265589
Node: Write the Derived Creation Routine266670
Node: Write Other Derived Routines269294
Node: BFD back ends270609
Node: What to Put Where270879
Node: aout271017
Node: coff277335
Node: elf301812
Node: mmo302675
Node: File layout303603
Node: Symbol-table309250
Node: mmo section mapping313019
Node: GNU Free Documentation License316671
Node: Index336396
Node: Overview1063
Node: History2114
Node: How It Works3060
Node: What BFD Version 2 Can Do4602
Node: BFD information loss5917
Node: Canonical format8449
Node: BFD front end12821
Node: Memory Usage38435
Node: Initialization39663
Node: Sections40122
Node: Section Input40605
Node: Section Output41970
Node: typedef asection44456
Node: section prototypes68938
Node: Symbols78618
Node: Reading Symbols80213
Node: Writing Symbols81320
Node: Mini Symbols83029
Node: typedef asymbol84003
Node: symbol handling functions88921
Node: Archives94263
Node: Formats97989
Node: Relocations100937
Node: typedef arelent101664
Node: howto manager117475
Node: Core Files180075
Node: Targets181892
Node: bfd_target183862
Node: Architectures203942
Node: Opening and Closing225374
Node: Internal236376
Node: File Caching242709
Node: Linker Functions244623
Node: Creating a Linker Hash Table246296
Node: Adding Symbols to the Hash Table248034
Node: Differing file formats248934
Node: Adding symbols from an object file250682
Node: Adding symbols from an archive252833
Node: Performing the Final Link255247
Node: Information provided by the linker256489
Node: Relocating the section contents257643
Node: Writing the symbol table259394
Node: Hash Tables262387
Node: Creating and Freeing a Hash Table263585
Node: Looking Up or Entering a String264835
Node: Traversing a Hash Table266088
Node: Deriving a New Hash Table Type266877
Node: Define the Derived Structures267943
Node: Write the Derived Creation Routine269024
Node: Write Other Derived Routines271648
Node: BFD back ends272963
Node: What to Put Where273233
Node: aout273371
Node: coff279689
Node: elf304166
Node: mmo305029
Node: File layout305957
Node: Symbol-table311604
Node: mmo section mapping315373
Node: GNU Free Documentation License319025
Node: BFD Index338754

End Tag Table

View File

@ -27,7 +27,7 @@ File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir)
* BFD front end:: BFD front end
* BFD back ends:: BFD back ends
* GNU Free Documentation License:: GNU Free Documentation License
* Index:: Index
* BFD Index:: BFD Index

File: bfd.info, Node: Overview, Next: BFD front end, Prev: Top, Up: Top
@ -941,18 +941,7 @@ This function should be called when the bfd state saved by
bfd_preserve_save is no longer needed. ie. when the back-end object_p
function returns with success.
2.3.1.20 `bfd_hide_symbol'
..........................
*Synopsis*
void bfd_hide_symbol (bfd *,
struct bfd_link_info *,
struct bfd_link_hash_entry *,
bfd_boolean);
*Description*
This function hides a symbol so that it won't be exported.
2.3.1.21 `struct bfd_iovec'
2.3.1.20 `struct bfd_iovec'
...........................
*Description*
@ -982,7 +971,7 @@ below).
int (*bstat) (struct bfd *abfd, struct stat *sb);
};
2.3.1.22 `bfd_get_mtime'
2.3.1.21 `bfd_get_mtime'
........................
*Synopsis*
@ -991,7 +980,7 @@ below).
Return the file modification time (as read from the file system, or
from the archive header for archive members).
2.3.1.23 `bfd_get_size'
2.3.1.22 `bfd_get_size'
.......................
*Synopsis*
@ -1594,11 +1583,6 @@ Here is the section structure:
|| ((SEC) == bfd_com_section_ptr) \
|| ((SEC) == bfd_ind_section_ptr))
extern const struct bfd_symbol * const bfd_abs_symbol;
extern const struct bfd_symbol * const bfd_com_symbol;
extern const struct bfd_symbol * const bfd_und_symbol;
extern const struct bfd_symbol * const bfd_ind_symbol;
/* Macros to handle insertion and deletion of a bfd's sections. These
only handle the list pointers, ie. do not adjust section_count,
target_index etc. */
@ -1689,7 +1673,7 @@ Here is the section structure:
#define bfd_section_removed_from_list(ABFD, S) \
((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
/* name, id, index, next, prev, flags, user_set_vma, */ \
{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
\
@ -1720,11 +1704,8 @@ Here is the section structure:
/* target_index, used_by_bfd, constructor_chain, owner, */ \
0, NULL, NULL, NULL, \
\
/* symbol, */ \
(struct bfd_symbol *) SYM, \
\
/* symbol_ptr_ptr, */ \
(struct bfd_symbol **) SYM_PTR, \
/* symbol, symbol_ptr_ptr, */ \
(struct bfd_symbol *) SYM, &SEC.symbol, \
\
/* map_head, map_tail */ \
{ NULL }, { NULL } \
@ -2836,11 +2817,12 @@ a relocation.
/* Do not complain on overflow. */
complain_overflow_dont,
/* Complain if the bitfield overflows, whether it is considered
as signed or unsigned. */
/* Complain if the value overflows when considered as a signed
number one bit larger than the field. ie. A bitfield of N bits
is allowed to represent -2**n to 2**n-1. */
complain_overflow_bitfield,
/* Complain if the value overflows when considered as signed
/* Complain if the value overflows when considered as a signed
number. */
complain_overflow_signed,
@ -3423,6 +3405,10 @@ attributes.
-- : BFD_RELOC_MIPS_TLS_TPREL_LO16
MIPS ELF relocations.
-- : BFD_RELOC_MIPS_COPY
-- : BFD_RELOC_MIPS_JUMP_SLOT
MIPS ELF relocations (VxWorks extensions).
-- : BFD_RELOC_FRV_LABEL16
-- : BFD_RELOC_FRV_LABEL24
-- : BFD_RELOC_FRV_LO16
@ -3511,6 +3497,9 @@ attributes.
-- : BFD_RELOC_386_TLS_DTPMOD32
-- : BFD_RELOC_386_TLS_DTPOFF32
-- : BFD_RELOC_386_TLS_TPOFF32
-- : BFD_RELOC_386_TLS_GOTDESC
-- : BFD_RELOC_386_TLS_DESC_CALL
-- : BFD_RELOC_386_TLS_DESC
i386/elf relocations
-- : BFD_RELOC_X86_64_GOT32
@ -3531,6 +3520,14 @@ attributes.
-- : BFD_RELOC_X86_64_TPOFF32
-- : BFD_RELOC_X86_64_GOTOFF64
-- : BFD_RELOC_X86_64_GOTPC32
-- : BFD_RELOC_X86_64_GOT64
-- : BFD_RELOC_X86_64_GOTPCREL64
-- : BFD_RELOC_X86_64_GOTPC64
-- : BFD_RELOC_X86_64_GOTPLT64
-- : BFD_RELOC_X86_64_PLTOFF64
-- : BFD_RELOC_X86_64_GOTPC32_TLSDESC
-- : BFD_RELOC_X86_64_TLSDESC_CALL
-- : BFD_RELOC_X86_64_TLSDESC
x86-64/elf relocations
-- : BFD_RELOC_NS32K_IMM_8
@ -3679,6 +3676,13 @@ attributes.
is not stored in the instruction. The 2nd lowest bit comes from a
1 bit field in the instruction.
-- : BFD_RELOC_ARM_PCREL_CALL
ARM 26-bit pc-relative branch for an unconditional BL or BLX
instruction.
-- : BFD_RELOC_ARM_PCREL_JUMP
ARM 26-bit pc-relative branch for B or conditional BL instruction.
-- : BFD_RELOC_THUMB_PCREL_BRANCH7
-- : BFD_RELOC_THUMB_PCREL_BRANCH9
-- : BFD_RELOC_THUMB_PCREL_BRANCH12
@ -3717,6 +3721,16 @@ attributes.
-- : BFD_RELOC_ARM_PREL31
31-bit PC relative address.
-- : BFD_RELOC_ARM_MOVW
-- : BFD_RELOC_ARM_MOVT
-- : BFD_RELOC_ARM_MOVW_PCREL
-- : BFD_RELOC_ARM_MOVT_PCREL
-- : BFD_RELOC_ARM_THUMB_MOVW
-- : BFD_RELOC_ARM_THUMB_MOVT
-- : BFD_RELOC_ARM_THUMB_MOVW_PCREL
-- : BFD_RELOC_ARM_THUMB_MOVT_PCREL
Low and High halfword relocations for MOVW and MOVT instructions.
-- : BFD_RELOC_ARM_JUMP_SLOT
-- : BFD_RELOC_ARM_GLOB_DAT
-- : BFD_RELOC_ARM_GOT32
@ -3899,6 +3913,22 @@ attributes.
-- : BFD_RELOC_BFIN_24_PCREL_JUMP_L
ADI Blackfin Long Jump pcrel.
-- : BFD_RELOC_BFIN_GOT17M4
-- : BFD_RELOC_BFIN_GOTHI
-- : BFD_RELOC_BFIN_GOTLO
-- : BFD_RELOC_BFIN_FUNCDESC
-- : BFD_RELOC_BFIN_FUNCDESC_GOT17M4
-- : BFD_RELOC_BFIN_FUNCDESC_GOTHI
-- : BFD_RELOC_BFIN_FUNCDESC_GOTLO
-- : BFD_RELOC_BFIN_FUNCDESC_VALUE
-- : BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4
-- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI
-- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO
-- : BFD_RELOC_BFIN_GOTOFF17M4
-- : BFD_RELOC_BFIN_GOTOFFHI
-- : BFD_RELOC_BFIN_GOTOFFLO
ADI Blackfin FD-PIC relocations.
-- : BFD_RELOC_BFIN_GOT
ADI Blackfin GOT relocation.
@ -4034,6 +4064,9 @@ attributes.
DLX relocs
-- : BFD_RELOC_M32C_HI8
-- : BFD_RELOC_M32C_RL_JUMP
-- : BFD_RELOC_M32C_RL_1ADDR
-- : BFD_RELOC_M32C_RL_2ADDR
Renesas M16C/M32C Relocations.
-- : BFD_RELOC_M32R_24
@ -4301,6 +4334,10 @@ attributes.
high 8 bit of program memory address) into 8 bit immediate value
of LDI insn.
-- : BFD_RELOC_AVR_MS8_LDI
This is a 16 bit reloc for the AVR that stores 8 bit value (most
high 8 bit of 32 bit value) into 8 bit immediate value of LDI insn.
-- : BFD_RELOC_AVR_LO8_LDI_NEG
This is a 16 bit reloc for the AVR that stores negated 8 bit value
(usually data memory address) into 8 bit immediate value of SUBI
@ -4316,6 +4353,10 @@ attributes.
(most high 8 bit of program memory address) into 8 bit immediate
value of LDI or SUBI insn.
-- : BFD_RELOC_AVR_MS8_LDI_NEG
This is a 16 bit reloc for the AVR that stores negated 8 bit value
(msb of 32 bit value) into 8 bit immediate value of LDI insn.
-- : BFD_RELOC_AVR_LO8_LDI_PM
This is a 16 bit reloc for the AVR that stores 8 bit value (usually
command address) into 8 bit immediate value of LDI insn.
@ -4798,25 +4839,34 @@ attributes.
-- : BFD_RELOC_XSTORMY16_FPTR16
Sony Xstormy16 Relocations.
-- : BFD_RELOC_XC16X_PAG
-- : BFD_RELOC_XC16X_POF
-- : BFD_RELOC_XC16X_SEG
-- : BFD_RELOC_XC16X_SOF
Infineon Relocations.
-- : BFD_RELOC_VAX_GLOB_DAT
-- : BFD_RELOC_VAX_JMP_SLOT
-- : BFD_RELOC_VAX_RELATIVE
Relocations used by VAX ELF.
-- : BFD_RELOC_MS1_PC16
Morpho MS1 - 16 bit immediate relocation.
-- : BFD_RELOC_MT_PC16
Morpho MT - 16 bit immediate relocation.
-- : BFD_RELOC_MS1_HI16
Morpho MS1 - Hi 16 bits of an address.
-- : BFD_RELOC_MT_HI16
Morpho MT - Hi 16 bits of an address.
-- : BFD_RELOC_MS1_LO16
Morpho MS1 - Low 16 bits of an address.
-- : BFD_RELOC_MT_LO16
Morpho MT - Low 16 bits of an address.
-- : BFD_RELOC_MS1_GNU_VTINHERIT
Morpho MS1 - Used to tell the linker which vtable entries are used.
-- : BFD_RELOC_MT_GNU_VTINHERIT
Morpho MT - Used to tell the linker which vtable entries are used.
-- : BFD_RELOC_MS1_GNU_VTENTRY
Morpho MS1 - Used to tell the linker which vtable entries are used.
-- : BFD_RELOC_MT_GNU_VTENTRY
Morpho MT - Used to tell the linker which vtable entries are used.
-- : BFD_RELOC_MT_PCINSN8
Morpho MT - 8 bit immediate relocation.
-- : BFD_RELOC_MSP430_10_PCREL
-- : BFD_RELOC_MSP430_16_PCREL
@ -5042,6 +5092,23 @@ the file the BFD ABFD is attached to.
Return `TRUE' if the core file attached to CORE_BFD was generated by a
run of the executable file attached to EXEC_BFD, `FALSE' otherwise.
2.11.1.4 `generic_core_file_matches_executable_p'
.................................................
*Synopsis*
bfd_boolean generic_core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
*Description*
Return TRUE if the core file attached to CORE_BFD was generated by a
run of the executable file attached to EXEC_BFD. The match is based on
executable basenames only.
Note: When not able to determine the core file failing command or
the executable name, we still return TRUE even though we're not sure
that core file and executable match. This is to avoid generating a
false warning in situations where we really don't know whether they
match or not.

File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end
@ -5431,7 +5498,6 @@ BFD_JUMP_TABLE macros.
NAME##_bfd_link_split_section, \
NAME##_bfd_gc_sections, \
NAME##_bfd_merge_sections, \
_bfd_generic_match_sections_by_type, \
NAME##_bfd_is_group_section, \
NAME##_bfd_discard_group, \
NAME##_section_already_linked \
@ -5471,12 +5537,6 @@ BFD_JUMP_TABLE macros.
/* Attempt to merge SEC_MERGE sections. */
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
#define bfd_match_sections_by_type(abfd, asec, bbfd, bsec) \
BFD_SEND (abfd, _bfd_match_sections_by_type, (abfd, asec, bbfd, bsec))
/* Return TRUE if 2 section types are compatible. */
bfd_boolean (*_bfd_match_sections_by_type)
(bfd *, const asection *, bfd *, const asection *);
/* Is this section a member of a group? */
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
@ -5621,16 +5681,22 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030.
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf5200 9
#define bfd_mach_mcf5206e 10
#define bfd_mach_mcf5307 11
#define bfd_mach_mcf5407 12
#define bfd_mach_mcf528x 13
#define bfd_mach_mcfv4e 14
#define bfd_mach_mcf521x 15
#define bfd_mach_mcf5249 16
#define bfd_mach_mcf547x 17
#define bfd_mach_mcf548x 18
#define bfd_mach_mcf_isa_a_nodiv 9
#define bfd_mach_mcf_isa_a 10
#define bfd_mach_mcf_isa_a_mac 11
#define bfd_mach_mcf_isa_a_emac 12
#define bfd_mach_mcf_isa_aplus 13
#define bfd_mach_mcf_isa_aplus_mac 14
#define bfd_mach_mcf_isa_aplus_emac 15
#define bfd_mach_mcf_isa_b_nousp 16
#define bfd_mach_mcf_isa_b_nousp_mac 17
#define bfd_mach_mcf_isa_b_nousp_emac 18
#define bfd_mach_mcf_isa_b 19
#define bfd_mach_mcf_isa_b_mac 20
#define bfd_mach_mcf_isa_b_emac 21
#define bfd_mach_mcf_isa_b_float 22
#define bfd_mach_mcf_isa_b_float_mac 23
#define bfd_mach_mcf_isa_b_float_emac 24
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@ -5858,9 +5924,10 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030.
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
bfd_arch_ms1,
bfd_arch_mt,
#define bfd_mach_ms1 1
#define bfd_mach_mrisc2 2
#define bfd_mach_ms2 3
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers. */
#define bfd_mach_avr1 1
@ -5901,6 +5968,10 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030.
#define bfd_mach_msp42 42
#define bfd_mach_msp43 43
#define bfd_mach_msp44 44
bfd_arch_xc16x, /* Infineon's XC16X Series. */
#define bfd_mach_xc16x 1
#define bfd_mach_xc16xl 2
#define bfd_mach_xc16xs 3
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
bfd_arch_maxq, /* Dallas MAXQ 10/20 */

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@ This file documents the binary file descriptor library libbfd.
* BFD front end:: BFD front end
* BFD back ends:: BFD back ends
* GNU Free Documentation License:: GNU Free Documentation License
* Index:: Index
* BFD Index:: BFD Index
@end menu
@node Overview, BFD front end, Top, Top
@ -324,11 +324,11 @@ All of BFD lives in one directory.
@node mmo, , elf, BFD back ends
@include mmo.texi
@node GNU Free Documentation License, Index, BFD back ends, Top
@node GNU Free Documentation License, BFD Index, BFD back ends, Top
@include fdl.texi
@node Index, , GNU Free Documentation License, Top
@unnumbered Index
@node BFD Index, , GNU Free Documentation License, Top
@unnumbered BFD Index
@printindex cp
@tex

View File

@ -719,15 +719,3 @@ This function should be called when the bfd state saved by
bfd_preserve_save is no longer needed. ie. when the back-end
object_p function returns with success.
@findex bfd_hide_symbol
@subsubsection @code{bfd_hide_symbol}
@strong{Synopsis}
@example
void bfd_hide_symbol (bfd *,
struct bfd_link_info *,
struct bfd_link_hash_entry *,
bfd_boolean);
@end example
@strong{Description}@*
This function hides a symbol so that it won't be exported.

View File

@ -39,3 +39,22 @@ Return @code{TRUE} if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached to
@var{exec_bfd}, @code{FALSE} otherwise.
@findex generic_core_file_matches_executable_p
@subsubsection @code{generic_core_file_matches_executable_p}
@strong{Synopsis}
@example
bfd_boolean generic_core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
@end example
@strong{Description}@*
Return TRUE if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached
to @var{exec_bfd}. The match is based on executable
basenames only.
Note: When not able to determine the core file failing
command or the executable name, we still return TRUE even
though we're not sure that core file and executable match.
This is to avoid generating a false warning in situations
where we really don't know whether they match or not.

View File

@ -236,11 +236,12 @@ enum complain_overflow
/* Do not complain on overflow. */
complain_overflow_dont,
/* Complain if the bitfield overflows, whether it is considered
as signed or unsigned. */
/* Complain if the value overflows when considered as a signed
number one bit larger than the field. ie. A bitfield of N bits
is allowed to represent -2**n to 2**n-1. */
complain_overflow_bitfield,
/* Complain if the value overflows when considered as signed
/* Complain if the value overflows when considered as a signed
number. */
complain_overflow_signed,
@ -839,6 +840,10 @@ Relocation against a MIPS literal section.
@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_LO16
MIPS ELF relocations.
@end deffn
@deffn {} BFD_RELOC_MIPS_COPY
@deffnx {} BFD_RELOC_MIPS_JUMP_SLOT
MIPS ELF relocations (VxWorks extensions).
@end deffn
@deffn {} BFD_RELOC_FRV_LABEL16
@deffnx {} BFD_RELOC_FRV_LABEL24
@deffnx {} BFD_RELOC_FRV_LO16
@ -927,6 +932,9 @@ Adjust by program base.
@deffnx {} BFD_RELOC_386_TLS_DTPMOD32
@deffnx {} BFD_RELOC_386_TLS_DTPOFF32
@deffnx {} BFD_RELOC_386_TLS_TPOFF32
@deffnx {} BFD_RELOC_386_TLS_GOTDESC
@deffnx {} BFD_RELOC_386_TLS_DESC_CALL
@deffnx {} BFD_RELOC_386_TLS_DESC
i386/elf relocations
@end deffn
@deffn {} BFD_RELOC_X86_64_GOT32
@ -947,6 +955,14 @@ i386/elf relocations
@deffnx {} BFD_RELOC_X86_64_TPOFF32
@deffnx {} BFD_RELOC_X86_64_GOTOFF64
@deffnx {} BFD_RELOC_X86_64_GOTPC32
@deffnx {} BFD_RELOC_X86_64_GOT64
@deffnx {} BFD_RELOC_X86_64_GOTPCREL64
@deffnx {} BFD_RELOC_X86_64_GOTPC64
@deffnx {} BFD_RELOC_X86_64_GOTPLT64
@deffnx {} BFD_RELOC_X86_64_PLTOFF64
@deffnx {} BFD_RELOC_X86_64_GOTPC32_TLSDESC
@deffnx {} BFD_RELOC_X86_64_TLSDESC_CALL
@deffnx {} BFD_RELOC_X86_64_TLSDESC
x86-64/elf relocations
@end deffn
@deffn {} BFD_RELOC_NS32K_IMM_8
@ -1094,6 +1110,12 @@ Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
not stored in the instruction. The 2nd lowest bit comes from a 1 bit
field in the instruction.
@end deffn
@deffn {} BFD_RELOC_ARM_PCREL_CALL
ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.
@end deffn
@deffn {} BFD_RELOC_ARM_PCREL_JUMP
ARM 26-bit pc-relative branch for B or conditional BL instruction.
@end deffn
@deffn {} BFD_RELOC_THUMB_PCREL_BRANCH7
@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH9
@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH12
@ -1130,6 +1152,16 @@ pc-relative or some form of GOT-indirect relocation.
@deffn {} BFD_RELOC_ARM_PREL31
31-bit PC relative address.
@end deffn
@deffn {} BFD_RELOC_ARM_MOVW
@deffnx {} BFD_RELOC_ARM_MOVT
@deffnx {} BFD_RELOC_ARM_MOVW_PCREL
@deffnx {} BFD_RELOC_ARM_MOVT_PCREL
@deffnx {} BFD_RELOC_ARM_THUMB_MOVW
@deffnx {} BFD_RELOC_ARM_THUMB_MOVT
@deffnx {} BFD_RELOC_ARM_THUMB_MOVW_PCREL
@deffnx {} BFD_RELOC_ARM_THUMB_MOVT_PCREL
Low and High halfword relocations for MOVW and MOVT instructions.
@end deffn
@deffn {} BFD_RELOC_ARM_JUMP_SLOT
@deffnx {} BFD_RELOC_ARM_GLOB_DAT
@deffnx {} BFD_RELOC_ARM_GOT32
@ -1312,6 +1344,22 @@ ADI Blackfin Call.x not implemented.
@deffn {} BFD_RELOC_BFIN_24_PCREL_JUMP_L
ADI Blackfin Long Jump pcrel.
@end deffn
@deffn {} BFD_RELOC_BFIN_GOT17M4
@deffnx {} BFD_RELOC_BFIN_GOTHI
@deffnx {} BFD_RELOC_BFIN_GOTLO
@deffnx {} BFD_RELOC_BFIN_FUNCDESC
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOT17M4
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTHI
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTLO
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_VALUE
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI
@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO
@deffnx {} BFD_RELOC_BFIN_GOTOFF17M4
@deffnx {} BFD_RELOC_BFIN_GOTOFFHI
@deffnx {} BFD_RELOC_BFIN_GOTOFFLO
ADI Blackfin FD-PIC relocations.
@end deffn
@deffn {} BFD_RELOC_BFIN_GOT
ADI Blackfin GOT relocation.
@end deffn
@ -1456,6 +1504,9 @@ DLX relocs
DLX relocs
@end deffn
@deffn {} BFD_RELOC_M32C_HI8
@deffnx {} BFD_RELOC_M32C_RL_JUMP
@deffnx {} BFD_RELOC_M32C_RL_1ADDR
@deffnx {} BFD_RELOC_M32C_RL_2ADDR
Renesas M16C/M32C Relocations.
@end deffn
@deffn {} BFD_RELOC_M32R_24
@ -1721,6 +1772,10 @@ of data memory address) into 8 bit immediate value of LDI insn.
This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
of program memory address) into 8 bit immediate value of LDI insn.
@end deffn
@deffn {} BFD_RELOC_AVR_MS8_LDI
This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
of 32 bit value) into 8 bit immediate value of LDI insn.
@end deffn
@deffn {} BFD_RELOC_AVR_LO8_LDI_NEG
This is a 16 bit reloc for the AVR that stores negated 8 bit value
(usually data memory address) into 8 bit immediate value of SUBI insn.
@ -1735,6 +1790,10 @@ This is a 16 bit reloc for the AVR that stores negated 8 bit value
(most high 8 bit of program memory address) into 8 bit immediate value
of LDI or SUBI insn.
@end deffn
@deffn {} BFD_RELOC_AVR_MS8_LDI_NEG
This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
of 32 bit value) into 8 bit immediate value of LDI insn.
@end deffn
@deffn {} BFD_RELOC_AVR_LO8_LDI_PM
This is a 16 bit reloc for the AVR that stores 8 bit value (usually
command address) into 8 bit immediate value of LDI insn.
@ -2220,25 +2279,34 @@ H8 elf Relocations.
@deffnx {} BFD_RELOC_XSTORMY16_FPTR16
Sony Xstormy16 Relocations.
@end deffn
@deffn {} BFD_RELOC_XC16X_PAG
@deffnx {} BFD_RELOC_XC16X_POF
@deffnx {} BFD_RELOC_XC16X_SEG
@deffnx {} BFD_RELOC_XC16X_SOF
Infineon Relocations.
@end deffn
@deffn {} BFD_RELOC_VAX_GLOB_DAT
@deffnx {} BFD_RELOC_VAX_JMP_SLOT
@deffnx {} BFD_RELOC_VAX_RELATIVE
Relocations used by VAX ELF.
@end deffn
@deffn {} BFD_RELOC_MS1_PC16
Morpho MS1 - 16 bit immediate relocation.
@deffn {} BFD_RELOC_MT_PC16
Morpho MT - 16 bit immediate relocation.
@end deffn
@deffn {} BFD_RELOC_MS1_HI16
Morpho MS1 - Hi 16 bits of an address.
@deffn {} BFD_RELOC_MT_HI16
Morpho MT - Hi 16 bits of an address.
@end deffn
@deffn {} BFD_RELOC_MS1_LO16
Morpho MS1 - Low 16 bits of an address.
@deffn {} BFD_RELOC_MT_LO16
Morpho MT - Low 16 bits of an address.
@end deffn
@deffn {} BFD_RELOC_MS1_GNU_VTINHERIT
Morpho MS1 - Used to tell the linker which vtable entries are used.
@deffn {} BFD_RELOC_MT_GNU_VTINHERIT
Morpho MT - Used to tell the linker which vtable entries are used.
@end deffn
@deffn {} BFD_RELOC_MS1_GNU_VTENTRY
Morpho MS1 - Used to tell the linker which vtable entries are used.
@deffn {} BFD_RELOC_MT_GNU_VTENTRY
Morpho MT - Used to tell the linker which vtable entries are used.
@end deffn
@deffn {} BFD_RELOC_MT_PCINSN8
Morpho MT - 8 bit immediate relocation.
@end deffn
@deffn {} BFD_RELOC_MSP430_10_PCREL
@deffnx {} BFD_RELOC_MSP430_16_PCREL
@ -2323,14 +2391,14 @@ Xtensa relocations for backward compatibility. These have all been
replaced by BFD_RELOC_XTENSA_SLOT0_OP.
@end deffn
@deffn {} BFD_RELOC_XTENSA_ASM_EXPAND
Xtensa relocation to mark that the assembler expanded the
Xtensa relocation to mark that the assembler expanded the
instructions from an original target. The expansion size is
encoded in the reloc size.
@end deffn
@deffn {} BFD_RELOC_XTENSA_ASM_SIMPLIFY
Xtensa relocation to mark that the linker should simplify
assembler-expanded instructions. This is commonly used
internally by the linker after analysis of a
Xtensa relocation to mark that the linker should simplify
assembler-expanded instructions. This is commonly used
internally by the linker after analysis of a
BFD_RELOC_XTENSA_ASM_EXPAND.
@end deffn
@deffn {} BFD_RELOC_Z80_DISP8

View File

@ -498,11 +498,6 @@ extern asection bfd_ind_section;
|| ((SEC) == bfd_com_section_ptr) \
|| ((SEC) == bfd_ind_section_ptr))
extern const struct bfd_symbol * const bfd_abs_symbol;
extern const struct bfd_symbol * const bfd_com_symbol;
extern const struct bfd_symbol * const bfd_und_symbol;
extern const struct bfd_symbol * const bfd_ind_symbol;
/* Macros to handle insertion and deletion of a bfd's sections. These
only handle the list pointers, ie. do not adjust section_count,
target_index etc. */
@ -593,7 +588,7 @@ extern const struct bfd_symbol * const bfd_ind_symbol;
#define bfd_section_removed_from_list(ABFD, S) \
((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
/* name, id, index, next, prev, flags, user_set_vma, */ \
@{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
\
@ -624,11 +619,8 @@ extern const struct bfd_symbol * const bfd_ind_symbol;
/* target_index, used_by_bfd, constructor_chain, owner, */ \
0, NULL, NULL, NULL, \
\
/* symbol, */ \
(struct bfd_symbol *) SYM, \
\
/* symbol_ptr_ptr, */ \
(struct bfd_symbol **) SYM_PTR, \
/* symbol, symbol_ptr_ptr, */ \
(struct bfd_symbol *) SYM, &SEC.symbol, \
\
/* map_head, map_tail */ \
@{ NULL @}, @{ NULL @} \

View File

@ -405,7 +405,6 @@ BFD_JUMP_TABLE macros.
NAME##_bfd_link_split_section, \
NAME##_bfd_gc_sections, \
NAME##_bfd_merge_sections, \
_bfd_generic_match_sections_by_type, \
NAME##_bfd_is_group_section, \
NAME##_bfd_discard_group, \
NAME##_section_already_linked \
@ -445,12 +444,6 @@ BFD_JUMP_TABLE macros.
/* Attempt to merge SEC_MERGE sections. */
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
#define bfd_match_sections_by_type(abfd, asec, bbfd, bsec) \
BFD_SEND (abfd, _bfd_match_sections_by_type, (abfd, asec, bbfd, bsec))
/* Return TRUE if 2 section types are compatible. */
bfd_boolean (*_bfd_match_sections_by_type)
(bfd *, const asection *, bfd *, const asection *);
/* Is this section a member of a group? */
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);

View File

@ -1,6 +1,6 @@
/* DWARF 2 support.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
@ -74,6 +74,12 @@ struct dwarf_block
bfd_byte *data;
};
struct loadable_section
{
asection *section;
bfd_vma adj_vma;
};
struct dwarf2_debug
{
/* A list of all previously read comp_units. */
@ -124,6 +130,12 @@ struct dwarf2_debug
calling chain for subsequent calls to bfd_find_inliner_info to
use. */
struct funcinfo *inliner_chain;
/* Number of loadable sections. */
unsigned int loadable_section_count;
/* Array of loadable sections. */
struct loadable_section *loadable_sections;
};
struct arange
@ -481,21 +493,21 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
amt *= sizeof (struct attr_abbrev);
tmp = bfd_realloc (cur_abbrev->attrs, amt);
if (tmp == NULL)
{
size_t i;
{
size_t i;
for (i = 0; i < ABBREV_HASH_SIZE; i++)
{
struct abbrev_info *abbrev = abbrevs[i];
for (i = 0; i < ABBREV_HASH_SIZE; i++)
{
struct abbrev_info *abbrev = abbrevs[i];
while (abbrev)
{
free (abbrev->attrs);
abbrev = abbrev->next;
}
}
return NULL;
}
while (abbrev)
{
free (abbrev->attrs);
abbrev = abbrev->next;
}
}
return NULL;
}
cur_abbrev->attrs = tmp;
}
@ -521,7 +533,7 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
for the next compile unit) or if the end of the abbreviation
table is reached. */
if ((unsigned int) (abbrev_ptr - stash->dwarf_abbrev_buffer)
>= stash->dwarf_abbrev_size)
>= stash->dwarf_abbrev_size)
break;
abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
@ -744,6 +756,17 @@ struct varinfo
unsigned int stack: 1;
};
/* Return TRUE if NEW_LINE should sort after LINE. */
static inline bfd_boolean
new_line_sorts_after (struct line_info *new_line, struct line_info *line)
{
return (new_line->address > line->address
|| (new_line->address == line->address
&& new_line->end_sequence < line->end_sequence));
}
/* Adds a new entry to the line_info list in the line_info_table, ensuring
that the list is sorted. Note that the line_info list is sorted from
highest to lowest VMA (with possible duplicates); that is,
@ -760,6 +783,21 @@ add_line_info (struct line_info_table *table,
bfd_size_type amt = sizeof (struct line_info);
struct line_info* info = bfd_alloc (table->abfd, amt);
/* Set member data of 'info'. */
info->address = address;
info->line = line;
info->column = column;
info->end_sequence = end_sequence;
if (filename && filename[0])
{
info->filename = bfd_alloc (table->abfd, strlen (filename) + 1);
if (info->filename)
strcpy (info->filename, filename);
}
else
info->filename = NULL;
/* Find the correct location for 'info'. Normally we will receive
new line_info data 1) in order and 2) with increasing VMAs.
However some compilers break the rules (cf. decode_line_info) and
@ -775,70 +813,45 @@ add_line_info (struct line_info_table *table,
Note: we may receive duplicate entries from 'decode_line_info'. */
while (1)
if (!table->last_line
|| address >= table->last_line->address)
{
/* Normal case: add 'info' to the beginning of the list */
info->prev_line = table->last_line;
table->last_line = info;
/* lcl_head: initialize to head a *possible* sequence at the end. */
if (!table->lcl_head)
table->lcl_head = info;
break;
}
else if (!table->lcl_head->prev_line
&& table->lcl_head->address > address)
{
/* Abnormal but easy: lcl_head is 1) at the *end* of the line
list and 2) the head of 'info'. */
info->prev_line = NULL;
table->lcl_head->prev_line = info;
break;
}
else if (table->lcl_head->prev_line
&& table->lcl_head->address > address
&& address >= table->lcl_head->prev_line->address)
{
/* Abnormal but easy: lcl_head is 1) in the *middle* of the line
list and 2) the head of 'info'. */
info->prev_line = table->lcl_head->prev_line;
table->lcl_head->prev_line = info;
break;
}
else
{
/* Abnormal and hard: Neither 'last_line' nor 'lcl_head' are valid
heads for 'info'. Reset 'lcl_head' and repeat. */
struct line_info* li2 = table->last_line; /* always non-NULL */
struct line_info* li1 = li2->prev_line;
while (li1)
{
if (li2->address > address && address >= li1->address)
break;
li2 = li1; /* always non-NULL */
li1 = li1->prev_line;
}
table->lcl_head = li2;
}
/* Set member data of 'info'. */
info->address = address;
info->line = line;
info->column = column;
info->end_sequence = end_sequence;
if (filename && filename[0])
if (!table->last_line
|| new_line_sorts_after (info, table->last_line))
{
info->filename = bfd_alloc (table->abfd, strlen (filename) + 1);
if (info->filename)
strcpy (info->filename, filename);
/* Normal case: add 'info' to the beginning of the list */
info->prev_line = table->last_line;
table->last_line = info;
/* lcl_head: initialize to head a *possible* sequence at the end. */
if (!table->lcl_head)
table->lcl_head = info;
}
else if (!new_line_sorts_after (info, table->lcl_head)
&& (!table->lcl_head->prev_line
|| new_line_sorts_after (info, table->lcl_head->prev_line)))
{
/* Abnormal but easy: lcl_head is the head of 'info'. */
info->prev_line = table->lcl_head->prev_line;
table->lcl_head->prev_line = info;
}
else
info->filename = NULL;
{
/* Abnormal and hard: Neither 'last_line' nor 'lcl_head' are valid
heads for 'info'. Reset 'lcl_head'. */
struct line_info* li2 = table->last_line; /* always non-NULL */
struct line_info* li1 = li2->prev_line;
while (li1)
{
if (!new_line_sorts_after (info, li2)
&& new_line_sorts_after (info, li1))
break;
li2 = li1; /* always non-NULL */
li1 = li1->prev_line;
}
table->lcl_head = li2;
info->prev_line = table->lcl_head->prev_line;
table->lcl_head->prev_line = info;
}
}
/* Extract a fully qualified filename from a line info table.
@ -852,8 +865,10 @@ concat_filename (struct line_info_table *table, unsigned int file)
if (file - 1 >= table->num_files)
{
(*_bfd_error_handler)
(_("Dwarf Error: mangled line number section (bad file number)."));
/* FILE == 0 means unknown. */
if (file)
(*_bfd_error_handler)
(_("Dwarf Error: mangled line number section (bad file number)."));
return strdup ("<unknown>");
}
@ -1102,7 +1117,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
unsigned int line = 1;
unsigned int column = 0;
int is_stmt = lh.default_is_stmt;
int basic_block = 0;
int end_sequence = 0;
/* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some
compilers generate address sequences that are wildly out of
@ -1127,7 +1141,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
line += lh.line_base + (adj_opcode % lh.line_range);
/* Append row to matrix using current values. */
add_line_info (table, address, filename, line, column, 0);
basic_block = 1;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@ -1168,12 +1181,12 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
amt *= sizeof (struct fileinfo);
tmp = bfd_realloc (table->files, amt);
if (tmp == NULL)
{
{
free (table->files);
free (table->dirs);
free (filename);
return NULL;
}
}
table->files = tmp;
}
table->files[table->num_files].name = cur_file;
@ -1199,7 +1212,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
break;
case DW_LNS_copy:
add_line_info (table, address, filename, line, column, 0);
basic_block = 0;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@ -1235,7 +1247,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
is_stmt = (!is_stmt);
break;
case DW_LNS_set_basic_block:
basic_block = 1;
break;
case DW_LNS_const_add_pc:
address += lh.minimum_instruction_length
@ -1467,6 +1478,7 @@ lookup_symbol_in_function_table (struct comp_unit *unit,
if ((!each_func->sec || each_func->sec == sec)
&& addr >= arange->low
&& addr < arange->high
&& each_func->name
&& strcmp (name, each_func->name) == 0
&& (!best_fit
|| ((arange->high - arange->low)
@ -1584,7 +1596,7 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs
return;
}
ranges_ptr = unit->stash->dwarf_ranges_buffer + offset;
for (;;)
{
bfd_vma low_pc;
@ -1609,7 +1621,7 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs
if (low_pc == -1UL && high_pc != -1UL)
base_address = high_pc;
else
arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc);
arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc);
}
}
@ -1801,7 +1813,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
attr.u.blk->data + 1);
}
break;
default:
break;
}
@ -2005,7 +2017,11 @@ parse_comp_unit (bfd *abfd,
return unit;
}
/* Return TRUE if UNIT contains the address given by ADDR. */
/* Return TRUE if UNIT may contain the address given by ADDR. When
there are functions written entirely with inline asm statements, the
range info in the compilation unit header may not be correct. We
need to consult the line info table to see if a compilation unit
really contains the given address. */
static bfd_boolean
comp_unit_contains_address (struct comp_unit *unit, bfd_vma addr)
@ -2174,6 +2190,97 @@ find_debug_info (bfd *abfd, asection *after_sec)
return NULL;
}
/* Unset vmas for loadable sections in STASH. */
static void
unset_sections (struct dwarf2_debug *stash)
{
unsigned int i;
struct loadable_section *p;
i = stash->loadable_section_count;
p = stash->loadable_sections;
for (; i > 0; i--, p++)
p->section->vma = 0;
}
/* Set unique vmas for loadable sections in ABFD and save vmas in
STASH for unset_sections. */
static bfd_boolean
place_sections (bfd *abfd, struct dwarf2_debug *stash)
{
struct loadable_section *p;
unsigned int i;
if (stash->loadable_section_count != 0)
{
i = stash->loadable_section_count;
p = stash->loadable_sections;
for (; i > 0; i--, p++)
p->section->vma = p->adj_vma;
}
else
{
asection *sect;
bfd_vma last_vma = 0;
bfd_size_type amt;
struct loadable_section *p;
i = 0;
for (sect = abfd->sections; sect != NULL; sect = sect->next)
{
bfd_size_type sz;
if (sect->vma != 0 || (sect->flags & SEC_LOAD) == 0)
continue;
sz = sect->rawsize ? sect->rawsize : sect->size;
if (sz == 0)
continue;
i++;
}
amt = i * sizeof (struct loadable_section);
p = (struct loadable_section *) bfd_zalloc (abfd, amt);
if (! p)
return FALSE;
stash->loadable_sections = p;
stash->loadable_section_count = i;
for (sect = abfd->sections; sect != NULL; sect = sect->next)
{
bfd_size_type sz;
if (sect->vma != 0 || (sect->flags & SEC_LOAD) == 0)
continue;
sz = sect->rawsize ? sect->rawsize : sect->size;
if (sz == 0)
continue;
p->section = sect;
if (last_vma != 0)
{
/* Align the new address to the current section
alignment. */
last_vma = ((last_vma
+ ~((bfd_vma) -1 << sect->alignment_power))
& ((bfd_vma) -1 << sect->alignment_power));
sect->vma = last_vma;
}
p->adj_vma = sect->vma;
last_vma += sect->vma + sz;
p++;
}
}
return TRUE;
}
/* The DWARF2 version of find_nearest_line. Return TRUE if the line
is found without error. ADDR_SIZE is the number of bytes in the
initial .debug_info length field and in the abbreviation offset.
@ -2206,12 +2313,32 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
struct comp_unit* each;
bfd_vma found = FALSE;
stash = *pinfo;
if (! stash)
{
bfd_size_type amt = sizeof (struct dwarf2_debug);
stash = bfd_zalloc (abfd, amt);
if (! stash)
return FALSE;
}
/* In a relocatable file, 2 functions may have the same address.
We change the section vma so that they won't overlap. */
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
{
if (! place_sections (abfd, stash))
return FALSE;
}
addr = offset;
if (section->output_section)
addr += section->output_section->lma + section->output_offset;
addr += section->output_section->vma + section->output_offset;
else
addr += section->lma;
addr += section->vma;
*filename_ptr = NULL;
*functionname_ptr = NULL;
*linenumber_ptr = 0;
@ -2223,15 +2350,10 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
addr_size = 4;
BFD_ASSERT (addr_size == 4 || addr_size == 8);
if (! stash)
if (! *pinfo)
{
bfd_size_type total_size;
asection *msec;
bfd_size_type amt = sizeof (struct dwarf2_debug);
stash = bfd_zalloc (abfd, amt);
if (! stash)
return FALSE;
*pinfo = stash;
@ -2240,7 +2362,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
/* No dwarf2 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */
return FALSE;
goto done;
/* There can be more than one DWARF2 info section in a BFD these days.
Read them all in and produce one large stash. We do this in two
@ -2252,7 +2374,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
stash->info_ptr = bfd_alloc (abfd, total_size);
if (stash->info_ptr == NULL)
return FALSE;
goto done;
stash->info_ptr_end = stash->info_ptr;
@ -2286,22 +2408,25 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
/* A null info_ptr indicates that there is no dwarf2 info
(or that an error occured while setting up the stash). */
if (! stash->info_ptr)
return FALSE;
goto done;
stash->inliner_chain = NULL;
/* Check the previously read comp. units first. */
for (each = stash->all_comp_units; each; each = each->next_unit)
if (comp_unit_contains_address (each, addr))
return comp_unit_find_nearest_line (each, addr, filename_ptr,
functionname_ptr, linenumber_ptr,
stash);
if (comp_unit_contains_address (each, addr)
&& comp_unit_find_nearest_line (each, addr, filename_ptr,
functionname_ptr,
linenumber_ptr, stash))
{
found = TRUE;
goto done;
}
/* Read each remaining comp. units checking each as they are read. */
while (stash->info_ptr < stash->info_ptr_end)
{
bfd_vma length;
bfd_boolean found;
unsigned int offset_size = addr_size;
bfd_byte *info_ptr_unit = stash->info_ptr;
@ -2357,30 +2482,26 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
unit->high == 0), we need to consult the line info
table to see if a compilation unit contains the given
address. */
if (each->arange.high > 0)
if ((each->arange.high == 0
|| comp_unit_contains_address (each, addr))
&& comp_unit_find_nearest_line (each, addr,
filename_ptr,
functionname_ptr,
linenumber_ptr,
stash))
{
if (comp_unit_contains_address (each, addr))
return comp_unit_find_nearest_line (each, addr,
filename_ptr,
functionname_ptr,
linenumber_ptr,
stash);
}
else
{
found = comp_unit_find_nearest_line (each, addr,
filename_ptr,
functionname_ptr,
linenumber_ptr,
stash);
if (found)
return TRUE;
found = TRUE;
goto done;
}
}
}
}
return FALSE;
done:
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
unset_sections (stash);
return found;
}
/* The DWARF2 version of find_line. Return TRUE if the line is found
@ -2412,30 +2533,43 @@ _bfd_dwarf2_find_line (bfd *abfd,
asection *section;
bfd_boolean found;
bfd_boolean found = FALSE;
section = bfd_get_section (symbol);
addr = symbol->value;
if (section->output_section)
addr += section->output_section->lma + section->output_offset;
else
addr += section->lma;
*filename_ptr = NULL;
stash = *pinfo;
*filename_ptr = NULL;
*linenumber_ptr = 0;
if (! stash)
{
bfd_size_type total_size;
asection *msec;
bfd_size_type amt = sizeof (struct dwarf2_debug);
stash = bfd_zalloc (abfd, amt);
if (! stash)
return FALSE;
}
/* In a relocatable file, 2 functions may have the same address.
We change the section vma so that they won't overlap. */
if (!stash && (abfd->flags & (EXEC_P | DYNAMIC)) == 0)
{
if (! place_sections (abfd, stash))
return FALSE;
}
addr = symbol->value;
if (section->output_section)
addr += section->output_section->vma + section->output_offset;
else
addr += section->vma;
*filename_ptr = NULL;
*filename_ptr = NULL;
*linenumber_ptr = 0;
if (! *pinfo)
{
bfd_size_type total_size;
asection *msec;
*pinfo = stash;
@ -2444,7 +2578,7 @@ _bfd_dwarf2_find_line (bfd *abfd,
/* No dwarf2 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */
return FALSE;
goto done;
/* There can be more than one DWARF2 info section in a BFD these days.
Read them all in and produce one large stash. We do this in two
@ -2456,7 +2590,7 @@ _bfd_dwarf2_find_line (bfd *abfd,
stash->info_ptr = bfd_alloc (abfd, total_size);
if (stash->info_ptr == NULL)
return FALSE;
goto done;
stash->info_ptr_end = stash->info_ptr;
@ -2490,7 +2624,7 @@ _bfd_dwarf2_find_line (bfd *abfd,
/* A null info_ptr indicates that there is no dwarf2 info
(or that an error occured while setting up the stash). */
if (! stash->info_ptr)
return FALSE;
goto done;
stash->inliner_chain = NULL;
@ -2502,7 +2636,7 @@ _bfd_dwarf2_find_line (bfd *abfd,
found = comp_unit_find_line (each, symbol, addr, filename_ptr,
linenumber_ptr, stash);
if (found)
return found;
goto done;
}
/* The DWARF2 spec says that the initial length field, and the
@ -2579,12 +2713,16 @@ _bfd_dwarf2_find_line (bfd *abfd,
linenumber_ptr,
stash));
if (found)
return TRUE;
goto done;
}
}
}
return FALSE;
done:
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
unset_sections (stash);
return found;
}
bfd_boolean
@ -2633,21 +2771,21 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd)
size_t i;
for (i = 0; i < ABBREV_HASH_SIZE; i++)
{
struct abbrev_info *abbrev = abbrevs[i];
{
struct abbrev_info *abbrev = abbrevs[i];
while (abbrev)
{
free (abbrev->attrs);
abbrev = abbrev->next;
}
}
while (abbrev)
{
free (abbrev->attrs);
abbrev = abbrev->next;
}
}
if (each->line_table)
{
free (each->line_table->dirs);
free (each->line_table->files);
}
{
free (each->line_table->dirs);
free (each->line_table->files);
}
}
free (stash->dwarf_abbrev_buffer);

View File

@ -1,6 +1,6 @@
/* Generic ECOFF (Extended-COFF) routines.
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@ -140,8 +140,7 @@ _bfd_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr)
/* Initialize a new section. */
bfd_boolean
_bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED,
asection *section)
_bfd_ecoff_new_section_hook (bfd *abfd, asection *section)
{
unsigned int i;
static struct
@ -181,7 +180,7 @@ _bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED,
uncertain about .init on some systems and I don't know how shared
libraries work. */
return TRUE;
return _bfd_generic_new_section_hook (abfd, section);
}
/* Determine the machine architecture and type. This is called from
@ -3285,8 +3284,9 @@ _bfd_ecoff_bfd_link_hash_table_create (bfd *abfd)
ret = bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_link_hash_table_init (&ret->root, abfd,
ecoff_link_hash_newfunc))
if (!_bfd_link_hash_table_init (&ret->root, abfd,
ecoff_link_hash_newfunc,
sizeof (struct ecoff_link_hash_entry)))
{
free (ret);
return NULL;
@ -4002,11 +4002,10 @@ ecoff_indirect_link_order (bfd *output_bfd,
BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0);
if (link_order->size == 0)
return TRUE;
input_section = link_order->u.indirect.section;
input_bfd = input_section->owner;
if (input_section->size == 0)
return TRUE;
BFD_ASSERT (input_section->output_section == output_section);
BFD_ASSERT (input_section->output_offset == link_order->offset);

View File

@ -1,6 +1,6 @@
/* Routines to link ECOFF debugging information.
Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -501,8 +501,8 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
ainfo = (struct accumulate *) bfd_malloc (amt);
if (!ainfo)
return NULL;
if (! bfd_hash_table_init_n (&ainfo->fdr_hash.table, string_hash_newfunc,
1021))
if (!bfd_hash_table_init_n (&ainfo->fdr_hash.table, string_hash_newfunc,
sizeof (struct string_hash_entry), 1021))
return NULL;
ainfo->line = NULL;
@ -528,7 +528,8 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
if (! info->relocatable)
{
if (! bfd_hash_table_init (&ainfo->str_hash.table, string_hash_newfunc))
if (!bfd_hash_table_init (&ainfo->str_hash.table, string_hash_newfunc,
sizeof (struct string_hash_entry)))
return NULL;
/* The first entry in the string table is the empty string. */
@ -781,7 +782,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
fdr_ptr += fdr_add, i++)
{
FDR fdr;
bfd_vma fdr_adr;
bfd_byte *sym_out;
bfd_byte *lraw_src;
bfd_byte *lraw_end;
@ -798,8 +798,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
else
(*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr);
fdr_adr = fdr.adr;
/* FIXME: It is conceivable that this FDR points to the .init or
.fini section, in which case this will not do the right
thing. */

View File

@ -1,6 +1,6 @@
/* BFD back-end data structures for ELF files.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -378,6 +378,9 @@ struct elf_link_hash_table
/* The _GLOBAL_OFFSET_TABLE_ symbol. */
struct elf_link_hash_entry *hgot;
/* The _PROCEDURE_LINKAGE_TABLE_ symbol. */
struct elf_link_hash_entry *hplt;
/* A pointer to information used to merge SEC_MERGE sections. */
void *merge_info;
@ -830,6 +833,11 @@ struct elf_backend_data
bfd_boolean (*elf_backend_modify_segment_map)
(bfd *, struct bfd_link_info *);
/* This function is called during section garbage collection to
mark sections that define global symbols. */
bfd_boolean (*gc_mark_dynamic_ref)
(struct elf_link_hash_entry *h, void *inf);
/* This function is called during section gc to discover the section a
particular relocation refers to. */
asection * (*gc_mark_hook)
@ -878,11 +886,21 @@ struct elf_backend_data
void (*elf_backend_hide_symbol)
(struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
/* A function to do additional symbol fixup, called by
_bfd_elf_fix_symbol_flags. */
bfd_boolean (*elf_backend_fixup_symbol)
(struct bfd_link_info *, struct elf_link_hash_entry *);
/* Merge the backend specific symbol attribute. */
void (*elf_backend_merge_symbol_attribute)
(struct elf_link_hash_entry *, const Elf_Internal_Sym *, bfd_boolean,
bfd_boolean);
/* Decide whether an undefined symbol is special and can be ignored.
This is the case for OPTIONAL symbols on IRIX. */
bfd_boolean (*elf_backend_ignore_undef_symbol)
(struct elf_link_hash_entry *);
/* Emit relocations. Overrides default routine for emitting relocs,
except during a relocatable link, or if all relocs are being emitted. */
bfd_boolean (*elf_backend_emit_relocs)
@ -1466,18 +1484,19 @@ extern void _bfd_elf_link_hash_copy_indirect
struct elf_link_hash_entry *);
extern void _bfd_elf_link_hash_hide_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
extern bfd_boolean _bfd_elf_link_hash_fixup_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
extern bfd_boolean _bfd_elf_link_hash_table_init
(struct elf_link_hash_table *, bfd *,
struct bfd_hash_entry *(*)
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *),
unsigned int);
extern bfd_boolean _bfd_elf_slurp_version_tables
(bfd *, bfd_boolean);
extern bfd_boolean _bfd_elf_merge_sections
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_match_sections_by_type
(bfd *, const asection *, bfd *, const asection *);
#define _bfd_generic_match_sections_by_type \
_bfd_elf_match_sections_by_type
extern bfd_boolean bfd_elf_is_group_section
(bfd *, const struct bfd_section *);
extern void _bfd_elf_section_already_linked
@ -1805,6 +1824,9 @@ extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
extern bfd_boolean bfd_elf_final_link
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_gc_mark_dynamic_ref_symbol
(struct elf_link_hash_entry *h, void *inf);
extern bfd_boolean bfd_elf_gc_sections
(bfd *, struct bfd_link_info *);

View File

@ -1,5 +1,5 @@
/* .eh_frame section optimization.
Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -390,8 +390,7 @@ _bfd_elf_discard_section_eh_frame
return FALSE;
}
if ((sec->output_section != NULL
&& bfd_is_abs_section (sec->output_section)))
if (bfd_is_abs_section (sec->output_section))
{
/* At least one of the sections is being discarded from the
link, so we should just ignore them. */
@ -613,6 +612,8 @@ _bfd_elf_discard_section_eh_frame
ENSURE_NO_RELOCS (buf);
REQUIRE (get_DW_EH_PE_width (cie.fde_encoding, ptr_size));
break;
case 'S':
break;
case 'P':
{
int per_width;
@ -1178,6 +1179,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
}
buf++;
break;
case 'S':
break;
default:
BFD_FAIL ();
}

View File

@ -1,6 +1,6 @@
/* Matsushita 10300 specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -582,10 +582,14 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
if (bed->want_plt_sym
&& !_bfd_elf_define_linkage_sym (abfd, info, s,
"_PROCEDURE_LINKAGE_TABLE_"))
return FALSE;
if (bed->want_plt_sym)
{
h = _bfd_elf_define_linkage_sym (abfd, info, s,
"_PROCEDURE_LINKAGE_TABLE_");
elf_hash_table (info)->hplt = h;
if (h == NULL)
return FALSE;
}
s = bfd_make_section_with_flags (abfd, ".got", flags);
if (s == NULL
@ -3691,8 +3695,9 @@ elf32_mn10300_link_hash_table_create (abfd)
if (ret == (struct elf32_mn10300_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf32_mn10300_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
elf32_mn10300_link_hash_newfunc,
sizeof (struct elf32_mn10300_link_hash_entry)))
{
free (ret);
return NULL;
@ -3708,8 +3713,9 @@ elf32_mn10300_link_hash_table_create (abfd)
return NULL;
}
if (! _bfd_elf_link_hash_table_init (&ret->static_hash_table->root, abfd,
elf32_mn10300_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->static_hash_table->root, abfd,
elf32_mn10300_link_hash_newfunc,
sizeof (struct elf32_mn10300_link_hash_entry)))
{
free (ret->static_hash_table);
free (ret);
@ -4498,7 +4504,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot)
sym->st_shndx = SHN_ABS;
return TRUE;

View File

@ -1,5 +1,5 @@
/* ELF strtab with GC and suffix merging support.
Copyright 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Copyright 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -99,7 +99,8 @@ _bfd_elf_strtab_init (void)
if (table == NULL)
return NULL;
if (! bfd_hash_table_init (&table->table, elf_strtab_hash_newfunc))
if (!bfd_hash_table_init (&table->table, elf_strtab_hash_newfunc,
sizeof (struct elf_strtab_hash_entry)))
{
free (table);
return NULL;

View File

@ -55,12 +55,72 @@ elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
return TRUE;
}
/* Perform VxWorks-specific handling of the create_dynamic_sections hook.
When creating an executable, set *SRELPLT2_OUT to the .rel(a).plt.unloaded
section. */
bfd_boolean
elf_vxworks_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info,
asection **srelplt2_out)
{
struct elf_link_hash_table *htab;
const struct elf_backend_data *bed;
asection *s;
htab = elf_hash_table (info);
bed = get_elf_backend_data (dynobj);
if (!info->shared)
{
s = bfd_make_section_with_flags (dynobj,
bed->default_use_rela_p
? ".rela.plt.unloaded"
: ".rel.plt.unloaded",
SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_READONLY | SEC_LINKER_CREATED);
if (s == NULL
|| !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
return FALSE;
*srelplt2_out = s;
}
/* Mark the GOT and PLT symbols as having relocations; they might
not, but we won't know for sure until we build the GOT in
finish_dynamic_symbol. Also make sure that the GOT symbol
is entered into the dynamic symbol table; the loader uses it
to initialize __GOTT_BASE__[__GOTT_INDEX__]. */
if (htab->hgot)
{
htab->hgot->indx = -2;
htab->hgot->other &= ~ELF_ST_VISIBILITY (-1);
htab->hgot->forced_local = 0;
if (!bfd_elf_link_record_dynamic_symbol (info, htab->hgot))
return FALSE;
}
if (htab->hplt)
{
htab->hplt->indx = -2;
htab->hplt->type = STT_FUNC;
}
return TRUE;
}
/* Tweak magic VxWorks symbols as they are written to the output file. */
bfd_boolean
elf_vxworks_link_output_symbol_hook (const char *name,
Elf_Internal_Sym *sym)
elf_vxworks_link_output_symbol_hook (struct bfd_link_info *info
ATTRIBUTE_UNUSED,
const char *name,
Elf_Internal_Sym *sym,
asection *input_sec ATTRIBUTE_UNUSED,
struct elf_link_hash_entry *h
ATTRIBUTE_UNUSED)
{
/* Ignore the first dummy symbol. */
if (!name)
return TRUE;
/* Reverse the effects of the hack in elf_vxworks_add_symbol_hook. */
if (strcmp (name, "__GOTT_INDEX__") == 0
|| strcmp (name, "__GOTT_BASE__") == 0)

View File

@ -25,8 +25,11 @@ bfd_boolean elf_vxworks_add_symbol_hook
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
flagword *, asection **, bfd_vma *);
bfd_boolean elf_vxworks_link_output_symbol_hook
(const char *, Elf_Internal_Sym *);
(struct bfd_link_info *, const char *name, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *);
bfd_boolean elf_vxworks_emit_relocs
(bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
struct elf_link_hash_entry **);
void elf_vxworks_final_write_processing (bfd *, bfd_boolean);
bfd_boolean elf_vxworks_create_dynamic_sections
(bfd *, struct bfd_link_info *, asection **);

View File

@ -1,7 +1,7 @@
/* ELF executable support for BFD.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -654,8 +654,23 @@ _bfd_elf_setup_sections (bfd *abfd)
}
else
{
asection *link;
this_hdr = elf_elfsections (abfd)[elfsec];
elf_linked_to_section (s) = this_hdr->bfd_section;
/* PR 1991, 2008:
Some strip/objcopy may leave an incorrect value in
sh_link. We don't want to proceed. */
link = this_hdr->bfd_section;
if (link == NULL)
{
(*_bfd_error_handler)
(_("%B: sh_link [%d] in section `%A' is incorrect"),
s->owner, s, elfsec);
result = FALSE;
}
elf_linked_to_section (s) = link;
}
}
}
@ -1053,6 +1068,28 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
return TRUE;
}
static const char *
get_segment_type (unsigned int p_type)
{
const char *pt;
switch (p_type)
{
case PT_NULL: pt = "NULL"; break;
case PT_LOAD: pt = "LOAD"; break;
case PT_DYNAMIC: pt = "DYNAMIC"; break;
case PT_INTERP: pt = "INTERP"; break;
case PT_NOTE: pt = "NOTE"; break;
case PT_SHLIB: pt = "SHLIB"; break;
case PT_PHDR: pt = "PHDR"; break;
case PT_TLS: pt = "TLS"; break;
case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
case PT_GNU_STACK: pt = "STACK"; break;
case PT_GNU_RELRO: pt = "RELRO"; break;
default: pt = NULL; break;
}
return pt;
}
/* Print out the program headers. */
bfd_boolean
@ -1072,23 +1109,13 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
c = elf_elfheader (abfd)->e_phnum;
for (i = 0; i < c; i++, p++)
{
const char *pt;
const char *pt = get_segment_type (p->p_type);
char buf[20];
switch (p->p_type)
if (pt == NULL)
{
case PT_NULL: pt = "NULL"; break;
case PT_LOAD: pt = "LOAD"; break;
case PT_DYNAMIC: pt = "DYNAMIC"; break;
case PT_INTERP: pt = "INTERP"; break;
case PT_NOTE: pt = "NOTE"; break;
case PT_SHLIB: pt = "SHLIB"; break;
case PT_PHDR: pt = "PHDR"; break;
case PT_TLS: pt = "TLS"; break;
case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
case PT_GNU_STACK: pt = "STACK"; break;
case PT_GNU_RELRO: pt = "RELRO"; break;
default: sprintf (buf, "0x%lx", p->p_type); pt = buf; break;
sprintf (buf, "0x%lx", p->p_type);
pt = buf;
}
fprintf (f, "%8s off 0x", pt);
bfd_fprintf_vma (abfd, f, p->p_offset);
@ -1534,7 +1561,8 @@ _bfd_elf_link_hash_table_init
bfd *abfd,
struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *))
const char *),
unsigned int entsize)
{
bfd_boolean ret;
int can_refcount = get_elf_backend_data (abfd)->can_refcount;
@ -1561,7 +1589,7 @@ _bfd_elf_link_hash_table_init
table->loaded = NULL;
table->is_relocatable_executable = FALSE;
ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc);
ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc, entsize);
table->root.type = bfd_link_elf_hash_table;
return ret;
@ -1579,7 +1607,8 @@ _bfd_elf_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (ret, abfd, _bfd_elf_link_hash_newfunc))
if (! _bfd_elf_link_hash_table_init (ret, abfd, _bfd_elf_link_hash_newfunc,
sizeof (struct elf_link_hash_entry)))
{
free (ret);
return NULL;
@ -2030,15 +2059,16 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
represent such a section, so at least for now, we don't
try. We just present it as a normal section. We also
can't use it as a reloc section if it points to the null
section. */
if (hdr->sh_link != elf_onesymtab (abfd) || hdr->sh_info == SHN_UNDEF)
section, an invalid section, or another reloc section. */
if (hdr->sh_link != elf_onesymtab (abfd)
|| hdr->sh_info == SHN_UNDEF
|| (hdr->sh_info >= SHN_LORESERVE && hdr->sh_info <= SHN_HIRESERVE)
|| hdr->sh_info >= num_sec
|| elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL
|| elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA)
return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex);
/* Prevent endless recursion on broken objects. */
if (elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL
|| elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA)
return FALSE;
if (! bfd_section_from_shdr (abfd, hdr->sh_info))
return FALSE;
target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info);
@ -2083,13 +2113,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
elf_dynversym (abfd) = shindex;
elf_tdata (abfd)->dynversym_hdr = *hdr;
return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
break;
case SHT_GNU_verneed:
elf_dynverref (abfd) = shindex;
elf_tdata (abfd)->dynverref_hdr = *hdr;
return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
break;
case SHT_SHLIB:
return TRUE;
@ -2129,8 +2157,43 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
default:
/* Check for any processor-specific section types. */
return bed->elf_backend_section_from_shdr (abfd, hdr, name,
shindex);
if (bed->elf_backend_section_from_shdr (abfd, hdr, name, shindex))
return TRUE;
if (hdr->sh_type >= SHT_LOUSER && hdr->sh_type <= SHT_HIUSER)
{
if ((hdr->sh_flags & SHF_ALLOC) != 0)
/* FIXME: How to properly handle allocated section reserved
for applications? */
(*_bfd_error_handler)
(_("%B: don't know how to handle allocated, application "
"specific section `%s' [0x%8x]"),
abfd, name, hdr->sh_type);
else
/* Allow sections reserved for applications. */
return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex);
}
else if (hdr->sh_type >= SHT_LOPROC
&& hdr->sh_type <= SHT_HIPROC)
/* FIXME: We should handle this section. */
(*_bfd_error_handler)
(_("%B: don't know how to handle processor specific section "
"`%s' [0x%8x]"),
abfd, name, hdr->sh_type);
else if (hdr->sh_type >= SHT_LOOS && hdr->sh_type <= SHT_HIOS)
/* FIXME: We should handle this section. */
(*_bfd_error_handler)
(_("%B: don't know how to handle OS specific section "
"`%s' [0x%8x]"),
abfd, name, hdr->sh_type);
else
/* FIXME: We should handle this section. */
(*_bfd_error_handler)
(_("%B: don't know how to handle section `%s' [0x%8x]"),
abfd, name, hdr->sh_type);
return FALSE;
}
return TRUE;
@ -2422,10 +2485,13 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
bed = get_elf_backend_data (abfd);
sec->use_rela_p = bed->default_use_rela_p;
/* When we read a file, we don't need section type and flags unless
it is a linker created section. They will be overridden in
_bfd_elf_make_section_from_shdr anyway. */
if (abfd->direction != read_direction
/* When we read a file, we don't need to set ELF section type and
flags. They will be overridden in _bfd_elf_make_section_from_shdr
anyway. We will set ELF section type and flags for all linker
created sections. If user specifies BFD section flags, we will
set ELF section type and flags based on BFD section flags in
elf_fake_sections. */
if ((!sec->flags && abfd->direction != read_direction)
|| (sec->flags & SEC_LINKER_CREATED) != 0)
{
ssect = (*bed->get_sec_type_attr) (abfd, sec);
@ -2436,7 +2502,7 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
}
}
return TRUE;
return _bfd_generic_new_section_hook (abfd, sec);
}
/* Create a new bfd section from an ELF program header.
@ -2764,16 +2830,18 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
if ((asect->flags & SEC_THREAD_LOCAL) != 0)
{
this_hdr->sh_flags |= SHF_TLS;
if (asect->size == 0 && (asect->flags & SEC_HAS_CONTENTS) == 0)
if (asect->size == 0
&& (asect->flags & SEC_HAS_CONTENTS) == 0)
{
struct bfd_link_order *o;
struct bfd_link_order *o = asect->map_tail.link_order;
this_hdr->sh_size = 0;
for (o = asect->map_head.link_order; o != NULL; o = o->next)
if (this_hdr->sh_size < o->offset + o->size)
if (o != NULL)
{
this_hdr->sh_size = o->offset + o->size;
if (this_hdr->sh_size)
this_hdr->sh_type = SHT_NOBITS;
if (this_hdr->sh_size != 0)
this_hdr->sh_type = SHT_NOBITS;
}
}
}
@ -3051,10 +3119,10 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
s = elf_linked_to_section (sec);
if (s)
{
/* elf_linked_to_section points to the input section. */
if (link_info != NULL)
{
/* For linker, elf_linked_to_section points to the
input section. */
/* Check discarded linkonce section. */
if (elf_discarded_section (s))
{
asection *kept;
@ -3072,9 +3140,23 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
}
s = kept;
}
s = s->output_section;
BFD_ASSERT (s != NULL);
}
else
{
/* Handle objcopy. */
if (s->output_section == NULL)
{
(*_bfd_error_handler)
(_("%B: sh_link of section `%A' points to removed section `%A' of `%B'"),
abfd, d->this_hdr.bfd_section, s, s->owner);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
s = s->output_section;
}
d->this_hdr.sh_link = elf_section_data (s)->this_idx;
}
else
@ -3986,6 +4068,42 @@ vma_page_aligned_bias (bfd_vma vma, ufile_ptr off, bfd_vma maxpagesize)
return ((vma - off) % maxpagesize);
}
static void
print_segment_map (bfd *abfd)
{
struct elf_segment_map *m;
unsigned int i, j;
fprintf (stderr, _(" Section to Segment mapping:\n"));
fprintf (stderr, _(" Segment Sections...\n"));
for (i= 0, m = elf_tdata (abfd)->segment_map;
m != NULL;
i++, m = m->next)
{
const char *pt = get_segment_type (m->p_type);
char buf[32];
if (pt == NULL)
{
if (m->p_type >= PT_LOPROC && m->p_type <= PT_HIPROC)
sprintf (buf, "LOPROC+%7.7x",
(unsigned int) (m->p_type - PT_LOPROC));
else if (m->p_type >= PT_LOOS && m->p_type <= PT_HIOS)
sprintf (buf, "LOOS+%7.7x",
(unsigned int) (m->p_type - PT_LOOS));
else
snprintf (buf, sizeof (buf), "%8.8x",
(unsigned int) m->p_type);
pt = buf;
}
fprintf (stderr, " %2.2d: %14.14s: ", i, pt);
for (j = 0; j < m->count; j++)
fprintf (stderr, "%s ", m->sections [j]->name);
putc ('\n',stderr);
}
}
/* Assign file positions to the sections based on the mapping from
sections to segments. This function also sets up some fields in
the file header, and writes out the program headers. */
@ -4002,6 +4120,10 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
bfd_vma filehdr_vaddr, filehdr_paddr;
bfd_vma phdrs_vaddr, phdrs_paddr;
Elf_Internal_Phdr *p;
Elf_Internal_Shdr **i_shdrpp;
Elf_Internal_Shdr **hdrpp;
unsigned int i;
unsigned int num_sec;
if (elf_tdata (abfd)->segment_map == NULL)
{
@ -4019,7 +4141,6 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
m = m->next)
{
unsigned int new_count;
unsigned int i;
new_count = 0;
for (i = 0; i < m->count; i ++)
@ -4069,6 +4190,7 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
((*_bfd_error_handler)
(_("%B: Not enough room for program headers (allocated %u, need %u)"),
abfd, alloc, count));
print_segment_map (abfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@ -4092,7 +4214,6 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
m != NULL;
m = m->next, p++)
{
unsigned int i;
asection **secpp;
/* If elf_segment_map is not from map_sections_to_segments, the
@ -4396,14 +4517,9 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
&& sec->size == 0
&& (sec->flags & SEC_HAS_CONTENTS) == 0)
{
struct bfd_link_order *o;
bfd_vma tbss_size = 0;
for (o = sec->map_head.link_order; o != NULL; o = o->next)
if (tbss_size < o->offset + o->size)
tbss_size = o->offset + o->size;
p->p_memsz += tbss_size;
struct bfd_link_order *o = sec->map_tail.link_order;
if (o != NULL)
p->p_memsz += o->offset + o->size;
}
if (align > p->p_align
@ -4422,6 +4538,51 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
}
}
/* Assign file positions for the other sections. */
i_shdrpp = elf_elfsections (abfd);
num_sec = elf_numsections (abfd);
for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++)
{
struct elf_obj_tdata *tdata = elf_tdata (abfd);
Elf_Internal_Shdr *hdr;
hdr = *hdrpp;
if (hdr->bfd_section != NULL
&& hdr->bfd_section->filepos != 0)
hdr->sh_offset = hdr->bfd_section->filepos;
else if ((hdr->sh_flags & SHF_ALLOC) != 0)
{
((*_bfd_error_handler)
(_("%B: warning: allocated section `%s' not in segment"),
abfd,
(hdr->bfd_section == NULL
? "*unknown*"
: hdr->bfd_section->name)));
if ((abfd->flags & D_PAGED) != 0)
off += vma_page_aligned_bias (hdr->sh_addr, off,
bed->maxpagesize);
else
off += vma_page_aligned_bias (hdr->sh_addr, off,
hdr->sh_addralign);
off = _bfd_elf_assign_file_position_for_section (hdr, off,
FALSE);
}
else if (((hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA)
&& hdr->bfd_section == NULL)
|| hdr == i_shdrpp[tdata->symtab_section]
|| hdr == i_shdrpp[tdata->symtab_shndx_section]
|| hdr == i_shdrpp[tdata->strtab_section])
hdr->sh_offset = -1;
else
off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE);
if (i == SHN_LORESERVE - 1)
{
i += SHN_HIRESERVE + 1 - SHN_LORESERVE;
hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE;
}
}
/* Now that we have set the section file positions, we can set up
the file positions for the non PT_LOAD segments. */
for (m = elf_tdata (abfd)->segment_map, p = phdrs;
@ -4437,7 +4598,6 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
PT_LOAD segment, so it will not be processed above. */
if (p->p_type == PT_DYNAMIC && m->sections[0]->filepos == 0)
{
unsigned int i;
Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd);
i = 1;
@ -4640,16 +4800,16 @@ static bfd_boolean
assign_file_positions_except_relocs (bfd *abfd,
struct bfd_link_info *link_info)
{
struct elf_obj_tdata * const tdata = elf_tdata (abfd);
Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd);
Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd);
unsigned int num_sec = elf_numsections (abfd);
struct elf_obj_tdata *tdata = elf_tdata (abfd);
Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd);
file_ptr off;
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0
&& bfd_get_format (abfd) != bfd_core)
{
Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd);
unsigned int num_sec = elf_numsections (abfd);
Elf_Internal_Shdr **hdrpp;
unsigned int i;
@ -4684,57 +4844,12 @@ assign_file_positions_except_relocs (bfd *abfd,
}
else
{
unsigned int i;
Elf_Internal_Shdr **hdrpp;
/* Assign file positions for the loaded sections based on the
assignment of sections to segments. */
if (! assign_file_positions_for_segments (abfd, link_info))
return FALSE;
/* Assign file positions for the other sections. */
off = elf_tdata (abfd)->next_file_pos;
for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++)
{
Elf_Internal_Shdr *hdr;
hdr = *hdrpp;
if (hdr->bfd_section != NULL
&& hdr->bfd_section->filepos != 0)
hdr->sh_offset = hdr->bfd_section->filepos;
else if ((hdr->sh_flags & SHF_ALLOC) != 0)
{
((*_bfd_error_handler)
(_("%B: warning: allocated section `%s' not in segment"),
abfd,
(hdr->bfd_section == NULL
? "*unknown*"
: hdr->bfd_section->name)));
if ((abfd->flags & D_PAGED) != 0)
off += vma_page_aligned_bias (hdr->sh_addr, off,
bed->maxpagesize);
else
off += vma_page_aligned_bias (hdr->sh_addr, off,
hdr->sh_addralign);
off = _bfd_elf_assign_file_position_for_section (hdr, off,
FALSE);
}
else if (((hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA)
&& hdr->bfd_section == NULL)
|| hdr == i_shdrpp[tdata->symtab_section]
|| hdr == i_shdrpp[tdata->symtab_shndx_section]
|| hdr == i_shdrpp[tdata->strtab_section])
hdr->sh_offset = -1;
else
off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE);
if (i == SHN_LORESERVE - 1)
{
i += SHN_HIRESERVE + 1 - SHN_LORESERVE;
hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE;
}
}
off = tdata->next_file_pos;
}
/* Place the section headers. */
@ -4742,7 +4857,7 @@ assign_file_positions_except_relocs (bfd *abfd,
i_ehdrp->e_shoff = off;
off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
elf_tdata (abfd)->next_file_pos = off;
tdata->next_file_pos = off;
return TRUE;
}
@ -5018,10 +5133,10 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr)
return idx;
}
/* Copy private BFD data. This copies any program header information. */
/* Rewrite program header information. */
static bfd_boolean
copy_private_bfd_data (bfd *ibfd, bfd *obfd)
rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
{
Elf_Internal_Ehdr *iehdr;
struct elf_segment_map *map;
@ -5037,13 +5152,6 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
unsigned int phdr_adjust_num = 0;
const struct elf_backend_data *bed;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
if (elf_tdata (ibfd)->phdr == NULL)
return TRUE;
bed = get_elf_backend_data (ibfd);
iehdr = elf_elfheader (ibfd);
@ -5603,6 +5711,185 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
return TRUE;
}
/* Copy ELF program header information. */
static bfd_boolean
copy_elf_program_header (bfd *ibfd, bfd *obfd)
{
Elf_Internal_Ehdr *iehdr;
struct elf_segment_map *map;
struct elf_segment_map *map_first;
struct elf_segment_map **pointer_to_map;
Elf_Internal_Phdr *segment;
unsigned int i;
unsigned int num_segments;
bfd_boolean phdr_included = FALSE;
iehdr = elf_elfheader (ibfd);
map_first = NULL;
pointer_to_map = &map_first;
num_segments = elf_elfheader (ibfd)->e_phnum;
for (i = 0, segment = elf_tdata (ibfd)->phdr;
i < num_segments;
i++, segment++)
{
asection *section;
unsigned int section_count;
bfd_size_type amt;
Elf_Internal_Shdr *this_hdr;
/* FIXME: Do we need to copy PT_NULL segment? */
if (segment->p_type == PT_NULL)
continue;
/* Compute how many sections are in this segment. */
for (section = ibfd->sections, section_count = 0;
section != NULL;
section = section->next)
{
this_hdr = &(elf_section_data(section)->this_hdr);
if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment))
section_count++;
}
/* Allocate a segment map big enough to contain
all of the sections we have selected. */
amt = sizeof (struct elf_segment_map);
if (section_count != 0)
amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
map = bfd_alloc (obfd, amt);
if (map == NULL)
return FALSE;
/* Initialize the fields of the output segment map with the
input segment. */
map->next = NULL;
map->p_type = segment->p_type;
map->p_flags = segment->p_flags;
map->p_flags_valid = 1;
map->p_paddr = segment->p_paddr;
map->p_paddr_valid = 1;
/* Determine if this segment contains the ELF file header
and if it contains the program headers themselves. */
map->includes_filehdr = (segment->p_offset == 0
&& segment->p_filesz >= iehdr->e_ehsize);
map->includes_phdrs = 0;
if (! phdr_included || segment->p_type != PT_LOAD)
{
map->includes_phdrs =
(segment->p_offset <= (bfd_vma) iehdr->e_phoff
&& (segment->p_offset + segment->p_filesz
>= ((bfd_vma) iehdr->e_phoff
+ iehdr->e_phnum * iehdr->e_phentsize)));
if (segment->p_type == PT_LOAD && map->includes_phdrs)
phdr_included = TRUE;
}
if (section_count != 0)
{
unsigned int isec = 0;
for (section = ibfd->sections;
section != NULL;
section = section->next)
{
this_hdr = &(elf_section_data(section)->this_hdr);
if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment))
map->sections[isec++] = section->output_section;
}
}
map->count = section_count;
*pointer_to_map = map;
pointer_to_map = &map->next;
}
elf_tdata (obfd)->segment_map = map_first;
return TRUE;
}
/* Copy private BFD data. This copies or rewrites ELF program header
information. */
static bfd_boolean
copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
if (elf_tdata (ibfd)->phdr == NULL)
return TRUE;
if (ibfd->xvec == obfd->xvec)
{
/* Check if any sections in the input BFD covered by ELF program
header are changed. */
Elf_Internal_Phdr *segment;
asection *section, *osec;
unsigned int i, num_segments;
Elf_Internal_Shdr *this_hdr;
/* Initialize the segment mark field. */
for (section = obfd->sections; section != NULL;
section = section->next)
section->segment_mark = FALSE;
num_segments = elf_elfheader (ibfd)->e_phnum;
for (i = 0, segment = elf_tdata (ibfd)->phdr;
i < num_segments;
i++, segment++)
{
for (section = ibfd->sections;
section != NULL; section = section->next)
{
/* We mark the output section so that we know it comes
from the input BFD. */
osec = section->output_section;
if (osec)
osec->segment_mark = TRUE;
/* Check if this section is covered by the segment. */
this_hdr = &(elf_section_data(section)->this_hdr);
if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment))
{
/* FIXME: Check if its output section is changed or
removed. What else do we need to check? */
if (osec == NULL
|| section->flags != osec->flags
|| section->lma != osec->lma
|| section->vma != osec->vma
|| section->size != osec->size
|| section->rawsize != osec->rawsize
|| section->alignment_power != osec->alignment_power)
goto rewrite;
}
}
}
/* Check to see if any output section doesn't come from the
input BFD. */
for (section = obfd->sections; section != NULL;
section = section->next)
{
if (section->segment_mark == FALSE)
goto rewrite;
else
section->segment_mark = FALSE;
}
return copy_elf_program_header (ibfd, obfd);
}
rewrite:
return rewrite_elf_program_header (ibfd, obfd);
}
/* Initialize private output section information from input section. */
bfd_boolean
@ -5620,9 +5907,12 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
|| obfd->xvec->flavour != bfd_target_elf_flavour)
return TRUE;
/* FIXME: What if the output ELF section type has been set to
something different? */
if (elf_section_type (osec) == SHT_NULL)
/* Don't copy the output ELF section type from input if the
output BFD section flags has been set to something different.
elf_fake_sections will set ELF section type based on BFD
section flags. */
if (osec->flags == isec->flags
|| (osec->flags == 0 && elf_section_type (osec) == SHT_NULL))
elf_section_type (osec) = elf_section_type (isec);
/* Set things up for objcopy and relocatable link. The output
@ -6659,8 +6949,6 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
if (state == symbol_seen)
state = file_after_symbol_seen;
continue;
case STT_SECTION:
continue;
case STT_NOTYPE:
case STT_FUNC:
if (bfd_get_section (&q->symbol) == section
@ -6669,12 +6957,10 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
{
func = (asymbol *) q;
low_func = q->symbol.value;
if (file == NULL)
filename = NULL;
else if (ELF_ST_BIND (q->internal_elf_sym.st_info) != STB_LOCAL
&& state == file_after_symbol_seen)
filename = NULL;
else
filename = NULL;
if (file != NULL
&& (ELF_ST_BIND (q->internal_elf_sym.st_info) == STB_LOCAL
|| state != file_after_symbol_seen))
filename = bfd_asymbol_name (file);
}
break;
@ -6925,7 +7211,7 @@ _bfd_elf_close_and_cleanup (bfd *abfd)
{
if (bfd_get_format (abfd) == bfd_object)
{
if (elf_shstrtab (abfd) != NULL)
if (elf_tdata (abfd) != NULL && elf_shstrtab (abfd) != NULL)
_bfd_elf_strtab_free (elf_shstrtab (abfd));
_bfd_dwarf2_cleanup_debug_info (abfd);
}
@ -7866,8 +8152,8 @@ elfcore_write_pstatus (bfd *abfd,
char *buf,
int *bufsiz,
long pid,
int cursig,
const void *gregs)
int cursig ATTRIBUTE_UNUSED,
const void *gregs ATTRIBUTE_UNUSED)
{
pstatus_t pstat;
char *note_name = "CORE";
@ -8475,8 +8761,7 @@ done:
/* It is only used by x86-64 so far. */
asection _bfd_elf_large_com_section
= BFD_FAKE_SECTION (_bfd_elf_large_com_section,
SEC_IS_COMMON, NULL, NULL, "LARGE_COMMON",
0);
SEC_IS_COMMON, NULL, "LARGE_COMMON", 0);
/* Return TRUE if 2 section types are compatible. */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* CRIS-specific support for 32-bit ELF.
Copyright 2000, 2001, 2002, 2003, 2004, 2005
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson, based on elf32-fr30.c
@ -849,8 +849,9 @@ elf_cris_link_hash_table_create (abfd)
if (ret == (struct elf_cris_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_cris_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_cris_link_hash_newfunc,
sizeof (struct elf_cris_link_hash_entry)))
{
free (ret);
return NULL;
@ -1769,7 +1770,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot)
sym->st_shndx = SHN_ABS;
return TRUE;

View File

@ -50,10 +50,10 @@ static reloc_howto_type elf_d10v_howto_table[] =
HOWTO (R_D10V_10_PCREL_R, /* Type. */
2, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
7, /* Bitsize. */
8, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
complain_overflow_signed, /* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
"R_D10V_10_PCREL_R", /* Name. */
FALSE, /* Partial_inplace. */
@ -65,10 +65,10 @@ static reloc_howto_type elf_d10v_howto_table[] =
HOWTO (R_D10V_10_PCREL_L, /* Type. */
2, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
7, /* Bitsize. */
8, /* Bitsize. */
TRUE, /* PC_relative. */
15, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
complain_overflow_signed, /* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
"R_D10V_10_PCREL_L", /* Name. */
FALSE, /* Partial_inplace. */
@ -110,10 +110,10 @@ static reloc_howto_type elf_d10v_howto_table[] =
HOWTO (R_D10V_18_PCREL, /* Type. */
2, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
15, /* Bitsize. */
16, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
complain_overflow_signed, /* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
"R_D10V_18_PCREL", /* Name. */
FALSE, /* Partial_inplace. */

View File

@ -512,21 +512,15 @@ dlx_rtype_to_howto (unsigned int r_type)
{
case R_DLX_RELOC_16_PCREL:
return & elf_dlx_gnu_rel16_s2;
break;
case R_DLX_RELOC_26_PCREL:
return & elf_dlx_gnu_rel26_s2;
break;
case R_DLX_RELOC_16_HI:
return & elf_dlx_reloc_16_hi;
break;
case R_DLX_RELOC_16_LO:
return & elf_dlx_reloc_16_lo;
break;
default:
BFD_ASSERT (r_type < (unsigned int) R_DLX_max);
return & dlx_elf_howto_table[r_type];
break;
}
}

View File

@ -1,5 +1,5 @@
/* FRV-specific support for 32-bit ELF.
Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -78,6 +78,10 @@ static bfd_boolean frv_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
static bfd_boolean frv_elf_print_private_bfd_data
PARAMS ((bfd *, PTR));
static bfd_boolean elf32_frv_grok_prstatus (bfd * abfd,
Elf_Internal_Note * note);
static bfd_boolean elf32_frv_grok_psinfo (bfd * abfd,
Elf_Internal_Note * note);
static reloc_howto_type elf32_frv_howto_table [] =
{
@ -1004,8 +1008,9 @@ frvfdpic_elf_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd,
_bfd_elf_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
_bfd_elf_link_hash_newfunc,
sizeof (struct elf_link_hash_entry)))
{
free (ret);
return NULL;
@ -4394,10 +4399,14 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
if (bed->want_plt_sym
&& !_bfd_elf_define_linkage_sym (abfd, info, s,
"_PROCEDURE_LINKAGE_TABLE_"))
return FALSE;
if (bed->want_plt_sym)
{
h = _bfd_elf_define_linkage_sym (abfd, info, s,
"_PROCEDURE_LINKAGE_TABLE_");
elf_hash_table (info)->hplt = h;
if (h == NULL)
return FALSE;
}
/* FRV-specific: we want rel relocations for the plt. */
s = bfd_make_section_with_flags (abfd, ".rel.plt",
@ -6823,6 +6832,86 @@ frv_elf_print_private_bfd_data (abfd, ptr)
}
/* Support for core dump NOTE sections. */
static bfd_boolean
elf32_frv_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
{
int offset;
unsigned int raw_size;
switch (note->descsz)
{
default:
return FALSE;
/* The Linux/FRV elf_prstatus struct is 268 bytes long. The other
hardcoded offsets and sizes listed below (and contained within
this lexical block) refer to fields in the target's elf_prstatus
struct. */
case 268:
/* `pr_cursig' is at offset 12. */
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
/* `pr_pid' is at offset 24. */
elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
/* `pr_reg' is at offset 72. */
offset = 72;
/* Most grok_prstatus implementations set `raw_size' to the size
of the pr_reg field. For Linux/FRV, we set `raw_size' to be
the size of `pr_reg' plus the size of `pr_exec_fdpic_loadmap'
and `pr_interp_fdpic_loadmap', both of which (by design)
immediately follow `pr_reg'. This will allow these fields to
be viewed by GDB as registers.
`pr_reg' is 184 bytes long. `pr_exec_fdpic_loadmap' and
`pr_interp_fdpic_loadmap' are 4 bytes each. */
raw_size = 184 + 4 + 4;
break;
}
/* Make a ".reg/999" section. */
return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size,
note->descpos + offset);
}
static bfd_boolean
elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
{
switch (note->descsz)
{
default:
return FALSE;
/* The Linux/FRV elf_prpsinfo struct is 124 bytes long. */
case 124:
/* `pr_fname' is found at offset 28 and is 16 bytes long. */
elf_tdata (abfd)->core_program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
/* `pr_psargs' is found at offset 44 and is 80 bytes long. */
elf_tdata (abfd)->core_command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
/* Note that for some reason, a spurious space is tacked
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
char *command = elf_tdata (abfd)->core_command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
command[n - 1] = '\0';
}
return TRUE;
}
#define ELF_ARCH bfd_arch_frv
#define ELF_MACHINE_CODE EM_CYGNUS_FRV
#define ELF_MAXPAGESIZE 0x1000
@ -6857,6 +6946,9 @@ frv_elf_print_private_bfd_data (abfd, ptr)
#define elf_backend_finish_dynamic_sections \
elf32_frv_finish_dynamic_sections
#define elf_backend_grok_prstatus elf32_frv_grok_prstatus
#define elf_backend_grok_psinfo elf32_frv_grok_psinfo
#include "elf32-target.h"
#undef ELF_MAXPAGESIZE

View File

@ -1,6 +1,6 @@
/* BFD back-end for HP PA-RISC ELF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Original code by
Center for Software Science
@ -394,14 +394,16 @@ elf32_hppa_link_hash_table_create (bfd *abfd)
if (htab == NULL)
return NULL;
if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd, hppa_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd, hppa_link_hash_newfunc,
sizeof (struct elf32_hppa_link_hash_entry)))
{
free (htab);
return NULL;
}
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc))
if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
sizeof (struct elf32_hppa_stub_hash_entry)))
return NULL;
htab->stub_bfd = NULL;
@ -2020,9 +2022,21 @@ allocate_dynrelocs (struct elf_link_hash_entry *eh, void *inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT
if (hh->dyn_relocs != NULL
&& eh->root.type == bfd_link_hash_undefweak)
hh->dyn_relocs = NULL;
{
if (ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT)
hh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
else if (eh->dynindx == -1
&& !eh->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, eh))
return FALSE;
}
}
}
else
{
@ -2347,7 +2361,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
must add the entries now so that we get the correct size for
the .dynamic section. The DT_DEBUG entry is filled in by the
dynamic linker and used by the debugger. */
if (!info->shared)
if (info->executable)
{
if (!add_dynamic_entry (DT_DEBUG, 0))
return FALSE;
@ -4045,7 +4059,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (eh->root.root.string[0] == '_'
&& (strcmp (eh->root.root.string, "_DYNAMIC") == 0
|| strcmp (eh->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0))
|| eh == htab->etab.hgot))
{
sym->st_shndx = SHN_ABS;
}

View File

@ -1,6 +1,6 @@
/* i370-specific support for 32-bit ELF
Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
2005, 2006 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
@ -567,7 +567,7 @@ i370_elf_adjust_dynindx (struct elf_link_hash_entry *h, void * cparg)
#ifdef DEBUG
fprintf (stderr,
"i370_elf_adjust_dynindx called, h->dynindx = %d, *cp = %d\n",
"i370_elf_adjust_dynindx called, h->dynindx = %ld, *cp = %d\n",
h->dynindx, *cp);
#endif
@ -1296,7 +1296,7 @@ i370_elf_relocate_section (bfd *output_bfd,
#ifdef DEBUG
if (indx <= 0)
{
printf ("indx=%d section=%s flags=%08x name=%s\n",
printf ("indx=%ld section=%s flags=%08x name=%s\n",
indx, osec->name, osec->flags,
h->root.root.string);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* M32R-specific support for 32-bit ELF.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -1572,8 +1572,9 @@ m32r_elf_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
m32r_elf_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
m32r_elf_link_hash_newfunc,
sizeof (struct elf_m32r_link_hash_entry)))
{
free (ret);
return NULL;
@ -1668,6 +1669,7 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->type = STT_OBJECT;
htab->root.hplt = h;
if (info->shared
&& ! bfd_elf_link_record_dynamic_symbol (info, h))
@ -2101,6 +2103,24 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
pp = &p->next;
}
}
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
else if (h->dynindx == -1
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
}
}
else
{
@ -2878,6 +2898,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
case R_M32R_24_RELA:
case R_M32R_32_RELA:
case R_M32R_REL32:
case R_M32R_10_PCREL_RELA:
case R_M32R_18_PCREL_RELA:
case R_M32R_26_PCREL_RELA:
case R_M32R_HI16_ULO_RELA:
@ -2885,7 +2906,8 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
if (info->shared
&& r_symndx != 0
&& (input_section->flags & SEC_ALLOC) != 0
&& ((r_type != R_M32R_18_PCREL_RELA
&& (( r_type != R_M32R_10_PCREL_RELA
&& r_type != R_M32R_18_PCREL_RELA
&& r_type != R_M32R_26_PCREL_RELA
&& r_type != R_M32R_REL32)
|| (h != NULL
@ -2936,7 +2958,8 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
if (skip)
memset (&outrel, 0, sizeof outrel);
else if (r_type == R_M32R_18_PCREL_RELA
else if ( r_type == R_M32R_10_PCREL_RELA
|| r_type == R_M32R_18_PCREL_RELA
|| r_type == R_M32R_26_PCREL_RELA
|| r_type == R_M32R_REL32)
{
@ -2975,8 +2998,11 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
an addend for the dynamic reloc. */
if (! relocate)
continue;
break;
}
break;
else if (r_type != R_M32R_10_PCREL_RELA)
break;
/* Fall through. */
case (int) R_M32R_10_PCREL :
r = m32r_elf_do_10_pcrel_reloc (input_bfd, howto, input_section,
@ -3333,7 +3359,7 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd,
/* Mark some specially defined symbols as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == htab->root.hgot)
sym->st_shndx = SHN_ABS;
return TRUE;
@ -3714,6 +3740,7 @@ m32r_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
case R_M32R_HI16_SLO_RELA:
case R_M32R_LO16_RELA:
case R_M32R_SDA16_RELA:
case R_M32R_10_PCREL_RELA:
case R_M32R_18_PCREL_RELA:
case R_M32R_26_PCREL_RELA:
if (h != NULL)
@ -3730,8 +3757,9 @@ m32r_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
if (p->sec == sec)
{
if (ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
if ( ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_18_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_10_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_REL32)
p->pc_count -= 1;
p->count -= 1;
@ -3897,6 +3925,7 @@ m32r_elf_check_relocs (bfd *abfd,
case R_M32R_HI16_SLO_RELA:
case R_M32R_LO16_RELA:
case R_M32R_SDA16_RELA:
case R_M32R_10_PCREL_RELA:
case R_M32R_18_PCREL_RELA:
case R_M32R_26_PCREL_RELA:
@ -3927,8 +3956,9 @@ m32r_elf_check_relocs (bfd *abfd,
symbol. */
if ((info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& ((r_type != R_M32R_26_PCREL_RELA
&& (( r_type != R_M32R_26_PCREL_RELA
&& r_type != R_M32R_18_PCREL_RELA
&& r_type != R_M32R_10_PCREL_RELA
&& r_type != R_M32R_REL32)
|| (h != NULL
&& (! info->symbolic
@ -4018,9 +4048,10 @@ m32r_elf_check_relocs (bfd *abfd,
}
p->count += 1;
if (ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_REL32
|| ELF32_R_TYPE (rel->r_info) == R_M32R_18_PCREL_RELA)
if ( ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_18_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_10_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_REL32)
p->pc_count += 1;
}
break;

View File

@ -1,5 +1,5 @@
/* Motorola 68HC11/HC12-specific support for 32-bit ELF
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
@ -70,8 +70,9 @@ m68hc11_elf_hash_table_create (bfd *abfd)
return NULL;
memset (ret, 0, amt);
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
_bfd_elf_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
_bfd_elf_link_hash_newfunc,
sizeof (struct elf_link_hash_entry)))
{
free (ret);
return NULL;
@ -85,7 +86,8 @@ m68hc11_elf_hash_table_create (bfd *abfd)
free (ret);
return NULL;
}
if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc))
if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc,
sizeof (struct elf32_m68hc11_stub_hash_entry)))
return NULL;
ret->stub_bfd = NULL;

View File

@ -1,6 +1,6 @@
/* Motorola 68k series support for 32-bit ELF
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -24,6 +24,7 @@
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/m68k.h"
#include "opcode/m68k.h"
static reloc_howto_type *reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
@ -220,7 +221,7 @@ static const bfd_byte elf_m68k_plt_entry[PLT_ENTRY_SIZE] =
#define CFV4E_PLT_ENTRY_SIZE 24
#define CFV4E_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_CFV4E)
#define CFV4E_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_M68K_CFV4E)
static const bfd_byte elf_cfv4e_plt0_entry[CFV4E_PLT_ENTRY_SIZE] =
{
@ -248,7 +249,7 @@ static const bfd_byte elf_cfv4e_plt_entry[CFV4E_PLT_ENTRY_SIZE] =
0, 0, 0, 0 /* Replaced with offset to start of .plt. */
};
#define CPU32_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_CPU32)
#define CPU32_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_M68K_CPU32)
#define PLT_CPU32_ENTRY_SIZE 24
/* Procedure linkage table entries for the cpu32 */
@ -360,8 +361,9 @@ elf_m68k_link_hash_table_create (abfd)
if (ret == (struct elf_m68k_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_m68k_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_m68k_link_hash_newfunc,
sizeof (struct elf_m68k_link_hash_entry)))
{
free (ret);
return NULL;
@ -372,6 +374,58 @@ elf_m68k_link_hash_table_create (abfd)
return &ret->root.root;
}
/* Set the right machine number. */
static bfd_boolean
elf32_m68k_object_p (bfd *abfd)
{
unsigned int mach = 0;
unsigned features = 0;
flagword eflags = elf_elfheader (abfd)->e_flags;
if (eflags & EF_M68K_M68000)
features |= m68000;
else if (eflags & EF_M68K_CPU32)
features |= cpu32;
else if (eflags & EF_M68K_ISA_MASK)
{
switch (eflags & EF_M68K_ISA_MASK)
{
case EF_M68K_ISA_A_NODIV:
features |= mcfisa_a;
break;
case EF_M68K_ISA_A:
features |= mcfisa_a|mcfhwdiv;
break;
case EF_M68K_ISA_A_PLUS:
features |= mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp;
break;
case EF_M68K_ISA_B_NOUSP:
features |= mcfisa_a|mcfisa_b|mcfhwdiv;
break;
case EF_M68K_ISA_B:
features |= mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp;
break;
}
switch (eflags & EF_M68K_MAC_MASK)
{
case EF_M68K_MAC:
features |= mcfmac;
break;
case EF_M68K_EMAC:
features |= mcfemac;
break;
}
if (eflags & EF_M68K_FLOAT)
features |= cfloat;
}
mach = bfd_m68k_features_to_mach (features);
bfd_default_set_arch_mach (abfd, bfd_arch_m68k, mach);
return TRUE;
}
/* Keep m68k-specific flags in the ELF header. */
static bfd_boolean
elf32_m68k_set_private_flags (abfd, flags)
@ -392,19 +446,39 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd)
{
flagword out_flags;
flagword in_flags;
flagword out_isa;
flagword in_isa;
const bfd_arch_info_type *arch_info;
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
return FALSE;
in_flags = elf_elfheader (ibfd)->e_flags;
out_flags = elf_elfheader (obfd)->e_flags;
/* Get the merged machine. This checks for incompatibility between
Coldfire & non-Coldfire flags, incompability between different
Coldfire ISAs, and incompability between different MAC types. */
arch_info = bfd_arch_get_compatible (ibfd, obfd, FALSE);
if (!arch_info)
return FALSE;
bfd_set_arch_mach (obfd, bfd_arch_m68k, arch_info->mach);
in_flags = elf_elfheader (ibfd)->e_flags;
if (!elf_flags_init (obfd))
{
elf_flags_init (obfd) = TRUE;
elf_elfheader (obfd)->e_flags = in_flags;
out_flags = in_flags;
}
else
{
out_flags = elf_elfheader (obfd)->e_flags;
in_isa = (in_flags & EF_M68K_ISA_MASK);
out_isa = (out_flags & EF_M68K_ISA_MASK);
if (in_isa > out_isa)
out_flags ^= in_isa ^ out_isa;
out_flags |= in_flags ^ in_isa;
}
elf_elfheader (obfd)->e_flags = out_flags;
return TRUE;
}
@ -416,6 +490,7 @@ elf32_m68k_print_private_bfd_data (abfd, ptr)
PTR ptr;
{
FILE *file = (FILE *) ptr;
flagword eflags = elf_elfheader (abfd)->e_flags;
BFD_ASSERT (abfd != NULL && ptr != NULL);
@ -427,12 +502,60 @@ elf32_m68k_print_private_bfd_data (abfd, ptr)
/* xgettext:c-format */
fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
if (elf_elfheader (abfd)->e_flags & EF_CPU32)
fprintf (file, _(" [cpu32]"));
if (eflags & EF_M68K_CPU32)
fprintf (file, " [cpu32]");
if (elf_elfheader (abfd)->e_flags & EF_M68000)
fprintf (file, _(" [m68000]"));
if (eflags & EF_M68K_M68000)
fprintf (file, " [m68000]");
if (eflags & EF_M68K_CFV4E)
fprintf (file, " [cfv4e]");
if (eflags & EF_M68K_ISA_MASK)
{
char const *isa = _("unknown");
char const *mac = _("unknown");
char const *additional = "";
switch (eflags & EF_M68K_ISA_MASK)
{
case EF_M68K_ISA_A_NODIV:
isa = "A";
additional = " [nodiv]";
break;
case EF_M68K_ISA_A:
isa = "A";
break;
case EF_M68K_ISA_A_PLUS:
isa = "A+";
break;
case EF_M68K_ISA_B_NOUSP:
isa = "B";
additional = " [nousp]";
break;
case EF_M68K_ISA_B:
isa = "B";
break;
}
fprintf (file, " [isa %s]%s", isa, additional);
if (eflags & EF_M68K_FLOAT)
fprintf (file, " [float]");
switch (eflags & EF_M68K_MAC_MASK)
{
case 0:
mac = NULL;
break;
case EF_M68K_MAC:
mac = "mac";
break;
case EF_M68K_EMAC:
mac = "emac";
break;
}
if (mac)
fprintf (file, " [%s]", mac);
}
fputc ('\n', file);
return TRUE;
@ -1978,7 +2101,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot)
sym->st_shndx = SHN_ABS;
return TRUE;
@ -2313,6 +2436,7 @@ elf_m68k_plt_sym_val (bfd_vma i, const asection *plt,
elf32_m68k_print_private_bfd_data
#define elf_backend_reloc_type_class elf32_m68k_reloc_type_class
#define elf_backend_plt_sym_val elf_m68k_plt_sym_val
#define elf_backend_object_p elf32_m68k_object_p
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1

View File

@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#include "elf-bfd.h"
#include "elfxx-mips.h"
#include "elf/mips.h"
#include "elf-vxworks.h"
/* Get the ECOFF swapping routines. */
#include "coff/sym.h"
@ -257,9 +258,11 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* 16 bit PC relative reference. */
/* 16 bit PC relative reference. Note that the ABI document has a typo
and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
0, /* rightshift */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@ -1206,7 +1209,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
{ BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL },
{ BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 },
{ BFD_RELOC_16_PCREL, R_MIPS_PC16 },
{ BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
{ BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 },
{ BFD_RELOC_GPREL32, R_MIPS_GPREL32 },
{ BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
@ -1283,8 +1286,6 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
return &elf_mips_gnu_vtinherit_howto;
case BFD_RELOC_VTABLE_ENTRY:
return &elf_mips_gnu_vtentry_howto;
case BFD_RELOC_16_PCREL_S2:
return &elf_mips_gnu_rel16_s2;
case BFD_RELOC_32_PCREL:
return &elf_mips_gnu_pcrel32;
}
@ -1319,10 +1320,12 @@ mips_elf32_rtype_to_howto (unsigned int r_type,
static void
mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
{
const struct elf_backend_data *bed;
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
cache_ptr->howto = mips_elf32_rtype_to_howto (r_type, FALSE);
bed = get_elf_backend_data (abfd);
cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (r_type, FALSE);
/* The addend for a GPREL16 or LITERAL relocation comes from the GP
value for the object file. We get the addend now, rather than
@ -1619,3 +1622,147 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
/* Include the target file again for this target. */
#include "elf32-target.h"
/* Specific to VxWorks. */
static reloc_howto_type mips_vxworks_copy_howto_rela =
HOWTO (R_MIPS_COPY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MIPS_COPY", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Specific to VxWorks. */
static reloc_howto_type mips_vxworks_jump_slot_howto_rela =
HOWTO (R_MIPS_JUMP_SLOT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MIPS_JUMP_SLOT", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Implement elf_backend_bfd_reloc_type_lookup for VxWorks. */
static reloc_howto_type *
mips_vxworks_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
{
switch (code)
{
case BFD_RELOC_MIPS_COPY:
return &mips_vxworks_copy_howto_rela;
case BFD_RELOC_MIPS_JUMP_SLOT:
return &mips_vxworks_jump_slot_howto_rela;
default:
return bfd_elf32_bfd_reloc_type_lookup (abfd, code);
}
}
/* Implement elf_backend_mips_rtype_to_lookup for VxWorks. */
static reloc_howto_type *
mips_vxworks_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
{
switch (r_type)
{
case R_MIPS_COPY:
return &mips_vxworks_copy_howto_rela;
case R_MIPS_JUMP_SLOT:
return &mips_vxworks_jump_slot_howto_rela;
default:
return mips_elf32_rtype_to_howto (r_type, rela_p);
}
}
/* Implement elf_backend_final_write_processing for VxWorks. */
static void
mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
_bfd_mips_elf_final_write_processing (abfd, linker);
elf_vxworks_final_write_processing (abfd, linker);
}
#undef TARGET_LITTLE_SYM
#undef TARGET_LITTLE_NAME
#undef TARGET_BIG_SYM
#undef TARGET_BIG_NAME
#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vxworks_vec
#define TARGET_LITTLE_NAME "elf32-littlemips-vxworks"
#define TARGET_BIG_SYM bfd_elf32_bigmips_vxworks_vec
#define TARGET_BIG_NAME "elf32-bigmips-vxworks"
#undef elf32_bed
#define elf32_bed elf32_mips_vxworks_bed
#undef ELF_MAXPAGESIZE
#define ELF_MAXPAGESIZE 0x1000
#undef elf_backend_want_got_plt
#define elf_backend_want_got_plt 1
#undef elf_backend_want_plt_sym
#define elf_backend_want_plt_sym 1
#undef elf_backend_got_symbol_offset
#define elf_backend_got_symbol_offset 0
#undef elf_backend_want_dynbss
#define elf_backend_want_dynbss 1
#undef elf_backend_may_use_rel_p
#define elf_backend_may_use_rel_p 0
#undef elf_backend_may_use_rela_p
#define elf_backend_may_use_rela_p 1
#undef elf_backend_default_use_rela_p
#define elf_backend_default_use_rela_p 1
#undef elf_backend_got_header_size
#define elf_backend_got_header_size (4 * 3)
#undef elf_backend_plt_readonly
#define elf_backend_plt_readonly 1
#undef bfd_elf32_bfd_reloc_type_lookup
#define bfd_elf32_bfd_reloc_type_lookup \
mips_vxworks_bfd_reloc_type_lookup
#undef elf_backend_mips_rtype_to_howto
#define elf_backend_mips_rtype_to_howto \
mips_vxworks_rtype_to_howto
#undef elf_backend_adjust_dynamic_symbol
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_vxworks_adjust_dynamic_symbol
#undef elf_backend_finish_dynamic_symbol
#define elf_backend_finish_dynamic_symbol \
_bfd_mips_vxworks_finish_dynamic_symbol
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
_bfd_mips_vxworks_link_hash_table_create
#undef elf_backend_add_symbol_hook
#define elf_backend_add_symbol_hook \
elf_vxworks_add_symbol_hook
#undef elf_backend_link_output_symbol_hook
#define elf_backend_link_output_symbol_hook \
elf_vxworks_link_output_symbol_hook
#undef elf_backend_emit_relocs
#define elf_backend_emit_relocs \
elf_vxworks_emit_relocs
#undef elf_backend_final_write_processing
#define elf_backend_final_write_processing \
mips_vxworks_final_write_processing
#undef elf_backend_additional_program_headers
#undef elf_backend_modify_segment_map
#undef elf_backend_symbol_processing
/* NOTE: elf_backend_rela_normal is not defined for MIPS. */
#include "elf32-target.h"

648
gnu/dist/gdb6/bfd/elf32-mt.c vendored Normal file
View File

@ -0,0 +1,648 @@
/* Morpho Technologies MT specific support for 32-bit ELF
Copyright 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/mt.h"
/* Prototypes. */
static reloc_howto_type * mt_reloc_type_lookup
(bfd *, bfd_reloc_code_real_type);
static void mt_info_to_howto_rela
(bfd *, arelent *, Elf_Internal_Rela *);
static bfd_reloc_status_type mt_elf_relocate_hi16
(bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma);
static bfd_reloc_status_type mt_final_link_relocate
(reloc_howto_type *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, bfd_vma);
static bfd_boolean mt_elf_relocate_section
(bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
/* Relocation tables. */
static reloc_howto_type mt_elf_howto_table [] =
{
/* This reloc does nothing. */
HOWTO (R_MT_NONE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_NONE", /* name */
FALSE, /* partial_inplace */
0 , /* src_mask */
0, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 16 bit absolute relocation. */
HOWTO (R_MT_16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_16", /* name */
FALSE, /* partial_inplace */
0 , /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 32 bit absolute relocation. */
HOWTO (R_MT_32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_32", /* name */
FALSE, /* partial_inplace */
0 , /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 32 bit pc-relative relocation. */
HOWTO (R_MT_32_PCREL, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_32_PCREL", /* name */
FALSE, /* partial_inplace */
0 , /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
/* A 16 bit pc-relative relocation. */
HOWTO (R_MT_PC16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_PC16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
TRUE), /* pcrel_offset */
/* high 16 bits of symbol value. */
HOWTO (R_MT_HI16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_HI16", /* name */
FALSE, /* partial_inplace */
0xffff0000, /* src_mask */
0xffff0000, /* dst_mask */
FALSE), /* pcrel_offset */
/* Low 16 bits of symbol value. */
HOWTO (R_MT_LO16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MT_LO16", /* name */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
};
/* Map BFD reloc types to MT ELF reloc types. */
static reloc_howto_type *
mt_reloc_type_lookup
(bfd * abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
/* Note that the mt_elf_howto_table is indxed by the R_
constants. Thus, the order that the howto records appear in the
table *must* match the order of the relocation types defined in
include/elf/mt.h. */
switch (code)
{
case BFD_RELOC_NONE:
return &mt_elf_howto_table[ (int) R_MT_NONE];
case BFD_RELOC_16:
return &mt_elf_howto_table[ (int) R_MT_16];
case BFD_RELOC_32:
return &mt_elf_howto_table[ (int) R_MT_32];
case BFD_RELOC_32_PCREL:
return &mt_elf_howto_table[ (int) R_MT_32_PCREL];
case BFD_RELOC_16_PCREL:
return &mt_elf_howto_table[ (int) R_MT_PC16];
case BFD_RELOC_HI16:
return &mt_elf_howto_table[ (int) R_MT_HI16];
case BFD_RELOC_LO16:
return &mt_elf_howto_table[ (int) R_MT_LO16];
default:
/* Pacify gcc -Wall. */
return NULL;
}
return NULL;
}
bfd_reloc_status_type
mt_elf_relocate_hi16
(bfd * input_bfd,
Elf_Internal_Rela * relhi,
bfd_byte * contents,
bfd_vma value)
{
bfd_vma insn;
insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
value += relhi->r_addend;
value >>= 16;
insn = ((insn & ~0xFFFF) | value);
bfd_put_32 (input_bfd, insn, contents + relhi->r_offset);
return bfd_reloc_ok;
}
/* XXX: The following code is the result of a cut&paste. This unfortunate
practice is very widespread in the various target back-end files. */
/* Set the howto pointer for a MT ELF reloc. */
static void
mt_info_to_howto_rela
(bfd * abfd ATTRIBUTE_UNUSED,
arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
cache_ptr->howto = & mt_elf_howto_table [r_type];
}
/* Perform a single relocation. By default we use the standard BFD
routines. */
static bfd_reloc_status_type
mt_final_link_relocate
(reloc_howto_type * howto,
bfd * input_bfd,
asection * input_section,
bfd_byte * contents,
Elf_Internal_Rela * rel,
bfd_vma relocation)
{
return _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,
relocation, rel->r_addend);
}
/* Relocate a MT ELF section.
There is some attempt to make this function usable for many architectures,
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
if only to serve as a learning tool.
The RELOCATE_SECTION function is called by the new ELF backend linker
to handle the relocations for a section.
The relocs are always passed as Rela structures; if the section
actually uses Rel structures, the r_addend field will always be
zero.
This function is responsible for adjusting the section contents as
necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
address or the reloc symbol index.
LOCAL_SYMS is a pointer to the swapped in local symbols.
LOCAL_SECTIONS is an array giving the section in the input file
corresponding to the st_shndx field of each local symbol.
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
accordingly. */
static bfd_boolean
mt_elf_relocate_section
(bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info,
bfd * input_bfd,
asection * input_section,
bfd_byte * contents,
Elf_Internal_Rela * relocs,
Elf_Internal_Sym * local_syms,
asection ** local_sections)
{
Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
Elf_Internal_Rela * rel;
Elf_Internal_Rela * relend;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
relend = relocs + input_section->reloc_count;
for (rel = relocs; rel < relend; rel ++)
{
reloc_howto_type * howto;
unsigned long r_symndx;
Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
bfd_reloc_status_type r;
const char * name = NULL;
int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
/* This is a final link. */
howto = mt_elf_howto_table + ELF32_R_TYPE (rel->r_info);
h = NULL;
sym = NULL;
sec = NULL;
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
sec = local_sections [r_symndx];
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
}
else
{
bfd_boolean unresolved_reloc;
bfd_boolean warned;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
unresolved_reloc, warned);
name = h->root.root.string;
}
/* Finally, the sole MT-specific part. */
switch (r_type)
{
case R_MT_HI16:
r = mt_elf_relocate_hi16 (input_bfd, rel, contents, relocation);
break;
default:
r = mt_final_link_relocate (howto, input_bfd, input_section,
contents, rel, relocation);
break;
}
if (r != bfd_reloc_ok)
{
const char * msg = (const char *) NULL;
switch (r)
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol
(info, name, input_bfd, input_section, rel->r_offset, TRUE);
break;
case bfd_reloc_outofrange:
msg = _("internal error: out of range error");
break;
case bfd_reloc_dangerous:
msg = _("internal error: dangerous relocation");
break;
default:
msg = _("internal error: unknown error");
break;
}
if (msg)
r = info->callbacks->warning
(info, msg, name, input_bfd, input_section, rel->r_offset);
if (! r)
return FALSE;
}
}
return TRUE;
}
/* Return the section that should be marked against GC for a given
relocation. */
static asection *
mt_elf_gc_mark_hook
(asection * sec,
struct bfd_link_info * info ATTRIBUTE_UNUSED,
Elf_Internal_Rela * rel ATTRIBUTE_UNUSED,
struct elf_link_hash_entry * h,
Elf_Internal_Sym * sym)
{
if (h != NULL)
{
switch (h->root.type)
{
case bfd_link_hash_defined:
case bfd_link_hash_defweak:
return h->root.u.def.section;
case bfd_link_hash_common:
return h->root.u.c.p->section;
default:
break;
}
}
else
{
if (!(elf_bad_symtab (sec->owner)
&& ELF_ST_BIND (sym->st_info) != STB_LOCAL)
&& ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
&& sym->st_shndx != SHN_COMMON))
return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
}
return NULL;
}
/* Update the got entry reference counts for the section being
removed. */
static bfd_boolean
mt_elf_gc_sweep_hook
(bfd * abfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info ATTRIBUTE_UNUSED,
asection * sec ATTRIBUTE_UNUSED,
const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED)
{
return TRUE;
}
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
static bfd_boolean
mt_elf_check_relocs
(bfd * abfd,
struct bfd_link_info * info,
asection * sec,
const Elf_Internal_Rela * relocs)
{
Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
struct elf_link_hash_entry ** sym_hashes_end;
const Elf_Internal_Rela * rel;
const Elf_Internal_Rela * rel_end;
if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
if (!elf_bad_symtab (abfd))
sym_hashes_end -= symtab_hdr->sh_info;
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
{
struct elf_link_hash_entry *h;
unsigned long r_symndx;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
}
}
return TRUE;
}
/* Return the MACH for an e_flags value. */
static int
elf32_mt_machine (bfd *abfd)
{
switch (elf_elfheader (abfd)->e_flags & EF_MT_CPU_MASK)
{
case EF_MT_CPU_MRISC: return bfd_mach_ms1;
case EF_MT_CPU_MRISC2: return bfd_mach_mrisc2;
case EF_MT_CPU_MS2: return bfd_mach_ms2;
}
return bfd_mach_ms1;
}
static bfd_boolean
mt_elf_object_p (bfd * abfd)
{
bfd_default_set_arch_mach (abfd, bfd_arch_mt, elf32_mt_machine (abfd));
return TRUE;
}
/* Function to set the ELF flag bits. */
static bfd_boolean
mt_elf_set_private_flags (bfd * abfd,
flagword flags)
{
elf_elfheader (abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE;
return TRUE;
}
static bfd_boolean
mt_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
{
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
BFD_ASSERT (!elf_flags_init (obfd)
|| elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
elf_flags_init (obfd) = TRUE;
return TRUE;
}
/* Merge backend specific data from an object file to the output
object file when linking. */
static bfd_boolean
mt_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
{
flagword old_flags, new_flags;
bfd_boolean ok = TRUE;
/* Check if we have the same endianess. */
if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE)
return FALSE;
/* If they're not both mt, then merging is meaningless, so just
don't do it. */
if (strcmp (ibfd->arch_info->arch_name, "mt") != 0)
return TRUE;
if (strcmp (obfd->arch_info->arch_name, "mt") != 0)
return TRUE;
new_flags = elf_elfheader (ibfd)->e_flags;
old_flags = elf_elfheader (obfd)->e_flags;
#ifdef DEBUG
_bfd_error_handler ("%B: old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s",
ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no");
#endif
if (!elf_flags_init (obfd))
{
old_flags = new_flags;
elf_flags_init (obfd) = TRUE;
}
else if ((new_flags & EF_MT_CPU_MASK) != (old_flags & EF_MT_CPU_MASK))
{
/* CPU has changed. This is invalid, because MRISC, MRISC2 and
MS2 are not subsets of each other. */
ok = FALSE;
}
if (ok)
{
obfd->arch_info = ibfd->arch_info;
elf_elfheader (obfd)->e_flags = old_flags;
}
return ok;
}
static bfd_boolean
mt_elf_print_private_bfd_data (bfd * abfd, void * ptr)
{
FILE * file = (FILE *) ptr;
flagword flags;
BFD_ASSERT (abfd != NULL && ptr != NULL);
/* Print normal ELF private data. */
_bfd_elf_print_private_bfd_data (abfd, ptr);
flags = elf_elfheader (abfd)->e_flags;
fprintf (file, _("private flags = 0x%lx:"), (long)flags);
switch (flags & EF_MT_CPU_MASK)
{
default:
case EF_MT_CPU_MRISC: fprintf (file, " ms1-16-002"); break;
case EF_MT_CPU_MRISC2: fprintf (file, " ms1-16-003"); break;
case EF_MT_CPU_MS2: fprintf (file, " ms2"); break;
}
fputc ('\n', file);
return TRUE;
}
#define TARGET_BIG_SYM bfd_elf32_mt_vec
#define TARGET_BIG_NAME "elf32-mt"
#define ELF_ARCH bfd_arch_mt
#define ELF_MACHINE_CODE EM_MT
#define ELF_MAXPAGESIZE 1 /* No pages on the MT. */
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto mt_info_to_howto_rela
#define elf_backend_relocate_section mt_elf_relocate_section
#define bfd_elf32_bfd_reloc_type_lookup mt_reloc_type_lookup
#define elf_backend_gc_mark_hook mt_elf_gc_mark_hook
#define elf_backend_gc_sweep_hook mt_elf_gc_sweep_hook
#define elf_backend_check_relocs mt_elf_check_relocs
#define elf_backend_object_p mt_elf_object_p
#define elf_backend_rela_normal 1
#define elf_backend_can_gc_sections 1
#define bfd_elf32_bfd_set_private_flags mt_elf_set_private_flags
#define bfd_elf32_bfd_copy_private_bfd_data mt_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data mt_elf_merge_private_bfd_data
#define bfd_elf32_bfd_print_private_bfd_data mt_elf_print_private_bfd_data
#include "elf32-target.h"

View File

@ -1,6 +1,6 @@
/* PowerPC-specific support for 32-bit ELF
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -2313,6 +2313,13 @@ struct ppc_elf_link_hash_entry
#define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent))
enum ppc_elf_plt_type {
PLT_UNSET,
PLT_OLD,
PLT_NEW,
PLT_VXWORKS
};
/* PPC ELF linker hash table. */
struct ppc_elf_link_hash_table
@ -2349,9 +2356,14 @@ struct ppc_elf_link_hash_table
/* Non-zero if allocating the header left a gap. */
unsigned int got_gap;
/* Whether to use new plt/got layout or not. */
unsigned int new_plt:1;
unsigned int old_plt:1;
/* The type of PLT we have chosen to use. */
enum ppc_elf_plt_type plt_type;
/* Whether we can use the new PLT layout. */
unsigned int can_use_new_plt:1;
/* Set if we should emit symbols for stubs. */
unsigned int emit_stub_syms:1;
/* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec;
@ -2362,9 +2374,6 @@ struct ppc_elf_link_hash_table
/* The .got.plt section (VxWorks only)*/
asection *sgotplt;
/* Short-cuts to frequently used symbols on VxWorks targets. */
struct elf_link_hash_entry *hplt;
/* True if the target system is VxWorks. */
int is_vxworks;
@ -2421,8 +2430,9 @@ ppc_elf_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd,
ppc_elf_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
ppc_elf_link_hash_newfunc,
sizeof (struct ppc_elf_link_hash_entry)))
{
free (ret);
return NULL;
@ -2539,19 +2549,9 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
/* Create the section for VxWorks static plt relocations. */
if (htab->is_vxworks && !info->shared)
{
s = bfd_make_section (abfd, ".rela.plt.unloaded");
flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_READONLY
| SEC_LINKER_CREATED);
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags)
|| ! bfd_set_section_alignment (abfd, s,
get_elf_backend_data (abfd)->s->log_file_align))
return FALSE;
htab->srelplt2 = s;
}
if (htab->is_vxworks
&& !elf_vxworks_create_dynamic_sections (abfd, info, &htab->srelplt2))
return FALSE;
htab->relplt = bfd_get_section_by_name (abfd, ".rela.plt");
htab->plt = s = bfd_get_section_by_name (abfd, ".plt");
@ -2559,6 +2559,9 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
abort ();
flags = SEC_ALLOC | SEC_CODE | SEC_LINKER_CREATED;
if (htab->plt_type == PLT_VXWORKS)
/* The VxWorks PLT is a loaded section with contents. */
flags |= SEC_HAS_CONTENTS | SEC_LOAD | SEC_READONLY;
return bfd_set_section_flags (abfd, s, flags);
}
@ -2677,9 +2680,12 @@ static bfd_boolean
is_ppc_elf_target (const struct bfd_target *targ)
{
extern const bfd_target bfd_elf32_powerpc_vec;
extern const bfd_target bfd_elf32_powerpc_vxworks_vec;
extern const bfd_target bfd_elf32_powerpcle_vec;
return targ == &bfd_elf32_powerpc_vec || targ == &bfd_elf32_powerpcle_vec;
return (targ == &bfd_elf32_powerpc_vec
|| targ == &bfd_elf32_powerpc_vxworks_vec
|| targ == &bfd_elf32_powerpcle_vec);
}
/* Hook called by the linker routine which adds symbols from an object
@ -3245,7 +3251,7 @@ ppc_elf_check_relocs (bfd *abfd,
case R_PPC_REL16_LO:
case R_PPC_REL16_HI:
case R_PPC_REL16_HA:
htab->new_plt = 1;
htab->can_use_new_plt = 1;
break;
/* These are just markers. */
@ -3273,8 +3279,8 @@ ppc_elf_check_relocs (bfd *abfd,
/* This refers only to functions defined in the shared library. */
case R_PPC_LOCAL24PC:
if (h && h == htab->elf.hgot)
htab->old_plt = 1;
if (h && h == htab->elf.hgot && htab->plt_type == PLT_UNSET)
htab->plt_type = PLT_OLD;
break;
/* This relocation describes the C++ object vtable hierarchy.
@ -3315,7 +3321,7 @@ ppc_elf_check_relocs (bfd *abfd,
&& got2 != NULL
&& (sec->flags & SEC_CODE) != 0
&& (info->shared || info->pie)
&& !htab->old_plt)
&& htab->plt_type == PLT_UNSET)
{
/* Old -fPIC gcc code has .long LCTOC1-LCFx just before
the start of a function, which assembles to a REL32
@ -3328,9 +3334,11 @@ ppc_elf_check_relocs (bfd *abfd,
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec,
r_symndx);
if (s == got2)
htab->old_plt = 1;
htab->plt_type = PLT_OLD;
}
/* fall through */
if (h == NULL || h == htab->elf.hgot)
break;
goto dodyn1;
case R_PPC_REL24:
case R_PPC_REL14:
@ -3340,7 +3348,8 @@ ppc_elf_check_relocs (bfd *abfd,
break;
if (h == htab->elf.hgot)
{
htab->old_plt = 1;
if (htab->plt_type == PLT_UNSET)
htab->plt_type = PLT_OLD;
break;
}
/* fall through */
@ -3356,6 +3365,7 @@ ppc_elf_check_relocs (bfd *abfd,
case R_PPC_ADDR14_BRNTAKEN:
case R_PPC_UADDR32:
case R_PPC_UADDR16:
dodyn1:
if (h != NULL && !info->shared)
{
/* We may need a plt entry if the symbol turns out to be
@ -3593,26 +3603,23 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
int
ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info,
int force_old_plt)
int force_old_plt,
int emit_stub_syms)
{
struct ppc_elf_link_hash_table *htab;
flagword flags;
htab = ppc_elf_hash_table (info);
if (force_old_plt || !htab->new_plt)
htab->old_plt = 1;
if (htab->is_vxworks)
{
/* The VxWorks PLT is a loaded section with contents. */
flags = SEC_ALLOC | SEC_CODE | SEC_IN_MEMORY | SEC_LINKER_CREATED
| SEC_HAS_CONTENTS | SEC_LOAD | SEC_READONLY;
if (htab->plt_type == PLT_UNSET)
htab->plt_type = (force_old_plt || !htab->can_use_new_plt
? PLT_OLD : PLT_NEW);
if (htab->plt != NULL
&& !bfd_set_section_flags (htab->elf.dynobj, htab->plt, flags))
return -1;
}
else if (!htab->old_plt)
htab->emit_stub_syms = emit_stub_syms;
BFD_ASSERT (htab->plt_type != PLT_VXWORKS);
if (htab->plt_type == PLT_NEW)
{
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
@ -3634,7 +3641,7 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
&& !bfd_set_section_alignment (htab->elf.dynobj, htab->glink, 0))
return -1;
}
return !htab->old_plt;
return htab->plt_type == PLT_NEW;
}
/* Return the section that should be marked against GC for a given
@ -3822,7 +3829,7 @@ ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info)
struct ppc_elf_link_hash_table *htab;
htab = ppc_elf_hash_table (info);
if (!htab->old_plt
if (htab->plt_type == PLT_NEW
&& htab->plt != NULL
&& htab->plt->output_section != NULL)
{
@ -4207,6 +4214,58 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
return TRUE;
}
/* Generate a symbol to mark plt call stubs. For non-PIC code the sym is
xxxxxxxx.plt_call32.<callee> where xxxxxxxx is a hex number, usually 0,
specifying the addend on the plt relocation. For -fpic code, the sym
is xxxxxxxx.plt_pic32.<callee>, and for -fPIC
xxxxxxxx.got2.plt_pic32.<callee>. */
static bfd_boolean
add_stub_sym (struct plt_entry *ent,
struct elf_link_hash_entry *h,
struct bfd_link_info *info)
{
struct elf_link_hash_entry *sh;
size_t len1, len2, len3;
char *name;
const char *stub;
struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
if (info->shared || info->pie)
stub = ".plt_pic32.";
else
stub = ".plt_call32.";
len1 = strlen (h->root.root.string);
len2 = strlen (stub);
len3 = 0;
if (ent->sec)
len3 = strlen (ent->sec->name);
name = bfd_malloc (len1 + len2 + len3 + 9);
if (name == NULL)
return FALSE;
sprintf (name, "%08x", (unsigned) ent->addend & 0xffffffff);
if (ent->sec)
memcpy (name + 8, ent->sec->name, len3);
memcpy (name + 8 + len3, stub, len2);
memcpy (name + 8 + len3 + len2, h->root.root.string, len1 + 1);
sh = elf_link_hash_lookup (&htab->elf, name, TRUE, FALSE, FALSE);
if (sh == NULL)
return FALSE;
if (sh->root.type == bfd_link_hash_new)
{
sh->root.type = bfd_link_hash_defined;
sh->root.u.def.section = htab->glink;
sh->root.u.def.value = ent->glink_offset;
sh->ref_regular = 1;
sh->def_regular = 1;
sh->ref_regular_nonweak = 1;
sh->forced_local = 1;
sh->non_elf = 0;
}
return TRUE;
}
/* Allocate NEED contiguous space in .got, and return the offset.
Handles allocation of the got header when crossing 32k. */
@ -4214,31 +4273,32 @@ static bfd_vma
allocate_got (struct ppc_elf_link_hash_table *htab, unsigned int need)
{
bfd_vma where;
unsigned int max_before_header = 32768;
unsigned int max_before_header;
if (htab->old_plt)
max_before_header = 32764;
if (htab->is_vxworks)
if (htab->plt_type == PLT_VXWORKS)
{
where = htab->got->size;
htab->got->size += need;
}
else if (need <= htab->got_gap)
{
where = max_before_header - htab->got_gap;
htab->got_gap -= need;
}
else
{
if (htab->got->size + need > max_before_header
&& htab->got->size <= max_before_header)
max_before_header = htab->plt_type == PLT_NEW ? 32768 : 32764;
if (need <= htab->got_gap)
{
htab->got_gap = max_before_header - htab->got->size;
htab->got->size = max_before_header + htab->got_header_size;
where = max_before_header - htab->got_gap;
htab->got_gap -= need;
}
else
{
if (htab->got->size + need > max_before_header
&& htab->got->size <= max_before_header)
{
htab->got_gap = max_before_header - htab->got->size;
htab->got->size = max_before_header + htab->got_header_size;
}
where = htab->got->size;
htab->got->size += need;
}
where = htab->got->size;
htab->got->size += need;
}
return where;
}
@ -4285,7 +4345,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
asection *s = htab->plt;
if (!(htab->old_plt || htab->is_vxworks))
if (htab->plt_type == PLT_NEW)
{
if (!doneone)
{
@ -4308,6 +4368,10 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
h->root.u.def.value = glink_offset;
}
ent->glink_offset = glink_offset;
if (htab->emit_stub_syms
&& !add_stub_sym (ent, h, info))
return FALSE;
}
else
{
@ -4345,7 +4409,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
s->size += htab->plt_entry_size;
/* After the 8192nd entry, room for two entries
is allocated. */
if (!htab->is_vxworks
if (htab->plt_type == PLT_OLD
&& (s->size - htab->plt_initial_entry_size)
/ htab->plt_entry_size
> PLT_NUM_SINGLE_ENTRIES)
@ -4359,7 +4423,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
htab->relplt->size += sizeof (Elf32_External_Rela);
if (htab->is_vxworks)
if (htab->plt_type == PLT_VXWORKS)
{
/* Allocate space for the unloaded relocations. */
if (!info->shared)
@ -4484,20 +4548,20 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic symbol
in PIEs. */
if (info->pie
&& eh->dyn_relocs != NULL
&& h->dynindx == -1
&& h->root.type == bfd_link_hash_undefweak
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
else if (h->dynindx == -1
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
}
}
else if (ELIMINATE_COPY_RELOCS)
@ -4600,9 +4664,9 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
}
}
if (htab->old_plt)
if (htab->plt_type == PLT_OLD)
htab->got_header_size = 16;
else
else if (htab->plt_type == PLT_NEW)
htab->got_header_size = 12;
/* Set up .got offsets for local syms, and space for local dynamic
@ -4698,29 +4762,10 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
else
htab->tlsld_got.offset = (bfd_vma) -1;
if (htab->is_vxworks)
{
/* Save the PLT symbol in the hash table for easy access.
Mark GOT and PLT syms as having relocations; they might not,
but we won't know for sure until we build the GOT in
finish_dynamic_symbol. */
if (htab->elf.hgot)
htab->elf.hgot->indx = -2;
htab->hplt = elf_link_hash_lookup (elf_hash_table (info),
"_PROCEDURE_LINKAGE_TABLE_",
FALSE, FALSE, FALSE);
if (htab->hplt)
htab->hplt->indx = -2;
/* If the PLT is executable then give the symbol function type. */
if (htab->hplt && htab->plt->flags & SEC_CODE)
htab->hplt->type = STT_FUNC;
}
/* Allocate space for global sym dynamic relocs. */
elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, info);
if (htab->got != NULL && !htab->is_vxworks)
if (htab->got != NULL && htab->plt_type != PLT_VXWORKS)
{
unsigned int g_o_t = 32768;
@ -4731,7 +4776,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->got->size <= 32768)
{
g_o_t = htab->got->size;
if (htab->old_plt)
if (htab->plt_type == PLT_OLD)
g_o_t += 4;
htab->got->size += htab->got_header_size;
}
@ -4747,6 +4792,41 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Pad out to align the start of PLTresolve. */
htab->glink->size += -htab->glink->size & 15;
htab->glink->size += GLINK_PLTRESOLVE;
if (htab->emit_stub_syms)
{
struct elf_link_hash_entry *sh;
sh = elf_link_hash_lookup (&htab->elf, "__glink",
TRUE, FALSE, FALSE);
if (sh == NULL)
return FALSE;
if (sh->root.type == bfd_link_hash_new)
{
sh->root.type = bfd_link_hash_defined;
sh->root.u.def.section = htab->glink;
sh->root.u.def.value = htab->glink_pltresolve;
sh->ref_regular = 1;
sh->def_regular = 1;
sh->ref_regular_nonweak = 1;
sh->forced_local = 1;
sh->non_elf = 0;
}
sh = elf_link_hash_lookup (&htab->elf, "__glink_PLTresolve",
TRUE, FALSE, FALSE);
if (sh == NULL)
return FALSE;
if (sh->root.type == bfd_link_hash_new)
{
sh->root.type = bfd_link_hash_defined;
sh->root.u.def.section = htab->glink;
sh->root.u.def.value = htab->glink->size - GLINK_PLTRESOLVE;
sh->ref_regular = 1;
sh->def_regular = 1;
sh->ref_regular_nonweak = 1;
sh->forced_local = 1;
sh->non_elf = 0;
}
}
}
/* We've now determined the sizes of the various dynamic sections.
@ -4770,7 +4850,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* We'd like to strip these sections if they aren't needed, but if
we've exported dynamic symbols from them we must leave them.
It's too late to tell BFD to get rid of the symbols. */
if ((s == htab->plt || s == htab->got) && htab->hplt != NULL)
if ((s == htab->plt || s == htab->got) && htab->elf.hplt != NULL)
strip_section = FALSE;
/* Strip this section if we don't need it; see the
comment below. */
@ -5032,7 +5112,7 @@ ppc_elf_relax_section (bfd *abfd,
if (ent != NULL)
{
if (!htab->old_plt)
if (htab->plt_type == PLT_NEW)
{
tsec = htab->glink;
toff = ent->glink_offset;
@ -5688,6 +5768,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
insn1 |= 32 << 26; /* lwz */
insn2 = 0x7c631214; /* add 3,3,2 */
rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE);
rel[1].r_addend = 0;
r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3)
+ R_PPC_GOT_TPREL16);
rel->r_info = ELF32_R_INFO (r_symndx, r_type);
@ -5702,13 +5783,13 @@ ppc_elf_relocate_section (bfd *output_bfd,
/* Was an LD reloc. */
r_symndx = 0;
rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
rel[1].r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
}
r_type = R_PPC_TPREL16_HA;
rel->r_info = ELF32_R_INFO (r_symndx, r_type);
rel[1].r_info = ELF32_R_INFO (r_symndx,
R_PPC_TPREL16_LO);
rel[1].r_offset += 2;
rel[1].r_addend = rel->r_addend;
}
bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
bfd_put_32 (output_bfd, insn2, contents + offset);
@ -6212,7 +6293,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
BFD_ASSERT (indx > 0);
#ifdef DEBUG
if (indx <= 0)
printf ("indx=%d section=%s flags=%08x name=%s\n",
printf ("indx=%ld section=%s flags=%08x name=%s\n",
indx, osec->name, osec->flags,
h->root.root.string);
#endif
@ -6247,7 +6328,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
{
struct plt_entry *ent = find_plt_ent (h, got2, addend);
if (!htab->old_plt)
if (htab->plt_type == PLT_NEW)
relocation = (htab->glink->output_section->vma
+ htab->glink->output_offset
+ ent->glink_offset);
@ -6337,7 +6418,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
unresolved_reloc = FALSE;
if (!htab->old_plt)
if (htab->plt_type == PLT_NEW)
relocation = (htab->glink->output_section->vma
+ htab->glink->output_offset
+ ent->glink_offset);
@ -6657,20 +6738,20 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
bfd_byte *loc;
bfd_vma reloc_index;
if (!(htab->old_plt || htab->is_vxworks))
if (htab->plt_type == PLT_NEW)
reloc_index = ent->plt.offset / 4;
else
{
reloc_index = ((ent->plt.offset - htab->plt_initial_entry_size)
/ htab->plt_slot_size);
if (reloc_index > PLT_NUM_SINGLE_ENTRIES
&& !htab->is_vxworks)
&& htab->plt_type == PLT_OLD)
reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2;
}
/* This symbol has an entry in the procedure linkage table.
Set it up. */
if (htab->is_vxworks)
if (htab->plt_type == PLT_VXWORKS)
{
bfd_vma got_offset;
const bfd_vma *plt_entry;
@ -6783,7 +6864,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
rela.r_offset = (htab->sgotplt->output_section->vma
+ htab->sgotplt->output_offset
+ got_offset);
rela.r_info = ELF32_R_INFO (htab->hplt->indx,
rela.r_info = ELF32_R_INFO (htab->elf.hplt->indx,
R_PPC_ADDR32);
rela.r_addend = ent->plt.offset + 16;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
@ -6804,7 +6885,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
rela.r_offset = (htab->plt->output_section->vma
+ htab->plt->output_offset
+ ent->plt.offset);
if (htab->old_plt)
if (htab->plt_type == PLT_OLD)
{
/* We don't need to fill in the .plt. The ppc dynamic
linker will fill it in. */
@ -6842,7 +6923,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
doneone = TRUE;
}
if (!htab->old_plt)
if (htab->plt_type == PLT_NEW)
{
bfd_vma plt;
unsigned char *p;
@ -7064,7 +7145,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
bfd_vma val;
p += htab->elf.hgot->root.u.def.value;
if (htab->old_plt && !htab->is_vxworks)
if (htab->plt_type == PLT_OLD)
bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, p - 4);
val = 0;
@ -7151,7 +7232,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
loc += sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
rel.r_info = ELF32_R_INFO (htab->hplt->indx, R_PPC_ADDR32);
rel.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_PPC_ADDR32);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
loc += sizeof (Elf32_External_Rela);
}
@ -7436,6 +7517,7 @@ ppc_elf_vxworks_link_hash_table_create (bfd *abfd)
struct ppc_elf_link_hash_table *htab
= (struct ppc_elf_link_hash_table *)ret;
htab->is_vxworks = 1;
htab->plt_type = PLT_VXWORKS;
htab->plt_entry_size = VXWORKS_PLT_ENTRY_SIZE;
htab->plt_slot_size = VXWORKS_PLT_ENTRY_SIZE;
htab->plt_initial_entry_size = VXWORKS_PLT_INITIAL_ENTRY_SIZE;
@ -7460,23 +7542,6 @@ ppc_elf_vxworks_add_symbol_hook (bfd *abfd,
return ppc_elf_add_symbol_hook(abfd, info, sym,namep, flagsp, secp, valp);
}
/* Tweak magic VxWorks symbols as they are written to the output file. */
static bfd_boolean
elf_i386_vxworks_link_output_symbol_hook (struct bfd_link_info *info
ATTRIBUTE_UNUSED,
const char *name,
Elf_Internal_Sym *sym,
asection *input_sec ATTRIBUTE_UNUSED,
struct elf_link_hash_entry *h
ATTRIBUTE_UNUSED)
{
/* Ignore the first dummy symbol. */
if (!name)
return TRUE;
return elf_vxworks_link_output_symbol_hook (name, sym);
}
static void
ppc_elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
@ -7507,7 +7572,7 @@ ppc_elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
ppc_elf_vxworks_add_symbol_hook
#undef elf_backend_link_output_symbol_hook
#define elf_backend_link_output_symbol_hook \
elf_i386_vxworks_link_output_symbol_hook
elf_vxworks_link_output_symbol_hook
#undef elf_backend_final_write_processing
#define elf_backend_final_write_processing \
ppc_elf_vxworks_final_write_processing

View File

@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, int);
int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, int, int);
asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *);
bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *);
void ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *);

View File

@ -1,5 +1,5 @@
/* IBM S/390-specific support for 32-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
@ -771,7 +771,8 @@ elf_s390_link_hash_table_create (abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
sizeof (struct elf_s390_link_hash_entry)))
{
free (ret);
return NULL;
@ -1908,9 +1909,21 @@ allocate_dynrelocs (h, inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
eh->dyn_relocs = NULL;
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
else if (h->dynindx == -1
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
}
}
else if (ELIMINATE_COPY_RELOCS)
{
@ -2255,6 +2268,7 @@ invalid_tls_insn (input_bfd, input_section, rel)
input_section,
(long) rel->r_offset,
howto->name);
bfd_set_error (bfd_error_bad_value);
}
/* Relocate a 390 ELF section. */
@ -2969,16 +2983,44 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
unsigned int insn;
insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
if ((insn & 0xff000fff) != 0x4d000000)
if ((insn & 0xff000fff) != 0x4d000000 &&
(insn & 0xffff0000) != 0xc0e50000)
invalid_tls_insn (input_bfd, input_section, rel);
if (!info->shared && (h == NULL || h->dynindx == -1))
/* GD->LE transition.
bas %r14,0(%rx,%r13) -> bc 0,0 */
insn = 0x47000000;
{
if ((insn & 0xff000000) == 0x4d000000)
{
/* GD->LE transition.
bas %r14,0(%rx,%r13) -> bc 0,0 */
insn = 0x47000000;
}
else
{
/* GD->LE transition.
brasl %r14,_tls_get_addr@plt -> brcl 0,. */
insn = 0xc0040000;
bfd_put_16 (output_bfd, 0x0000,
contents + rel->r_offset + 4);
}
}
else
/* GD->IE transition.
bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */
insn = 0x5822c000;
{
if ((insn & 0xff000000) == 0x4d000000)
{
/* GD->IE transition.
bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */
insn = 0x5822c000;
}
else
{
/* GD->IE transition.
brasl %r14,__tls_get_addr@plt ->
l %r2,0(%r2,%r12) ; bcr 0,0 */
insn = 0x5822c000;
bfd_put_16 (output_bfd, 0x0700,
contents + rel->r_offset + 4);
}
}
bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
}
else if (r_type == R_390_TLS_LDCALL)
@ -2988,11 +3030,23 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
unsigned int insn;
insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
if ((insn & 0xff000fff) != 0x4d000000)
if ((insn & 0xff000fff) != 0x4d000000 &&
(insn & 0xffff0000) != 0xc0e50000)
invalid_tls_insn (input_bfd, input_section, rel);
/* LD->LE transition.
bas %r14,0(%rx,%r13) -> bc 0,0 */
insn = 0x47000000;
if ((insn & 0xff000000) == 0x4d000000)
{
/* LD->LE transition.
bas %r14,0(%rx,%r13) -> bc 0,0 */
insn = 0x47000000;
}
else
{
/* LD->LE transition.
brasl %r14,__tls_get_addr@plt -> brcl 0,. */
insn = 0xc0040000;
bfd_put_16 (output_bfd, 0x0000,
contents + rel->r_offset + 4);
}
bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
}
}
@ -3297,8 +3351,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark some specially defined symbols as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
|| strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
|| h == htab->elf.hgot
|| h == htab->elf.hplt)
sym->st_shndx = SHN_ABS;
return TRUE;

View File

@ -26,8 +26,8 @@
#include "elf32-sh.c"
//#define DEBUG 1
#define DEBUG 0
//#define SYMBIAN_DEBUG 1
#define SYMBIAN_DEBUG 0
#define DIRECTIVE_HEADER "#<SYMEDIT>#\n"
#define DIRECTIVE_IMPORT "IMPORT "
@ -36,7 +36,7 @@
/* Macro to advance 's' until either it reaches 'e' or the
character pointed to by 's' is equal to 'c'. If 'e' is
reached and DEBUG is enabled then the error message 'm'
reached and SYMBIAN_DEBUG is enabled then the error message 'm'
is displayed. */
#define SKIP_UNTIL(s,e,c,m) \
do \
@ -45,7 +45,7 @@
++ s; \
if (s >= e) \
{ \
if (DEBUG) \
if (SYMBIAN_DEBUG) \
fprintf (stderr, "Corrupt directive: %s\n", m); \
result = FALSE; \
} \
@ -63,7 +63,7 @@
++ s; \
if (s >= e) \
{ \
if (DEBUG) \
if (SYMBIAN_DEBUG) \
fprintf (stderr, "Corrupt directive: %s\n", m); \
result = FALSE; \
} \
@ -74,7 +74,7 @@
/* Macro to advance 's' until either it reaches 'e' or the
character pointed to by 's' is not equal to 'c'. If 'e'
is reached and DEBUG is enabled then the error message
is reached and SYMBIAN_DEBUG is enabled then the error message
'm' is displayed. */
#define SKIP_WHILE(s,e,c,m) \
do \
@ -83,7 +83,7 @@
++ s; \
if (s >= e) \
{ \
if (DEBUG) \
if (SYMBIAN_DEBUG) \
fprintf (stderr, "Corrupt directive: %s\n", m); \
result = FALSE; \
} \
@ -114,7 +114,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
struct elf_link_hash_entry * new_hash;
symbol_rename * node;
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT '%s' AS '%s'\n", current_name, new_name);
for (node = rename_list; node; node = node->next)
@ -132,14 +132,14 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
if ((node = bfd_malloc (sizeof * node)) == NULL)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT AS: No mem for new rename node\n");
return FALSE;
}
if ((node->current_name = bfd_malloc (strlen (current_name) + 1)) == NULL)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT AS: No mem for current name field in rename node\n");
free (node);
return FALSE;
@ -149,7 +149,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
if ((node->new_name = bfd_malloc (strlen (new_name) + 1)) == NULL)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT AS: No mem for new name field in rename node\n");
free (node->current_name);
free (node);
@ -175,7 +175,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
static bfd_boolean
sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT '%s'\n", name);
/* XXX: Generate an import somehow ? */
@ -186,7 +186,7 @@ sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name)
static bfd_boolean
sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, char * name)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "EXPORT '%s'\n", name);
/* XXX: Generate an export somehow ? */
@ -266,7 +266,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
if (strncmp (s, DIRECTIVE_AS, strlen (DIRECTIVE_AS)))
{
/* Skip the new-line at the end of the name. */
if (DEBUG && name_end_char != '\n')
if (SYMBIAN_DEBUG && name_end_char != '\n')
fprintf (stderr, "IMPORT: No newline at end of directive\n");
else
s ++;
@ -276,7 +276,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
/* Skip past the NUL character. */
if (* s ++ != 0)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT: No NUL at end of directive\n");
}
}
@ -300,7 +300,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
SKIP_WHILE (s, e, ' ', "IMPORT AS: Current name just followed by spaces");
/* Skip past the newline character. */
if (* s ++ != '\n')
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT AS: No newline at end of directive\n");
/* Terminate the current name after having performed the skips. */
@ -311,7 +311,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
/* The next character should be a NUL. */
if (* s != 0)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT AS: Junk at end of directive\n");
result = FALSE;
}
@ -355,7 +355,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
/* The next character should be a NUL. */
if (* s != 0)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "EXPORT: Junk at end of directive\n");
result = FALSE;
}
@ -373,7 +373,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
if (! result)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "offset into .directive section: %ld\n",
(long) (directive - (char *) contents));
@ -464,7 +464,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
if (ptr->current_hash == NULL)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "IMPORT AS: current symbol '%s' does not exist\n", ptr->current_name);
continue;
}
@ -511,7 +511,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
if (new_hash->dynindx == -1)
new_hash->def_regular = 1;
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "Created new symbol %s\n", ptr->new_name);
}
@ -521,7 +521,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
if (* h == new_hash)
{
ptr->new_symndx = h - sym_hashes + num_local_syms;
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "Converted new hash to index of %ld\n", ptr->new_symndx);
break;
}
@ -539,7 +539,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
new_sym_hashes = bfd_alloc (input_bfd, num_global_syms * sizeof * sym_hashes);
if (new_sym_hashes == NULL)
{
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "Out of memory extending hash table\n");
continue;
}
@ -551,7 +551,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
ptr->new_symndx = num_global_syms - 1 + num_local_syms;
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "Extended symbol hash table to insert new symbol as index %ld\n",
ptr->new_symndx);
}
@ -601,7 +601,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
if (h == ptr->current_hash)
{
BFD_ASSERT (ptr->new_symndx);
if (DEBUG)
if (SYMBIAN_DEBUG)
fprintf (stderr, "convert reloc %lx from using index %ld to using index %ld\n",
(long) rel->r_info, (long) ELF32_R_SYM (rel->r_info), ptr->new_symndx);
rel->r_info = ELF32_R_INFO (ptr->new_symndx, r_type);

View File

@ -1,6 +1,6 @@
/* Renesas / SuperH SH specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -3612,8 +3612,9 @@ sh_elf_link_hash_table_create (bfd *abfd)
if (ret == (struct elf_sh_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
sh_elf_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
sh_elf_link_hash_newfunc,
sizeof (struct elf_sh_link_hash_entry)))
{
free (ret);
return NULL;
@ -3726,6 +3727,7 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->type = STT_OBJECT;
htab->root.hplt = h;
if (info->shared
&& ! bfd_elf_link_record_dynamic_symbol (info, h))
@ -4160,9 +4162,21 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
eh->dyn_relocs = NULL;
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
else if (h->dynindx == -1
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
}
}
else
{
@ -4693,7 +4707,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|| !h->def_regular)
&& ((r_type == R_SH_DIR32
&& !h->forced_local)
|| r_type == R_SH_REL32)
|| (r_type == R_SH_REL32
&& !SYMBOL_CALLS_LOCAL (info, h)))
&& ((input_section->flags & SEC_ALLOC) != 0
/* DWARF will emit R_SH_DIR32 relocations in its
sections against symbols defined externally
@ -7022,7 +7037,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == htab->root.hgot)
sym->st_shndx = SHN_ABS;
return TRUE;

View File

@ -1,5 +1,5 @@
/* SuperH SH64-specific support for 32-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -115,13 +115,16 @@ static void sh64_find_section_for_address
static bfd_boolean
sh64_elf_new_section_hook (bfd *abfd, asection *sec)
{
struct _sh64_elf_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
if (!sec->used_by_bfd)
{
struct _sh64_elf_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
sdata = (struct _sh64_elf_section_data *) bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
sdata = bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
}
return _bfd_elf_new_section_hook (abfd, sec);
}

View File

@ -26,6 +26,7 @@
#include "elf/sparc.h"
#include "opcode/sparc.h"
#include "elfxx-sparc.h"
#include "elf-vxworks.h"
/* Support for core dump NOTE sections. */
@ -215,3 +216,68 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
#define elf_backend_rela_normal 1
#include "elf32-target.h"
/* A wrapper around _bfd_sparc_elf_link_hash_table_create that identifies
the target system as VxWorks. */
static struct bfd_link_hash_table *
elf32_sparc_vxworks_link_hash_table_create (bfd *abfd)
{
struct bfd_link_hash_table *ret;
ret = _bfd_sparc_elf_link_hash_table_create (abfd);
if (ret)
{
struct _bfd_sparc_elf_link_hash_table *htab;
htab = (struct _bfd_sparc_elf_link_hash_table *) ret;
htab->is_vxworks = 1;
}
return ret;
}
/* A final_write_processing hook that does both the SPARC- and VxWorks-
specific handling. */
static void
elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
elf32_sparc_final_write_processing (abfd, linker);
elf_vxworks_final_write_processing (abfd, linker);
}
#undef TARGET_BIG_SYM
#define TARGET_BIG_SYM bfd_elf32_sparc_vxworks_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sparc-vxworks"
#undef ELF_MINPAGESIZE
#define ELF_MINPAGESIZE 0x1000
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
elf32_sparc_vxworks_link_hash_table_create
#undef elf_backend_want_got_plt
#define elf_backend_want_got_plt 1
#undef elf_backend_plt_readonly
#define elf_backend_plt_readonly 1
#undef elf_backend_got_header_size
#define elf_backend_got_header_size 12
#undef elf_backend_add_symbol_hook
#define elf_backend_add_symbol_hook \
elf_vxworks_add_symbol_hook
#undef elf_backend_link_output_symbol_hook
#define elf_backend_link_output_symbol_hook \
elf_vxworks_link_output_symbol_hook
#undef elf_backend_emit_relocs
#define elf_backend_emit_relocs \
elf_vxworks_emit_relocs
#undef elf_backend_final_write_processing
#define elf_backend_final_write_processing \
elf32_sparc_vxworks_final_write_processing
#undef elf32_bed
#define elf32_bed sparc_elf_vxworks_bed
#include "elf32-target.h"

View File

@ -1,6 +1,6 @@
/* V850-specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -33,6 +33,8 @@
/* Sign-extend a 24-bit number. */
#define SEXT24(x) ((((x) & 0xffffff) ^ 0x800000) - 0x800000)
static reloc_howto_type v850_elf_howto_table[];
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
table. */

View File

@ -1,6 +1,6 @@
/* VAX series support for 32-bit ELF
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Matt Thomas <matt@3am-software.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -468,8 +468,9 @@ elf_vax_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_vax_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_vax_link_hash_newfunc,
sizeof (struct elf_vax_link_hash_entry)))
{
free (ret);
return NULL;
@ -1954,7 +1955,7 @@ elf_vax_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot)
sym->st_shndx = SHN_ABS;
return TRUE;

449
gnu/dist/gdb6/bfd/elf32-xc16x.c vendored Normal file
View File

@ -0,0 +1,449 @@
/* Infineon XC16X-specific support for 16-bit ELF.
Copyright 2006 Free Software Foundation, Inc.
Contributed by KPIT Cummins Infosystems
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/xc16x.h"
#include "elf/dwarf2.h"
#include "libiberty.h"
static reloc_howto_type xc16x_elf_howto_table [] =
{
/* This reloc does nothing. */
HOWTO (R_XC16X_NONE, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_NONE", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
FALSE), /* pcrel_offset */
/* An 8 bit absolute relocation. */
HOWTO (R_XC16X_ABS_8, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
FALSE, /* pc_relative */
8, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_ABS_8", /* name */
TRUE, /* partial_inplace */
0x0000, /* src_mask */
0x00ff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 16 bit absolute relocation. */
HOWTO (R_XC16X_ABS_16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_ABS_16", /* name */
TRUE, /* partial_inplace */
0x00000000, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
HOWTO (R_XC16X_ABS_32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_ABS_32", /* name */
TRUE, /* partial_inplace */
0x00000000, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A PC relative 8 bit relocation. */
HOWTO (R_XC16X_8_PCREL, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
TRUE, /* pc_relative */
8, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_8_PCREL", /* name */
FALSE, /* partial_inplace */
0x0000, /* src_mask */
0x00ff, /* dst_mask */
TRUE), /* pcrel_offset */
/* Relocation regarding page number. */
HOWTO (R_XC16X_PAG, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_PAG", /* name */
TRUE, /* partial_inplace */
0x00000000, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* Relocation regarding page number. */
HOWTO (R_XC16X_POF, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_POF", /* name */
TRUE, /* partial_inplace */
0x00000000, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* Relocation regarding segment number. */
HOWTO (R_XC16X_SEG, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_SEG", /* name */
TRUE, /* partial_inplace */
0x00000000, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* Relocation regarding segment offset. */
HOWTO (R_XC16X_SOF, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XC16X_SOF", /* name */
TRUE, /* partial_inplace */
0x00000000, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE) /* pcrel_offset */
};
/* Map BFD reloc types to XC16X ELF reloc types. */
struct xc16x_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
unsigned int xc16x_reloc_val;
};
static const struct xc16x_reloc_map xc16x_reloc_map [] =
{
{ BFD_RELOC_NONE, R_XC16X_NONE },
{ BFD_RELOC_8, R_XC16X_ABS_8 },
{ BFD_RELOC_16, R_XC16X_ABS_16 },
{ BFD_RELOC_32, R_XC16X_ABS_32 },
{ BFD_RELOC_8_PCREL, R_XC16X_8_PCREL },
{ BFD_RELOC_XC16X_PAG, R_XC16X_PAG},
{ BFD_RELOC_XC16X_POF, R_XC16X_POF},
{ BFD_RELOC_XC16X_SEG, R_XC16X_SEG},
{ BFD_RELOC_XC16X_SOF, R_XC16X_SOF},
};
/* This function is used to search for correct relocation type from
howto structure. */
static reloc_howto_type *
xc16x_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
unsigned int i;
for (i = ARRAY_SIZE (xc16x_reloc_map); --i;)
if (xc16x_reloc_map [i].bfd_reloc_val == code)
return & xc16x_elf_howto_table [xc16x_reloc_map[i].xc16x_reloc_val];
return NULL;
}
/* For a particular operand this function is
called to finalise the type of relocation. */
static void
elf32_xc16x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc,
Elf_Internal_Rela *elf_reloc)
{
unsigned int r;
unsigned int i;
r = ELF32_R_TYPE (elf_reloc->r_info);
for (i = 0; i < ARRAY_SIZE (xc16x_elf_howto_table); i++)
if (xc16x_elf_howto_table[i].type == r)
{
bfd_reloc->howto = &xc16x_elf_howto_table[i];
return;
}
abort ();
}
static bfd_reloc_status_type
elf32_xc16x_final_link_relocate (unsigned long r_type,
bfd *input_bfd,
bfd *output_bfd ATTRIBUTE_UNUSED,
asection *input_section ATTRIBUTE_UNUSED,
bfd_byte *contents,
bfd_vma offset,
bfd_vma value,
bfd_vma addend,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
asection *sym_sec ATTRIBUTE_UNUSED,
int is_local ATTRIBUTE_UNUSED)
{
bfd_byte *hit_data = contents + offset;
bfd_vma val1;
switch (r_type)
{
case R_XC16X_NONE:
return bfd_reloc_ok;
case R_XC16X_ABS_16:
value += addend;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
case R_XC16X_8_PCREL:
bfd_put_8 (input_bfd, value, hit_data);
return bfd_reloc_ok;
/* Following case is to find page number from actual
address for this divide value by 16k i.e. page size. */
case R_XC16X_PAG:
value += addend;
value /= 0x4000;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
/* Following case is to find page offset from actual address
for this take modulo of value by 16k i.e. page size. */
case R_XC16X_POF:
value += addend;
value %= 0x4000;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
/* Following case is to find segment number from actual
address for this divide value by 64k i.e. segment size. */
case R_XC16X_SEG:
value += addend;
value /= 0x10000;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
/* Following case is to find segment offset from actual address
for this take modulo of value by 64k i.e. segment size. */
case R_XC16X_SOF:
value += addend;
value %= 0x10000;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
case R_XC16X_ABS_32:
if (!strstr (input_section->name,".debug"))
{
value += addend;
val1 = value;
value %= 0x4000;
val1 /= 0x4000;
val1 = val1 << 16;
value += val1;
bfd_put_32 (input_bfd, value, hit_data);
}
else
{
value += addend;
bfd_put_32 (input_bfd, value, hit_data);
}
return bfd_reloc_ok;
default:
return bfd_reloc_notsupported;
}
}
static bfd_boolean
elf32_xc16x_relocate_section (bfd *output_bfd,
struct bfd_link_info *info,
bfd *input_bfd,
asection *input_section,
bfd_byte *contents,
Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms,
asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
Elf_Internal_Rela *rel, *relend;
if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
rel = relocs;
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
{
unsigned int r_type;
unsigned long r_symndx;
Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
bfd_reloc_status_type r;
/* This is a final link. */
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
h = NULL;
sym = NULL;
sec = NULL;
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
}
else
{
bfd_boolean unresolved_reloc, warned;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
unresolved_reloc, warned);
}
r = elf32_xc16x_final_link_relocate (r_type, input_bfd, output_bfd,
input_section,
contents, rel->r_offset,
relocation, rel->r_addend,
info, sec, h == NULL);
}
return TRUE;
}
static void
elf32_xc16x_final_write_processing (bfd *abfd,
bfd_boolean linker ATTRIBUTE_UNUSED)
{
unsigned long val;
switch (bfd_get_mach (abfd))
{
default:
case bfd_mach_xc16x:
val = 0x1000;
break;
case bfd_mach_xc16xl:
val = 0x1001;
break;
case bfd_mach_xc16xs:
val = 0x1002;
break;
}
elf_elfheader (abfd)->e_flags |= val;
}
static unsigned long
elf32_xc16x_mach (flagword flags)
{
switch (flags)
{
case 0x1000:
default:
return bfd_mach_xc16x;
case 0x1001:
return bfd_mach_xc16xl;
case 0x1002:
return bfd_mach_xc16xs;
}
}
static bfd_boolean
elf32_xc16x_object_p (bfd *abfd)
{
bfd_default_set_arch_mach (abfd, bfd_arch_xc16x,
elf32_xc16x_mach (elf_elfheader (abfd)->e_flags));
return TRUE;
}
#define ELF_ARCH bfd_arch_xc16x
#define ELF_MACHINE_CODE EM_XC16X
#define ELF_MAXPAGESIZE 0x100
#define TARGET_LITTLE_SYM bfd_elf32_xc16x_vec
#define TARGET_LITTLE_NAME "elf32-xc16x"
#define elf_backend_final_write_processing elf32_xc16x_final_write_processing
#define elf_backend_object_p elf32_xc16x_object_p
#define elf_backend_can_gc_sections 1
#define bfd_elf32_bfd_reloc_type_lookup xc16x_reloc_type_lookup
#define elf_info_to_howto elf32_xc16x_info_to_howto
#define elf_info_to_howto_rel elf32_xc16x_info_to_howto
#define elf_backend_relocate_section elf32_xc16x_relocate_section
#define elf_backend_rela_normal 1
#include "elf32-target.h"

View File

@ -1,5 +1,5 @@
/* Xtensa-specific support for 32-bit ELF.
Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -640,7 +640,6 @@ xtensa_read_table_entries (bfd *abfd,
{
bfd_vma sym_off = get_elf_r_symndx_offset (abfd, r_symndx);
BFD_ASSERT (sym_off == 0);
BFD_ASSERT (rel->r_addend == 0);
blocks[block_count].address =
(section_addr + sym_off + rel->r_addend
+ bfd_get_32 (abfd, table_data + rel->r_offset));
@ -2384,7 +2383,7 @@ elf_xtensa_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot)
sym->st_shndx = SHN_ABS;
return TRUE;
@ -4756,6 +4755,19 @@ offset_with_removed_text (text_action_list *action_list, bfd_vma offset)
}
static unsigned
action_list_count (text_action_list *action_list)
{
text_action *r = action_list->head;
unsigned count = 0;
for (r = action_list->head; r != NULL; r = r->next)
{
count++;
}
return count;
}
static bfd_vma
offset_with_removed_text_before_fill (text_action_list *action_list,
bfd_vma offset)
@ -4995,13 +5007,16 @@ struct elf_xtensa_section_data
static bfd_boolean
elf_xtensa_new_section_hook (bfd *abfd, asection *sec)
{
struct elf_xtensa_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
if (!sec->used_by_bfd)
{
struct elf_xtensa_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
sdata = (struct elf_xtensa_section_data *) bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = (void *) sdata;
sdata = bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
}
return _bfd_elf_new_section_hook (abfd, sec);
}
@ -5754,7 +5769,8 @@ static bfd_boolean compute_text_actions
static bfd_boolean compute_ebb_proposed_actions (ebb_constraint *);
static bfd_boolean compute_ebb_actions (ebb_constraint *);
static bfd_boolean check_section_ebb_pcrels_fit
(bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *);
(bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *,
const xtensa_opcode *);
static bfd_boolean check_section_ebb_reduces (const ebb_constraint *);
static void text_action_add_proposed
(text_action_list *, const ebb_constraint *, asection *);
@ -6290,6 +6306,24 @@ find_associated_l32r_irel (bfd *abfd,
}
static xtensa_opcode *
build_reloc_opcodes (bfd *abfd,
asection *sec,
bfd_byte *contents,
Elf_Internal_Rela *internal_relocs)
{
unsigned i;
xtensa_opcode *reloc_opcodes =
(xtensa_opcode *) bfd_malloc (sizeof (xtensa_opcode) * sec->reloc_count);
for (i = 0; i < sec->reloc_count; i++)
{
Elf_Internal_Rela *irel = &internal_relocs[i];
reloc_opcodes[i] = get_relocation_opcode (abfd, sec, contents, irel);
}
return reloc_opcodes;
}
/* The compute_text_actions function will build a list of potential
transformation actions for code in the extended basic block of each
longcall that is optimized to a direct call. From this list we
@ -6306,6 +6340,7 @@ compute_text_actions (bfd *abfd,
asection *sec,
struct bfd_link_info *link_info)
{
xtensa_opcode *reloc_opcodes = NULL;
xtensa_relax_info *relax_info;
bfd_byte *contents;
Elf_Internal_Rela *internal_relocs;
@ -6411,11 +6446,17 @@ compute_text_actions (bfd *abfd,
ebb->start_reloc_idx = i;
ebb->end_reloc_idx = i;
/* Precompute the opcode for each relocation. */
if (reloc_opcodes == NULL)
reloc_opcodes = build_reloc_opcodes (abfd, sec, contents,
internal_relocs);
if (!extend_ebb_bounds (ebb)
|| !compute_ebb_proposed_actions (&ebb_table)
|| !compute_ebb_actions (&ebb_table)
|| !check_section_ebb_pcrels_fit (abfd, sec, contents,
internal_relocs, &ebb_table)
internal_relocs, &ebb_table,
reloc_opcodes)
|| !check_section_ebb_reduces (&ebb_table))
{
/* If anything goes wrong or we get unlucky and something does
@ -6447,6 +6488,8 @@ error_return:
release_internal_relocs (sec, internal_relocs);
if (prop_table)
free (prop_table);
if (reloc_opcodes)
free (reloc_opcodes);
return ok;
}
@ -6851,6 +6894,160 @@ compute_ebb_actions (ebb_constraint *ebb_table)
}
/* The xlate_map is a sorted array of address mappings designed to
answer the offset_with_removed_text() query with a binary search instead
of a linear search through the section's action_list. */
typedef struct xlate_map_entry xlate_map_entry_t;
typedef struct xlate_map xlate_map_t;
struct xlate_map_entry
{
unsigned orig_address;
unsigned new_address;
unsigned size;
};
struct xlate_map
{
unsigned entry_count;
xlate_map_entry_t *entry;
};
static int
xlate_compare (const void *a_v, const void *b_v)
{
const xlate_map_entry_t *a = (const xlate_map_entry_t *) a_v;
const xlate_map_entry_t *b = (const xlate_map_entry_t *) b_v;
if (a->orig_address < b->orig_address)
return -1;
if (a->orig_address > (b->orig_address + b->size - 1))
return 1;
return 0;
}
static bfd_vma
xlate_offset_with_removed_text (const xlate_map_t *map,
text_action_list *action_list,
bfd_vma offset)
{
xlate_map_entry_t tmp;
void *r;
xlate_map_entry_t *e;
if (map == NULL)
return offset_with_removed_text (action_list, offset);
if (map->entry_count == 0)
return offset;
tmp.orig_address = offset;
tmp.new_address = offset;
tmp.size = 1;
r = bsearch (&offset, map->entry, map->entry_count,
sizeof (xlate_map_entry_t), &xlate_compare);
e = (xlate_map_entry_t *) r;
BFD_ASSERT (e != NULL);
if (e == NULL)
return offset;
return e->new_address - e->orig_address + offset;
}
/* Build a binary searchable offset translation map from a section's
action list. */
static xlate_map_t *
build_xlate_map (asection *sec, xtensa_relax_info *relax_info)
{
xlate_map_t *map = (xlate_map_t *) bfd_malloc (sizeof (xlate_map_t));
text_action_list *action_list = &relax_info->action_list;
unsigned num_actions = 0;
text_action *r;
int removed;
xlate_map_entry_t *current_entry;
if (map == NULL)
return NULL;
num_actions = action_list_count (action_list);
map->entry = (xlate_map_entry_t *)
bfd_malloc (sizeof (xlate_map_entry_t) * (num_actions + 1));
if (map->entry == NULL)
{
free (map);
return NULL;
}
map->entry_count = 0;
removed = 0;
current_entry = &map->entry[0];
current_entry->orig_address = 0;
current_entry->new_address = 0;
current_entry->size = 0;
for (r = action_list->head; r != NULL; r = r->next)
{
unsigned orig_size = 0;
switch (r->action)
{
case ta_none:
case ta_remove_insn:
case ta_convert_longcall:
case ta_remove_literal:
case ta_add_literal:
break;
case ta_remove_longcall:
orig_size = 6;
break;
case ta_narrow_insn:
orig_size = 3;
break;
case ta_widen_insn:
orig_size = 2;
break;
case ta_fill:
break;
}
current_entry->size =
r->offset + orig_size - current_entry->orig_address;
if (current_entry->size != 0)
{
current_entry++;
map->entry_count++;
}
current_entry->orig_address = r->offset + orig_size;
removed += r->removed_bytes;
current_entry->new_address = r->offset + orig_size - removed;
current_entry->size = 0;
}
current_entry->size = (bfd_get_section_limit (sec->owner, sec)
- current_entry->orig_address);
if (current_entry->size != 0)
map->entry_count++;
return map;
}
/* Free an offset translation map. */
static void
free_xlate_map (xlate_map_t *map)
{
if (map && map->entry)
free (map->entry);
if (map)
free (map);
}
/* Use check_section_ebb_pcrels_fit to make sure that all of the
relocations in a section will fit if a proposed set of actions
are performed. */
@ -6860,14 +7057,24 @@ check_section_ebb_pcrels_fit (bfd *abfd,
asection *sec,
bfd_byte *contents,
Elf_Internal_Rela *internal_relocs,
const ebb_constraint *constraint)
const ebb_constraint *constraint,
const xtensa_opcode *reloc_opcodes)
{
unsigned i, j;
Elf_Internal_Rela *irel;
xlate_map_t *xmap = NULL;
bfd_boolean ok = TRUE;
xtensa_relax_info *relax_info;
relax_info = get_xtensa_relax_info (sec);
if (relax_info && sec->reloc_count > 100)
{
xmap = build_xlate_map (sec, relax_info);
/* NULL indicates out of memory, but the slow version
can still be used. */
}
for (i = 0; i < sec->reloc_count; i++)
{
r_reloc r_rel;
@ -6903,10 +7110,12 @@ check_section_ebb_pcrels_fit (bfd *abfd,
if (relax_info)
{
self_offset = offset_with_removed_text (&relax_info->action_list,
orig_self_offset);
target_offset = offset_with_removed_text (&relax_info->action_list,
orig_target_offset);
self_offset =
xlate_offset_with_removed_text (xmap, &relax_info->action_list,
orig_self_offset);
target_offset =
xlate_offset_with_removed_text (xmap, &relax_info->action_list,
orig_target_offset);
}
self_removed_bytes = 0;
@ -6940,20 +7149,35 @@ check_section_ebb_pcrels_fit (bfd *abfd,
xtensa_opcode opcode;
int opnum;
opcode = get_relocation_opcode (abfd, sec, contents, irel);
if (reloc_opcodes)
opcode = reloc_opcodes[i];
else
opcode = get_relocation_opcode (abfd, sec, contents, irel);
if (opcode == XTENSA_UNDEFINED)
return FALSE;
{
ok = FALSE;
break;
}
opnum = get_relocation_opnd (opcode, ELF32_R_TYPE (irel->r_info));
if (opnum == XTENSA_UNDEFINED)
return FALSE;
{
ok = FALSE;
break;
}
if (!pcrel_reloc_fits (opcode, opnum, self_offset, target_offset))
return FALSE;
{
ok = FALSE;
break;
}
}
}
return TRUE;
if (xmap)
free_xlate_map (xmap);
return ok;
}
@ -7625,7 +7849,7 @@ move_shared_literal (asection *sec,
relocs_fit = check_section_ebb_pcrels_fit (target_sec->owner, target_sec,
target_sec_cache->contents,
target_sec_cache->relocs,
&ebb_table);
&ebb_table, NULL);
if (!relocs_fit)
return FALSE;

View File

@ -1,6 +1,6 @@
/* Alpha specific support for 64-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
@ -273,8 +273,9 @@ elf64_alpha_bfd_link_hash_table_create (bfd *abfd)
if (ret == (struct alpha_elf_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf64_alpha_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
elf64_alpha_link_hash_newfunc,
sizeof (struct alpha_elf_link_hash_entry)))
{
free (ret);
return NULL;
@ -1244,8 +1245,10 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
if (!_bfd_elf_define_linkage_sym (abfd, info, s,
"_PROCEDURE_LINKAGE_TABLE_"))
h = _bfd_elf_define_linkage_sym (abfd, info, s,
"_PROCEDURE_LINKAGE_TABLE_");
elf_hash_table (info)->hplt = h;
if (h == NULL)
return FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
@ -4715,8 +4718,8 @@ elf64_alpha_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
/* Mark some specially defined symbols as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
|| strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot
|| h == elf_hash_table (info)->hplt)
sym->st_shndx = SHN_ABS;
return TRUE;

View File

@ -1,5 +1,5 @@
/* Support for HPPA 64-bit ELF
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -157,9 +157,6 @@ struct elf64_hppa_link_hash_table
typedef struct bfd_hash_entry *(*new_hash_entry_func)
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static bfd_boolean elf64_hppa_dyn_hash_table_init
PARAMS ((struct elf64_hppa_dyn_hash_table *ht, bfd *abfd,
new_hash_entry_func new));
static struct bfd_hash_entry *elf64_hppa_new_dyn_hash_entry
PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table,
const char *string));
@ -276,13 +273,13 @@ static int elf64_hppa_elf_get_symbol_type
PARAMS ((Elf_Internal_Sym *, int));
static bfd_boolean
elf64_hppa_dyn_hash_table_init (ht, abfd, new)
struct elf64_hppa_dyn_hash_table *ht;
bfd *abfd ATTRIBUTE_UNUSED;
new_hash_entry_func new;
elf64_hppa_dyn_hash_table_init (struct elf64_hppa_dyn_hash_table *ht,
bfd *abfd ATTRIBUTE_UNUSED,
new_hash_entry_func new,
unsigned int entsize)
{
memset (ht, 0, sizeof (*ht));
return bfd_hash_table_init (&ht->root, new);
return bfd_hash_table_init (&ht->root, new, entsize);
}
static struct bfd_hash_entry*
@ -328,14 +325,16 @@ elf64_hppa_hash_table_create (abfd)
if (!ret)
return 0;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
_bfd_elf_link_hash_newfunc))
_bfd_elf_link_hash_newfunc,
sizeof (struct elf_link_hash_entry)))
{
bfd_release (abfd, ret);
return 0;
}
if (!elf64_hppa_dyn_hash_table_init (&ret->dyn_hash_table, abfd,
elf64_hppa_new_dyn_hash_entry))
elf64_hppa_new_dyn_hash_entry,
sizeof (struct elf64_hppa_dyn_hash_entry)))
return 0;
return &ret->root.root;
}
@ -381,13 +380,16 @@ elf64_hppa_object_p (abfd)
{
/* GCC on hppa-linux produces binaries with OSABI=Linux,
but the kernel produces corefiles with OSABI=SysV. */
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX
&& i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
else
{
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX)
/* HPUX produces binaries with OSABI=HPUX,
but the kernel produces corefiles with OSABI=SysV. */
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX
&& i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
@ -399,7 +401,10 @@ elf64_hppa_object_p (abfd)
case EFA_PARISC_1_1:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11);
case EFA_PARISC_2_0:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20);
if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64)
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
else
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20);
case EFA_PARISC_2_0 | EF_PARISC_WIDE:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
}
@ -1124,6 +1129,7 @@ allocate_global_data_opd (dyn_h, data)
/* We never need an opd entry for a symbol which is not
defined by this output file. */
if (h && (h->root.type == bfd_link_hash_undefined
|| h->root.type == bfd_link_hash_undefweak
|| h->root.u.def.section->output_section == NULL))
dyn_h->want_opd = 0;
@ -2536,6 +2542,68 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info)
return TRUE;
}
/* Support for core dump NOTE sections. */
static bfd_boolean
elf64_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
{
int offset;
size_t size;
switch (note->descsz)
{
default:
return FALSE;
case 760: /* Linux/hppa */
/* pr_cursig */
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
offset = 112;
size = 640;
break;
}
/* Make a ".reg/999" section. */
return _bfd_elfcore_make_pseudosection (abfd, ".reg",
size, note->descpos + offset);
}
static bfd_boolean
elf64_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
{
char * command;
int n;
switch (note->descsz)
{
default:
return FALSE;
case 136: /* Linux/hppa elf_prpsinfo. */
elf_tdata (abfd)->core_program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
elf_tdata (abfd)->core_command
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
}
/* Note that for some reason, a spurious space is tacked
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
command = elf_tdata (abfd)->core_command;
n = strlen (command);
if (0 < n && command[n - 1] == ' ')
command[n - 1] = '\0';
return TRUE;
}
/* Return the number of additional phdrs we will need.
The generic ELF code only creates PT_PHDRs for executables. The HP
@ -2641,6 +2709,54 @@ elf64_hppa_elf_get_symbol_type (elf_sym, type)
return type;
}
/* Support HP specific sections for core files. */
static bfd_boolean
elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index,
const char *typename)
{
if (hdr->p_type == PT_HP_CORE_KERNEL)
{
asection *sect;
if (!_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename))
return FALSE;
sect = bfd_make_section_anyway (abfd, ".kernel");
if (sect == NULL)
return FALSE;
sect->size = hdr->p_filesz;
sect->filepos = hdr->p_offset;
sect->flags = SEC_HAS_CONTENTS | SEC_READONLY;
return TRUE;
}
if (hdr->p_type == PT_HP_CORE_PROC)
{
int sig;
if (bfd_seek (abfd, hdr->p_offset, SEEK_SET) != 0)
return FALSE;
if (bfd_bread (&sig, 4, abfd) != 4)
return FALSE;
elf_tdata (abfd)->core_signal = sig;
if (!_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename))
return FALSE;
/* GDB uses the ".reg" section to read register contents. */
return _bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz,
hdr->p_offset);
}
if (hdr->p_type == PT_HP_CORE_LOADABLE
|| hdr->p_type == PT_HP_CORE_STACK
|| hdr->p_type == PT_HP_CORE_MMF)
hdr->p_type = PT_LOAD;
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename);
}
static const struct bfd_elf_special_section elf64_hppa_special_sections[] =
{
{ ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
@ -2649,7 +2765,7 @@ static const struct bfd_elf_special_section elf64_hppa_special_sections[] =
{ ".dlt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ ".sdata", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ ".sbss", 5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ ".tbss", 5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_WEAKORDER },
{ ".tbss", 5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS },
{ NULL, 0, 0, 0, 0 }
};
@ -2721,7 +2837,9 @@ const struct elf_size_info hppa64_elf_size_info =
elf64_hppa_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
elf64_hppa_finish_dynamic_sections
#define elf_backend_grok_prstatus elf64_hppa_grok_prstatus
#define elf_backend_grok_psinfo elf64_hppa_grok_psinfo
/* Stuff for the BFD linker: */
#define bfd_elf64_bfd_link_hash_table_create \
elf64_hppa_hash_table_create
@ -2751,6 +2869,7 @@ const struct elf_size_info hppa64_elf_size_info =
#define elf_backend_rela_normal 1
#define elf_backend_special_sections elf64_hppa_special_sections
#define elf_backend_action_discarded elf_hppa_action_discarded
#define elf_backend_section_from_phdr elf64_hppa_section_from_phdr
#include "elf64-target.h"
@ -2759,7 +2878,5 @@ const struct elf_size_info hppa64_elf_size_info =
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-hppa-linux"
#undef elf_backend_special_sections
#define INCLUDED_TARGET_FILE 1
#include "elf64-target.h"

View File

@ -299,9 +299,11 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* 16 bit PC relative reference. */
/* 16 bit PC relative reference. Note that the ABI document has a typo
and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
0, /* rightshift */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@ -948,9 +950,11 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* 16 bit PC relative reference. */
/* 16 bit PC relative reference. Note that the ABI document has a typo
and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
0, /* rightshift */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@ -2133,7 +2137,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
/* There is no BFD reloc for R_MIPS_REL32. */
{ BFD_RELOC_64, R_MIPS_64 },
{ BFD_RELOC_CTOR, R_MIPS_64 },
{ BFD_RELOC_16_PCREL, R_MIPS_PC16 },
{ BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
{ BFD_RELOC_HI16_S, R_MIPS_HI16 },
{ BFD_RELOC_LO16, R_MIPS_LO16 },
{ BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
@ -2217,8 +2221,6 @@ bfd_elf64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return &elf_mips_gnu_vtinherit_howto;
case BFD_RELOC_VTABLE_ENTRY:
return &elf_mips_gnu_vtentry_howto;
case BFD_RELOC_16_PCREL_S2:
return &elf_mips_gnu_rela16_s2;
default:
bfd_set_error (bfd_error_bad_value);
return NULL;

View File

@ -1,5 +1,6 @@
/* MMIX-specific support for 64-bit ELF.
Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com>
This file is part of BFD, the Binary File Descriptor library.
@ -860,13 +861,16 @@ mmix_elf_new_section_hook (abfd, sec)
bfd *abfd;
asection *sec;
{
struct _mmix_elf_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
if (!sec->used_by_bfd)
{
struct _mmix_elf_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
sdata = (struct _mmix_elf_section_data *) bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = (PTR) sdata;
sdata = bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
}
return _bfd_elf_new_section_hook (abfd, sec);
}

View File

@ -1,5 +1,5 @@
/* PowerPC64-specific support for 64-bit ELF.
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Linus Nordberg, Swox AB <info@swox.com>,
based on elf32-ppc.c by Ian Lance Taylor.
@ -89,6 +89,7 @@ static bfd_vma opd_entry_value
#define elf_backend_check_directives ppc64_elf_check_directives
#define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup
#define elf_backend_check_relocs ppc64_elf_check_relocs
#define elf_backend_gc_mark_dynamic_ref ppc64_elf_gc_mark_dynamic_ref
#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook
#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook
#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol
@ -2549,13 +2550,16 @@ struct _ppc64_elf_section_data
static bfd_boolean
ppc64_elf_new_section_hook (bfd *abfd, asection *sec)
{
struct _ppc64_elf_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
if (!sec->used_by_bfd)
{
struct _ppc64_elf_section_data *sdata;
bfd_size_type amt = sizeof (*sdata);
sdata = bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
sdata = bfd_zalloc (abfd, amt);
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
}
return _bfd_elf_new_section_hook (abfd, sec);
}
@ -2622,6 +2626,32 @@ compare_symbols (const void *ap, const void *bp)
if (a->value + a->section->vma > b->value + b->section->vma)
return 1;
/* For syms with the same value, prefer strong dynamic global function
syms over other syms. */
if ((a->flags & BSF_GLOBAL) != 0 && (b->flags & BSF_GLOBAL) == 0)
return -1;
if ((a->flags & BSF_GLOBAL) == 0 && (b->flags & BSF_GLOBAL) != 0)
return 1;
if ((a->flags & BSF_FUNCTION) != 0 && (b->flags & BSF_FUNCTION) == 0)
return -1;
if ((a->flags & BSF_FUNCTION) == 0 && (b->flags & BSF_FUNCTION) != 0)
return 1;
if ((a->flags & BSF_WEAK) == 0 && (b->flags & BSF_WEAK) != 0)
return -1;
if ((a->flags & BSF_WEAK) != 0 && (b->flags & BSF_WEAK) == 0)
return 1;
if ((a->flags & BSF_DYNAMIC) != 0 && (b->flags & BSF_DYNAMIC) == 0)
return -1;
if ((a->flags & BSF_DYNAMIC) == 0 && (b->flags & BSF_DYNAMIC) != 0)
return 1;
return 0;
}
@ -3463,18 +3493,21 @@ ppc64_elf_link_hash_table_create (bfd *abfd)
if (htab == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&htab->elf, abfd, link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&htab->elf, abfd, link_hash_newfunc,
sizeof (struct ppc_link_hash_entry)))
{
free (htab);
return NULL;
}
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc))
if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc,
sizeof (struct ppc_stub_hash_entry)))
return NULL;
/* And the branch hash table. */
if (!bfd_hash_table_init (&htab->branch_hash_table, branch_hash_newfunc))
if (!bfd_hash_table_init (&htab->branch_hash_table, branch_hash_newfunc,
sizeof (struct ppc_branch_hash_entry)))
return NULL;
/* Initializing two fields of the union is just cosmetic. We really
@ -4507,7 +4540,24 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_PPC64_REL14:
case R_PPC64_REL14_BRTAKEN:
case R_PPC64_REL14_BRNTAKEN:
htab->has_14bit_branch = 1;
{
asection *dest = NULL;
/* Heuristic: If jumping outside our section, chances are
we are going to need a stub. */
if (h != NULL)
{
/* If the sym is weak it may be overridden later, so
don't assume we know where a weak sym lives. */
if (h->root.type == bfd_link_hash_defined)
dest = h->root.u.def.section;
}
else
dest = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (dest != sec)
htab->has_14bit_branch = 1;
}
/* Fall through. */
case R_PPC64_REL24:
@ -4922,6 +4972,54 @@ opd_entry_value (asection *opd_sec,
return val;
}
/* Mark sections containing dynamically referenced symbols. When
building shared libraries, we must assume that any visible symbol is
referenced. */
static bfd_boolean
ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) h;
if (eh->elf.root.type == bfd_link_hash_warning)
eh = (struct ppc_link_hash_entry *) eh->elf.root.u.i.link;
/* Dynamic linking info is on the func descriptor sym. */
if (eh->oh != NULL
&& eh->oh->is_func_descriptor
&& (eh->oh->elf.root.type == bfd_link_hash_defined
|| eh->oh->elf.root.type == bfd_link_hash_defweak))
eh = eh->oh;
if ((eh->elf.root.type == bfd_link_hash_defined
|| eh->elf.root.type == bfd_link_hash_defweak)
&& (eh->elf.ref_dynamic
|| (!info->executable
&& eh->elf.def_regular
&& ELF_ST_VISIBILITY (eh->elf.other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (eh->elf.other) != STV_HIDDEN)))
{
asection *code_sec;
eh->elf.root.u.def.section->flags |= SEC_KEEP;
/* Function descriptor syms cause the associated
function code sym section to be marked. */
if (eh->is_func_descriptor
&& (eh->oh->elf.root.type == bfd_link_hash_defined
|| eh->oh->elf.root.type == bfd_link_hash_defweak))
eh->oh->elf.root.u.def.section->flags |= SEC_KEEP;
else if (get_opd_info (eh->elf.root.u.def.section) != NULL
&& opd_entry_value (eh->elf.root.u.def.section,
eh->elf.root.u.def.value,
&code_sec, NULL) != (bfd_vma) -1)
code_sec->flags |= SEC_KEEP;
}
return TRUE;
}
/* Return the section that should be marked against GC for a given
relocation. */
@ -4941,7 +5039,7 @@ ppc64_elf_gc_mark_hook (asection *sec,
struct bfd_sym_chain *sym = info->gc_sym_list;
info->gc_sym_list = NULL;
do
for (; sym != NULL; sym = sym->next)
{
struct ppc_link_hash_entry *eh;
@ -4971,10 +5069,7 @@ ppc64_elf_gc_mark_hook (asection *sec,
rsec = eh->elf.root.u.def.section;
if (!rsec->gc_mark)
_bfd_elf_gc_mark (info, rsec, ppc64_elf_gc_mark_hook);
sym = sym->next;
}
while (sym != NULL);
}
/* Syms return NULL if we're marking .opd, so we avoid marking all
@ -6630,12 +6725,22 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
{
Elf_Internal_Sym *locsyms = NULL;
asection *toc = bfd_get_section_by_name (ibfd, ".toc");
unsigned char *toc_ref = NULL;
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
/* Look at all the sections for this file, with TOC last. */
for (sec = (ibfd->sections == toc && toc && toc->next ? toc->next
: ibfd->sections);
sec != NULL;
sec = (sec == toc ? NULL
: sec->next == NULL ? toc
: sec->next == toc && toc->next ? toc->next
: sec->next))
if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section))
{
Elf_Internal_Rela *relstart, *rel, *relend;
int expecting_tls_get_addr;
long toc_ref_index = 0;
/* Read the relocations. */
relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL,
@ -6664,6 +6769,8 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
err_free_rel:
if (elf_section_data (sec)->relocs != relstart)
free (relstart);
if (toc_ref != NULL)
free (toc_ref);
if (locsyms != NULL
&& (elf_tdata (ibfd)->symtab_hdr.contents
!= (unsigned char *) locsyms))
@ -6771,8 +6878,12 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
rel - 1, ibfd);
if (retval == 0)
goto err_free_rel;
if (toc_tls != NULL)
expecting_tls_get_addr = retval > 1;
if (retval > 1 && toc_tls != NULL)
{
expecting_tls_get_addr = 1;
if (toc_ref != NULL)
toc_ref[toc_ref_index] = 1;
}
}
if (expecting_tls_get_addr)
@ -6790,8 +6901,40 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
expecting_tls_get_addr = 0;
continue;
case R_PPC64_TOC16:
case R_PPC64_TOC16_LO:
case R_PPC64_TLS:
expecting_tls_get_addr = 0;
if (sym_sec == toc && toc != NULL)
{
/* Mark this toc entry as referenced by a TLS
code sequence. We can do that now in the
case of R_PPC64_TLS, and after checking for
tls_get_addr for the TOC16 relocs. */
if (toc_ref == NULL)
{
toc_ref = bfd_zmalloc (toc->size / 8);
if (toc_ref == NULL)
goto err_free_rel;
}
if (h != NULL)
value = h->root.u.def.value;
else
value = sym->st_value;
value += rel->r_addend;
BFD_ASSERT (value < toc->size && value % 8 == 0);
toc_ref_index = value / 8;
if (r_type == R_PPC64_TLS)
toc_ref[toc_ref_index] = 1;
}
continue;
case R_PPC64_TPREL64:
expecting_tls_get_addr = 0;
if (sec != toc
|| toc_ref == NULL
|| !toc_ref[rel->r_offset / 8])
continue;
if (ok_tprel)
{
/* IE -> LE */
@ -6804,6 +6947,10 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
case R_PPC64_DTPMOD64:
expecting_tls_get_addr = 0;
if (sec != toc
|| toc_ref == NULL
|| !toc_ref[rel->r_offset / 8])
continue;
if (rel + 1 < relend
&& (rel[1].r_info
== ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64))
@ -6882,6 +7029,9 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
free (relstart);
}
if (toc_ref != NULL)
free (toc_ref);
if (locsyms != NULL
&& (elf_tdata (ibfd)->symtab_hdr.contents
!= (unsigned char *) locsyms))
@ -7077,13 +7227,14 @@ ppc64_elf_edit_toc (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
return FALSE;
}
/* Now check all kept sections that might reference the toc. */
for (sec = ibfd->sections;
/* Now check all kept sections that might reference the toc.
Check the toc itself last. */
for (sec = (ibfd->sections == toc && toc->next ? toc->next
: ibfd->sections);
sec != NULL;
/* Check the toc itself last. */
sec = (sec == toc ? NULL
: sec->next == toc && sec->next->next ? sec->next->next
: sec->next == NULL ? toc
: sec->next == toc && toc->next ? toc->next
: sec->next))
{
int repeat;
@ -7519,9 +7670,21 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
eh->dyn_relocs = NULL;
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
eh->dyn_relocs = NULL;
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
else if (h->dynindx == -1
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
}
}
else if (ELIMINATE_COPY_RELOCS)
{
@ -8895,6 +9058,9 @@ ppc64_elf_size_stubs (bfd *output_bfd,
asection *section;
Elf_Internal_Sym *local_syms = NULL;
if (!is_ppc64_elf_target (input_bfd->xvec))
continue;
/* We'll need the symbol table in a second. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
if (symtab_hdr->sh_info == 0)
@ -9474,6 +9640,9 @@ ppc64_elf_action_discarded (asection *sec)
if (strcmp (".toc", sec->name) == 0)
return 0;
if (strcmp (".toc1", sec->name) == 0)
return 0;
return _bfd_elf_default_action_discarded (sec);
}
@ -9530,9 +9699,6 @@ ppc64_elf_relocate_section (bfd *output_bfd,
/* Disabled until we sort out how ld should choose 'y' vs 'at'. */
bfd_boolean is_power4 = FALSE;
if (info->relocatable)
return TRUE;
/* Initialize howto table if needed. */
if (!ppc64_elf_howto_table[R_PPC64_ADDR32])
ppc_howto_init ();
@ -9554,7 +9720,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
for (; rel < relend; rel++)
{
enum elf_ppc64_reloc_type r_type;
bfd_vma addend;
bfd_vma addend, orig_addend;
bfd_reloc_status_type r;
Elf_Internal_Sym *sym;
asection *sec;
@ -9591,6 +9757,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
sym_name = NULL;
unresolved_reloc = FALSE;
warned = FALSE;
orig_addend = rel->r_addend;
if (r_symndx < symtab_hdr->sh_info)
{
@ -9609,11 +9776,25 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (adjust == -1)
relocation = 0;
else
relocation += adjust;
{
/* If this is a relocation against the opd section sym
and we have edited .opd, adjust the reloc addend so
that ld -r and ld --emit-relocs output is correct.
If it is a reloc against some other .opd symbol,
then the symbol value will be adjusted later. */
if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
rel->r_addend += adjust;
else
relocation += adjust;
}
}
if (info->relocatable)
continue;
}
else
{
if (info->relocatable)
continue;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h_elf, sec, relocation,
@ -10050,10 +10231,12 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (stub_entry->stub_type == ppc_stub_plt_call)
{
/* If this is a plain branch rather than a branch
and link, don't require a nop. */
and link, don't require a nop. However, don't
allow tail calls in a shared library as they
will result in r2 being corrupted. */
unsigned long br;
br = bfd_get_32 (input_bfd, contents + rel->r_offset);
if ((br & 1) == 0)
if (info->executable && (br & 1) == 0)
can_plt_call = TRUE;
else
stub_entry = NULL;
@ -10104,8 +10287,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
&& get_opd_info (sec) != NULL)
{
/* The branch destination is the value of the opd entry. */
bfd_vma off = (relocation - sec->output_section->vma
- sec->output_offset + rel->r_addend);
bfd_vma off = (relocation + addend
- sec->output_section->vma
- sec->output_offset);
bfd_vma dest = opd_entry_value (sec, off, NULL, NULL);
if (dest != (bfd_vma) -1)
{
@ -10121,7 +10305,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
+ input_section->output_section->vma);
if (stub_entry == NULL
&& (relocation + rel->r_addend - from + max_br_offset
&& (relocation + addend - from + max_br_offset
>= 2 * max_br_offset)
&& r_type != R_PPC64_ADDR14_BRTAKEN
&& r_type != R_PPC64_ADDR14_BRNTAKEN)
@ -10155,7 +10339,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
else
{
/* Invert 'y' bit if not the default. */
if ((bfd_signed_vma) (relocation + rel->r_addend - from) < 0)
if ((bfd_signed_vma) (relocation + addend - from) < 0)
insn ^= 0x01 << 21;
}
@ -10169,7 +10353,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
&& h->elf.root.type == bfd_link_hash_undefweak
&& r_type == R_PPC64_REL24
&& relocation == 0
&& rel->r_addend == 0)
&& addend == 0)
{
bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
continue;
@ -10278,7 +10462,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
}
for (; ent != NULL; ent = ent->next)
if (ent->addend == rel->r_addend
if (ent->addend == orig_addend
&& ent->owner == input_bfd
&& ent->tls_type == tls_type)
break;
@ -10313,7 +10497,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
outrel.r_offset = (got->output_section->vma
+ got->output_offset
+ off);
outrel.r_addend = rel->r_addend;
outrel.r_addend = addend;
if (tls_type & (TLS_LD | TLS_GD))
{
outrel.r_addend = 0;
@ -10326,7 +10510,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
bfd_elf64_swap_reloca_out (output_bfd,
&outrel, loc);
outrel.r_offset += 8;
outrel.r_addend = rel->r_addend;
outrel.r_addend = addend;
outrel.r_info
= ELF64_R_INFO (indx, R_PPC64_DTPREL64);
}
@ -10364,7 +10548,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
emitting a reloc. */
else
{
relocation += rel->r_addend;
relocation += addend;
if (tls_type == (TLS_TLS | TLS_LD))
relocation = 1;
else if (tls_type != 0)
@ -10417,7 +10601,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
{
struct plt_entry *ent;
for (ent = h->elf.plt.plist; ent != NULL; ent = ent->next)
if (ent->addend == rel->r_addend
if (ent->addend == orig_addend
&& ent->plt.offset != (bfd_vma) -1)
{
relocation = (htab->plt->output_section->vma
@ -10673,6 +10857,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (sreloc == NULL)
abort ();
if (sreloc->reloc_count * sizeof (Elf64_External_Rela)
>= sreloc->size)
abort ();
loc = sreloc->contents;
loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
@ -10863,7 +11050,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (!((*info->callbacks->reloc_overflow)
(info, (h ? &h->elf.root : NULL), sym_name,
ppc64_elf_howto_table[r_type]->name,
rel->r_addend, input_bfd, input_section, rel->r_offset)))
orig_addend, input_bfd, input_section, rel->r_offset)))
return FALSE;
}
else
@ -10886,7 +11073,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
adjusted. Worse, reloc symbol indices will be for the output
file rather than the input. Save a copy of the relocs for
opd_entry_value. */
if (is_opd && info->emitrelocations)
if (is_opd && (info->emitrelocations || info->relocatable))
{
bfd_size_type amt;
amt = input_section->reloc_count * sizeof (Elf_Internal_Rela);
@ -10941,13 +11128,11 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd,
Elf_Internal_Sym *sym)
{
struct ppc_link_hash_table *htab;
bfd *dynobj;
struct plt_entry *ent;
Elf_Internal_Rela rela;
bfd_byte *loc;
htab = ppc_hash_table (info);
dynobj = htab->elf.dynobj;
for (ent = h->plt.plist; ent != NULL; ent = ent->next)
if (ent->plt.offset != (bfd_vma) -1)

View File

@ -1,5 +1,5 @@
/* IBM S/390-specific support for 64-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed Martin Schwidefsky (schwidefsky@de.ibm.com).
@ -724,7 +724,8 @@ elf_s390_link_hash_table_create (abfd)
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
sizeof (struct elf_s390_link_hash_entry)))
{
free (ret);
return NULL;
@ -1881,9 +1882,21 @@ allocate_dynrelocs (h, inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
eh->dyn_relocs = NULL;
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
else if (h->dynindx == -1
&& !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
}
}
else if (ELIMINATE_COPY_RELOCS)
{
@ -2227,6 +2240,7 @@ invalid_tls_insn (input_bfd, input_section, rel)
input_section,
(long) rel->r_offset,
howto->name);
bfd_set_error (bfd_error_bad_value);
}
/* Relocate a 390 ELF section. */
@ -3240,8 +3254,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark some specially defined symbols as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
|| strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
|| h == htab->elf.hgot
|| h == htab->elf.hplt)
sym->st_shndx = SHN_ABS;
return TRUE;

View File

@ -1,5 +1,5 @@
/* SuperH SH64-specific support for 64-bit ELF
Copyright 2000, 2001, 2002, 2003, 2004, 2005
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -3138,8 +3138,9 @@ sh64_elf64_link_hash_table_create (bfd *abfd)
if (ret == (struct elf_sh64_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
sh64_elf64_link_hash_newfunc))
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
sh64_elf64_link_hash_newfunc,
sizeof (struct elf_sh64_link_hash_entry)))
{
free (ret);
return NULL;
@ -3240,6 +3241,7 @@ sh64_elf64_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->type = STT_OBJECT;
elf_hash_table (info)->hplt = h;
if (info->shared
&& ! bfd_elf_link_record_dynamic_symbol (info, h))
@ -3888,7 +3890,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|| h == elf_hash_table (info)->hgot)
sym->st_shndx = SHN_ABS;
return TRUE;

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More