* Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.

(BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
	Run "make dep-am".
	* Makefile.in: Regenerate.
	* config.bfd: Add i[3456]86-*-nto-qnx* support.
	* configure.in: Add bfd_elf32_i386qnx_vec support.
	* configure: Regenerate.
	* elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
	is_contained_by_filepos, and copy_private_bfd_data_p.
	* elf.c (assign_file_positions_for_segments): Call backend
	set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
	(IS_CONTAINED_BY_FILEPOS): Define.
	(INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
	(copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
	Fix non-K&R call to _bfd_error_handler.
	(_bfd_elf_copy_private_section_data): Use backend
	copy_private_bfd_data_p.
	* elf32-i386.c: Don't include elfxx-target.h when
	ELF32_I386_C_INCLUDED is defined.
	* elf32-i386qnx.c: New QNX elf backend file.
	* elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
	elf_backend_is_contained_by_filepos, and
	elf_backend_do_copy_private_bfd_data.
	* targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
This commit is contained in:
Alan Modra 2002-05-31 02:59:47 +00:00
parent 5bc5648443
commit caf47ea6a3
12 changed files with 920 additions and 204 deletions

View File

@ -1,3 +1,30 @@
2002-05-31 Graeme Peterson <gp@qnx.com>
* Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
(BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
Run "make dep-am".
* Makefile.in: Regenerate.
* config.bfd: Add i[3456]86-*-nto-qnx* support.
* configure.in: Add bfd_elf32_i386qnx_vec support.
* configure: Regenerate.
* elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
is_contained_by_filepos, and copy_private_bfd_data_p.
* elf.c (assign_file_positions_for_segments): Call backend
set_nonloadable_filepos. Fix non-K&R call to _bfd_error_handler.
(IS_CONTAINED_BY_FILEPOS): Define.
(INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
(copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS. Typo fix.
Fix non-K&R call to _bfd_error_handler.
(_bfd_elf_copy_private_section_data): Use backend
copy_private_bfd_data_p.
* elf32-i386.c: Don't include elfxx-target.h when
ELF32_I386_C_INCLUDED is defined.
* elf32-i386qnx.c: New QNX elf backend file.
* elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
elf_backend_is_contained_by_filepos, and
elf_backend_do_copy_private_bfd_data.
* targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
2002-05-31 Alan Modra <amodra@bigpond.net.au>
* elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.

View File

@ -207,6 +207,7 @@ BFD32_BACKENDS = \
elf32-hppa.lo \
elf32-i370.lo \
elf32-i386.lo \
elf32-i386qnx.lo \
elf32-i860.lo \
elf32-i960.lo \
elf32-ia64.lo \
@ -358,6 +359,7 @@ BFD32_BACKENDS_CFILES = \
elf32-hppa.c \
elf32-i370.c \
elf32-i386.c \
elf32-i386qnx.c \
elf32-i860.c \
elf32-i960.c \
elf32-m32r.c \
@ -873,7 +875,7 @@ cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h
cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h
cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h
cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h
cpu-dlx.lo: cpu-d30v.c $(INCDIR)/filenames.h
cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h
cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h
cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h
cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h
@ -1116,6 +1118,10 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \
@ -1215,7 +1221,7 @@ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-vax.lo: elf32-vax.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/libiberty.h elf32-target.h
elf32-target.h
elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \

View File

@ -151,45 +151,505 @@ BFD_H = bfd.h
# for the debugger, so if you are downloading things as S-records you
# need two copies of the executable, one to download and one for the
# debugger).
BFD32_LIBS = archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo
BFD32_LIBS = \
archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \
format.lo init.lo libbfd.lo opncls.lo reloc.lo \
section.lo syms.lo targets.lo hash.lo linker.lo \
srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
merge.lo dwarf2.lo
BFD64_LIBS = archive64.lo
BFD32_LIBS_CFILES = archive.c archures.c bfd.c cache.c coffgen.c corefile.c format.c init.c libbfd.c opncls.c reloc.c section.c syms.c targets.c hash.c linker.c srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c merge.c dwarf2.c
BFD32_LIBS_CFILES = \
archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
format.c init.c libbfd.c opncls.c reloc.c \
section.c syms.c targets.c hash.c linker.c \
srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
merge.c dwarf2.c
BFD64_LIBS_CFILES = archive64.c
# This list is alphabetized to make it easier to keep in sync
# with the decls and initializer in archures.c.
ALL_MACHINES = cpu-a29k.lo cpu-alpha.lo cpu-arc.lo cpu-arm.lo cpu-avr.lo cpu-cris.lo cpu-d10v.lo cpu-d30v.lo cpu-dlx.lo cpu-fr30.lo cpu-h8300.lo cpu-h8500.lo cpu-hppa.lo cpu-ia64.lo cpu-i370.lo cpu-i386.lo cpu-i860.lo cpu-i960.lo cpu-m32r.lo cpu-m68hc11.lo cpu-m68hc12.lo cpu-m68k.lo cpu-m88k.lo cpu-m10200.lo cpu-m10300.lo cpu-mcore.lo cpu-mips.lo cpu-mmix.lo cpu-or32.lo cpu-ns32k.lo cpu-openrisc.lo cpu-pdp11.lo cpu-pj.lo cpu-powerpc.lo cpu-rs6000.lo cpu-s390.lo cpu-sh.lo cpu-sparc.lo cpu-tic30.lo cpu-tic54x.lo cpu-tic80.lo cpu-v850.lo cpu-vax.lo cpu-we32k.lo cpu-w65.lo cpu-xstormy16.lo cpu-z8k.lo
ALL_MACHINES = \
cpu-a29k.lo \
cpu-alpha.lo \
cpu-arc.lo \
cpu-arm.lo \
cpu-avr.lo \
cpu-cris.lo \
cpu-d10v.lo \
cpu-d30v.lo \
cpu-dlx.lo \
cpu-fr30.lo \
cpu-h8300.lo \
cpu-h8500.lo \
cpu-hppa.lo \
cpu-ia64.lo \
cpu-i370.lo \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-m32r.lo \
cpu-m68hc11.lo \
cpu-m68hc12.lo \
cpu-m68k.lo \
cpu-m88k.lo \
cpu-m10200.lo \
cpu-m10300.lo \
cpu-mcore.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-or32.lo \
cpu-ns32k.lo \
cpu-openrisc.lo \
cpu-pdp11.lo \
cpu-pj.lo \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-s390.lo \
cpu-sh.lo \
cpu-sparc.lo \
cpu-tic30.lo \
cpu-tic54x.lo \
cpu-tic80.lo \
cpu-v850.lo \
cpu-vax.lo \
cpu-we32k.lo \
cpu-w65.lo \
cpu-xstormy16.lo \
cpu-z8k.lo
ALL_MACHINES_CFILES = cpu-a29k.c cpu-alpha.c cpu-arc.c cpu-arm.c cpu-avr.c cpu-cris.c cpu-d10v.c cpu-d30v.c cpu-dlx.c cpu-fr30.c cpu-h8300.c cpu-h8500.c cpu-hppa.c cpu-ia64.c cpu-i370.c cpu-i386.c cpu-i860.c cpu-i960.c cpu-m32r.c cpu-m68hc11.c cpu-m68hc12.c cpu-m68k.c cpu-m88k.c cpu-m10200.c cpu-m10300.c cpu-mcore.c cpu-mips.c cpu-mmix.c cpu-or32.c cpu-ns32k.c cpu-openrisc.c cpu-pdp11.c cpu-pj.c cpu-powerpc.c cpu-rs6000.c cpu-s390.c cpu-sh.c cpu-sparc.c cpu-tic30.c cpu-tic54x.c cpu-tic80.c cpu-v850.c cpu-vax.c cpu-we32k.c cpu-w65.c cpu-xstormy16.c cpu-z8k.c
ALL_MACHINES_CFILES = \
cpu-a29k.c \
cpu-alpha.c \
cpu-arc.c \
cpu-arm.c \
cpu-avr.c \
cpu-cris.c \
cpu-d10v.c \
cpu-d30v.c \
cpu-dlx.c \
cpu-fr30.c \
cpu-h8300.c \
cpu-h8500.c \
cpu-hppa.c \
cpu-ia64.c \
cpu-i370.c \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
cpu-m32r.c \
cpu-m68hc11.c \
cpu-m68hc12.c \
cpu-m68k.c \
cpu-m88k.c \
cpu-m10200.c \
cpu-m10300.c \
cpu-mcore.c \
cpu-mips.c \
cpu-mmix.c \
cpu-or32.c \
cpu-ns32k.c \
cpu-openrisc.c \
cpu-pdp11.c \
cpu-pj.c \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-s390.c \
cpu-sh.c \
cpu-sparc.c \
cpu-tic30.c \
cpu-tic54x.c \
cpu-tic80.c \
cpu-v850.c \
cpu-vax.c \
cpu-we32k.c \
cpu-w65.c \
cpu-xstormy16.c \
cpu-z8k.c
# The .o files needed by all of the 32 bit vectors that are configured into
# target_vector in targets.c if configured with --enable-targets=all.
BFD32_BACKENDS = aout-adobe.lo aout-arm.lo aout-cris.lo aout-ns32k.lo aout-sparcle.lo aout-tic30.lo aout0.lo aout32.lo armnetbsd.lo bout.lo cf-i386lynx.lo cf-m68klynx.lo cf-sparclynx.lo coff-a29k.lo coff-apollo.lo coff-arm.lo coff-aux.lo coff-h8300.lo coff-h8500.lo coff-i386.lo coff-go32.lo coff-i860.lo coff-i960.lo coff-m68k.lo coff-m88k.lo coff-mips.lo coff-or32.lo coff-rs6000.lo coff-sh.lo coff-sparc.lo coff-stgo32.lo coff-svm68k.lo coff-tic30.lo coff-tic54x.lo coff-tic80.lo coff-u68k.lo coff-we32k.lo coff-w65.lo coff-z8k.lo cofflink.lo dwarf1.lo ecoff.lo ecofflink.lo efi-app-ia32.lo elf.lo elf32-arc.lo elfarm-oabi.lo elfarm-nabi.lo elf32-avr.lo elf32-cris.lo elf32-d10v.lo elf32-d30v.lo elf32-dlx.lo elf32-fr30.lo elf32-gen.lo elf32-h8300.lo elf32-hppa.lo elf32-i370.lo elf32-i386.lo elf32-i860.lo elf32-i960.lo elf32-ia64.lo elf32-m32r.lo elf32-m68hc11.lo elf32-m68hc12.lo elf32-m68k.lo elf32-m88k.lo elf-m10200.lo elf-m10300.lo elf32-mcore.lo elfxx-mips.lo elf32-mips.lo elf32-openrisc.lo elf32-or32.lo elf32-pj.lo elf32-ppc.lo elf32-s390.lo elf32-sh.lo elf32-sh-lin.lo elf32-sh64.lo elf32-sh-nbsd.lo elf32-sparc.lo elf32-v850.lo elf32-vax.lo elf32-xstormy16.lo elf32.lo elflink.lo elf-strtab.lo elf-eh-frame.lo epoc-pe-arm.lo epoc-pei-arm.lo hp300bsd.lo hp300hpux.lo som.lo i386aout.lo i386bsd.lo i386dynix.lo i386freebsd.lo i386linux.lo i386lynx.lo i386msdos.lo i386netbsd.lo i386mach3.lo i386os9k.lo ieee.lo m68k4knetbsd.lo m68klinux.lo m68klynx.lo m68knetbsd.lo m88kmach3.lo mipsbsd.lo newsos3.lo nlm.lo nlm32-i386.lo nlm32-sparc.lo nlm32-ppc.lo nlm32.lo ns32knetbsd.lo oasys.lo pc532-mach.lo pdp11.lo pe-arm.lo pei-arm.lo pe-i386.lo pei-i386.lo pe-mcore.lo pei-mcore.lo pe-ppc.lo pei-ppc.lo pe-sh.lo pei-sh.lo pe-mips.lo pei-mips.lo peigen.lo ppcboot.lo reloc16.lo riscix.lo sparclinux.lo sparclynx.lo sparcnetbsd.lo sunos.lo vaxnetbsd.lo versados.lo vms.lo vms-gsd.lo vms-hdr.lo vms-misc.lo vms-tir.lo xcofflink.lo
BFD32_BACKENDS = \
aout-adobe.lo \
aout-arm.lo \
aout-cris.lo \
aout-ns32k.lo \
aout-sparcle.lo \
aout-tic30.lo \
aout0.lo \
aout32.lo \
armnetbsd.lo \
bout.lo \
cf-i386lynx.lo \
cf-m68klynx.lo \
cf-sparclynx.lo \
coff-a29k.lo \
coff-apollo.lo \
coff-arm.lo \
coff-aux.lo \
coff-h8300.lo \
coff-h8500.lo \
coff-i386.lo \
coff-go32.lo \
coff-i860.lo \
coff-i960.lo \
coff-m68k.lo \
coff-m88k.lo \
coff-mips.lo \
coff-or32.lo \
coff-rs6000.lo \
coff-sh.lo \
coff-sparc.lo \
coff-stgo32.lo \
coff-svm68k.lo \
coff-tic30.lo \
coff-tic54x.lo \
coff-tic80.lo \
coff-u68k.lo \
coff-we32k.lo \
coff-w65.lo \
coff-z8k.lo \
cofflink.lo \
dwarf1.lo \
ecoff.lo \
ecofflink.lo \
efi-app-ia32.lo \
elf.lo \
elf32-arc.lo \
elfarm-oabi.lo \
elfarm-nabi.lo \
elf32-avr.lo \
elf32-cris.lo \
elf32-d10v.lo \
elf32-d30v.lo \
elf32-dlx.lo \
elf32-fr30.lo \
elf32-gen.lo \
elf32-h8300.lo \
elf32-hppa.lo \
elf32-i370.lo \
elf32-i386.lo \
elf32-i386qnx.lo \
elf32-i860.lo \
elf32-i960.lo \
elf32-ia64.lo \
elf32-m32r.lo \
elf32-m68hc11.lo \
elf32-m68hc12.lo \
elf32-m68k.lo \
elf32-m88k.lo \
elf-m10200.lo \
elf-m10300.lo \
elf32-mcore.lo \
elfxx-mips.lo \
elf32-mips.lo \
elf32-openrisc.lo \
elf32-or32.lo \
elf32-pj.lo \
elf32-ppc.lo \
elf32-s390.lo \
elf32-sh.lo \
elf32-sh-lin.lo \
elf32-sh64.lo \
elf32-sh-nbsd.lo \
elf32-sparc.lo \
elf32-v850.lo \
elf32-vax.lo \
elf32-xstormy16.lo \
elf32.lo \
elflink.lo \
elf-strtab.lo \
elf-eh-frame.lo \
epoc-pe-arm.lo \
epoc-pei-arm.lo \
hp300bsd.lo \
hp300hpux.lo \
som.lo \
i386aout.lo \
i386bsd.lo \
i386dynix.lo \
i386freebsd.lo \
i386linux.lo \
i386lynx.lo \
i386msdos.lo \
i386netbsd.lo \
i386mach3.lo \
i386os9k.lo \
ieee.lo \
m68k4knetbsd.lo \
m68klinux.lo \
m68klynx.lo \
m68knetbsd.lo \
m88kmach3.lo \
mipsbsd.lo \
newsos3.lo \
nlm.lo \
nlm32-i386.lo \
nlm32-sparc.lo \
nlm32-ppc.lo \
nlm32.lo \
ns32knetbsd.lo \
oasys.lo \
pc532-mach.lo \
pdp11.lo \
pe-arm.lo \
pei-arm.lo \
pe-i386.lo \
pei-i386.lo \
pe-mcore.lo \
pei-mcore.lo \
pe-ppc.lo \
pei-ppc.lo \
pe-sh.lo \
pei-sh.lo \
pe-mips.lo \
pei-mips.lo \
peigen.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
sparclinux.lo \
sparclynx.lo \
sparcnetbsd.lo \
sunos.lo \
vaxnetbsd.lo \
versados.lo \
vms.lo \
vms-gsd.lo \
vms-hdr.lo \
vms-misc.lo \
vms-tir.lo \
xcofflink.lo
BFD32_BACKENDS_CFILES = aout-adobe.c aout-arm.c aout-cris.c aout-ns32k.c aout-sparcle.c aout-tic30.c aout0.c aout32.c armnetbsd.c bout.c cf-i386lynx.c cf-m68klynx.c cf-sparclynx.c coff-a29k.c coff-apollo.c coff-arm.c coff-aux.c coff-h8300.c coff-h8500.c coff-i386.c coff-i860.c coff-go32.c coff-i960.c coff-m68k.c coff-m88k.c coff-mips.c coff-or32.c coff-rs6000.c coff-sh.c coff-sparc.c coff-stgo32.c coff-svm68k.c coff-tic30.c coff-tic54x.c coff-tic80.c coff-u68k.c coff-we32k.c coff-w65.c coff-z8k.c cofflink.c dwarf1.c ecoff.c ecofflink.c efi-app-ia32.c elf.c elf32-arc.c elfarm-oabi.c elfarm-nabi.c elf32-avr.c elf32-cris.c elf32-d10v.c elf32-d30v.c elf32-dlx.c elf32-fr30.c elf32-gen.c elf32-h8300.c elf32-hppa.c elf32-i370.c elf32-i386.c elf32-i860.c elf32-i960.c elf32-m32r.c elf32-m68k.c elf32-m68hc11.c elf32-m68hc12.c elf32-m88k.c elf-m10200.c elf-m10300.c elf32-mcore.c elfxx-mips.c elf32-mips.c elf32-openrisc.c elf32-or32.c elf32-pj.c elf32-ppc.c elf32-sh64.c elf32-s390.c elf32-sh.c elf32-sh-lin.c elf32-sh-nbsd.c elf32-sparc.c elf32-v850.c elf32-vax.c elf32-xstormy16.c elf32.c elflink.c elf-strtab.c elf-eh-frame.c epoc-pe-arm.c epoc-pei-arm.c hp300bsd.c hp300hpux.c som.c i386aout.c i386bsd.c i386dynix.c i386freebsd.c i386linux.c i386lynx.c i386msdos.c i386netbsd.c i386mach3.c i386os9k.c ieee.c m68k4knetbsd.c m68klinux.c m68klynx.c m68knetbsd.c m88kmach3.c mipsbsd.c newsos3.c nlm.c nlm32-i386.c nlm32-sparc.c nlm32-ppc.c nlm32.c ns32knetbsd.c oasys.c pc532-mach.c pdp11.c pe-arm.c pei-arm.c pe-i386.c pei-i386.c pe-mcore.c pei-mcore.c pe-ppc.c pei-ppc.c pe-sh.c pei-sh.c pe-mips.c pei-mips.c ppcboot.c reloc16.c riscix.c sparclinux.c sparclynx.c sparcnetbsd.c sunos.c vaxnetbsd.c versados.c vms.c vms-gsd.c vms-hdr.c vms-misc.c vms-tir.c xcofflink.c
BFD32_BACKENDS_CFILES = \
aout-adobe.c \
aout-arm.c \
aout-cris.c \
aout-ns32k.c \
aout-sparcle.c \
aout-tic30.c \
aout0.c \
aout32.c \
armnetbsd.c \
bout.c \
cf-i386lynx.c \
cf-m68klynx.c \
cf-sparclynx.c \
coff-a29k.c \
coff-apollo.c \
coff-arm.c \
coff-aux.c \
coff-h8300.c \
coff-h8500.c \
coff-i386.c \
coff-i860.c \
coff-go32.c \
coff-i960.c \
coff-m68k.c \
coff-m88k.c \
coff-mips.c \
coff-or32.c \
coff-rs6000.c \
coff-sh.c \
coff-sparc.c \
coff-stgo32.c \
coff-svm68k.c \
coff-tic30.c \
coff-tic54x.c \
coff-tic80.c \
coff-u68k.c \
coff-we32k.c \
coff-w65.c \
coff-z8k.c \
cofflink.c \
dwarf1.c \
ecoff.c \
ecofflink.c \
efi-app-ia32.c \
elf.c \
elf32-arc.c \
elfarm-oabi.c \
elfarm-nabi.c \
elf32-avr.c \
elf32-cris.c \
elf32-d10v.c \
elf32-d30v.c \
elf32-dlx.c \
elf32-fr30.c \
elf32-gen.c \
elf32-h8300.c \
elf32-hppa.c \
elf32-i370.c \
elf32-i386.c \
elf32-i386qnx.c \
elf32-i860.c \
elf32-i960.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m68hc11.c \
elf32-m68hc12.c \
elf32-m88k.c \
elf-m10200.c \
elf-m10300.c \
elf32-mcore.c \
elfxx-mips.c \
elf32-mips.c \
elf32-openrisc.c \
elf32-or32.c \
elf32-pj.c \
elf32-ppc.c \
elf32-sh64.c \
elf32-s390.c \
elf32-sh.c \
elf32-sh-lin.c \
elf32-sh-nbsd.c \
elf32-sparc.c \
elf32-v850.c \
elf32-vax.c \
elf32-xstormy16.c \
elf32.c \
elflink.c \
elf-strtab.c \
elf-eh-frame.c \
epoc-pe-arm.c \
epoc-pei-arm.c \
hp300bsd.c \
hp300hpux.c \
som.c \
i386aout.c \
i386bsd.c \
i386dynix.c \
i386freebsd.c \
i386linux.c \
i386lynx.c \
i386msdos.c \
i386netbsd.c \
i386mach3.c \
i386os9k.c \
ieee.c \
m68k4knetbsd.c \
m68klinux.c \
m68klynx.c \
m68knetbsd.c \
m88kmach3.c \
mipsbsd.c \
newsos3.c \
nlm.c \
nlm32-i386.c \
nlm32-sparc.c \
nlm32-ppc.c \
nlm32.c \
ns32knetbsd.c \
oasys.c \
pc532-mach.c \
pdp11.c \
pe-arm.c \
pei-arm.c \
pe-i386.c \
pei-i386.c \
pe-mcore.c \
pei-mcore.c \
pe-ppc.c \
pei-ppc.c \
pe-sh.c \
pei-sh.c \
pe-mips.c \
pei-mips.c \
ppcboot.c \
reloc16.c \
riscix.c \
sparclinux.c \
sparclynx.c \
sparcnetbsd.c \
sunos.c \
vaxnetbsd.c \
versados.c \
vms.c \
vms-gsd.c \
vms-hdr.c \
vms-misc.c \
vms-tir.c \
xcofflink.c
# The .o files needed by all of the 64 bit vectors that are configured into
# target_vector in targets.c if configured with --enable-targets=all
# and --enable-64-bit-bfd.
BFD64_BACKENDS = aix5ppc-core.lo aout64.lo coff-alpha.lo coff64-rs6000.lo demo64.lo efi-app-ia64.lo elf64-x86-64.lo elf64-alpha.lo elf64-hppa.lo elf64-ia64.lo elf64-gen.lo elf64-mips.lo elf64-mmix.lo elf64-sh64.lo elf64-ppc.lo elf64-s390.lo elf64-sparc.lo elf64.lo mmo.lo nlm32-alpha.lo nlm64.lo pepigen.lo
BFD64_BACKENDS = \
aix5ppc-core.lo \
aout64.lo \
coff-alpha.lo \
coff64-rs6000.lo \
demo64.lo \
efi-app-ia64.lo \
elf64-x86-64.lo \
elf64-alpha.lo \
elf64-hppa.lo \
elf64-ia64.lo \
elf64-gen.lo \
elf64-mips.lo \
elf64-mmix.lo \
elf64-sh64.lo \
elf64-ppc.lo \
elf64-s390.lo \
elf64-sparc.lo \
elf64.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pepigen.lo
BFD64_BACKENDS_CFILES = aix5ppc-core.c aout64.c coff-alpha.c coff64-rs6000.c demo64.c efi-app-ia64.c elf64-x86-64.c elf64-alpha.c elf64-hppa.c elf64-gen.c elf64-mips.c elf64-mmix.c elf64-ppc.c elf64-s390.c elf64-sh64.c elf64-sparc.c elf64.c mmo.c nlm32-alpha.c nlm64.c
BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
aout64.c \
coff-alpha.c \
coff64-rs6000.c \
demo64.c \
efi-app-ia64.c \
elf64-x86-64.c \
elf64-alpha.c \
elf64-hppa.c \
elf64-gen.c \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
elf64-s390.c \
elf64-sh64.c \
elf64-sparc.c \
elf64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c
OPTIONAL_BACKENDS = aix386-core.lo hpux-core.lo irix-core.lo lynx-core.lo osf-core.lo sco5-core.lo trad-core.lo cisco-core.lo
OPTIONAL_BACKENDS = \
aix386-core.lo \
hpux-core.lo \
irix-core.lo \
lynx-core.lo \
osf-core.lo \
sco5-core.lo \
trad-core.lo \
cisco-core.lo
OPTIONAL_BACKENDS_CFILES = aix386-core.c hpux-core.c irix-core.c lynx-core.c osf-core.c sco5-core.c trad-core.c cisco-core.c
OPTIONAL_BACKENDS_CFILES = \
aix386-core.c \
hpux-core.c \
irix-core.c \
lynx-core.c \
osf-core.c \
sco5-core.c \
trad-core.c \
cisco-core.c
# These are defined by configure.in:
@ -203,18 +663,33 @@ TDEFAULTS = @tdefaults@
INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
# C source files that correspond to .o's.
SOURCE_CFILES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) $(ALL_MACHINES_CFILES) $(BFD32_BACKENDS_CFILES) $(BFD64_BACKENDS_CFILES) $(OPTIONAL_BACKENDS_CFILES)
SOURCE_CFILES = \
$(BFD32_LIBS_CFILES) \
$(BFD64_LIBS_CFILES) \
$(ALL_MACHINES_CFILES) \
$(BFD32_BACKENDS_CFILES) \
$(BFD64_BACKENDS_CFILES) \
$(OPTIONAL_BACKENDS_CFILES)
BUILD_CFILES = elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
BUILD_CFILES = \
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
SOURCE_HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h xcoff-target.h version.h
SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \
elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \
xcoff-target.h version.h
BUILD_HFILES = elf32-target.h elf64-target.h targmatch.h
BUILD_HFILES = \
elf32-target.h elf64-target.h targmatch.h
HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
@ -244,7 +719,8 @@ libbfd_a_SOURCES =
BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
LOCAL_H_DEPS = libbfd.h sysdep.h config.h
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h
BFD64_H_FILES = archive64.c
LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
@ -252,7 +728,8 @@ LIBCOFF_H_FILES = libcoff-in.h coffcode.h
MOSTLYCLEANFILES = ofiles stamp-ofiles
CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
@ -287,7 +764,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@ -927,7 +1404,7 @@ cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h
cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h
cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h
cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h
cpu-dlx.lo: cpu-d30v.c $(INCDIR)/filenames.h
cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h
cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h
cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h
cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h
@ -1170,6 +1647,10 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \
@ -1269,7 +1750,7 @@ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-vax.lo: elf32-vax.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/libiberty.h elf32-target.h
elf32-target.h
elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \

View File

@ -346,6 +346,10 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
i[3456]86-*-nto-qnx*)
targ_defvec=bfd_elf32_i386qnx_vec
targ_selvecs=i386coff_vec
;;
i[3456]86-*-chorus*)
targ_defvec=bfd_elf32_i386_vec
;;

339
bfd/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -573,6 +573,7 @@ do
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf32_i386qnx_vec) tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;;
bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;

View File

@ -760,6 +760,22 @@ struct elf_backend_data
boolean (*elf_backend_write_section)
PARAMS ((bfd *, asection *, bfd_byte *));
/* This function, if defined, sets up the file positions for non PT_LOAD
segments, especially for segments containing non-allocated sections. */
void (*set_nonloadable_filepos)
PARAMS ((bfd *, Elf_Internal_Phdr *));
/* This function, if defined, returns true if the section is contained
within the segment. File positions are compared. */
boolean (*is_contained_by_filepos)
PARAMS ((asection *, Elf_Internal_Phdr *));
/* This function, if defined, returns true if copy_private_bfd_data
should be called. It provides a way of overriding default
test conditions in _bfd_elf_copy_private_section_data. */
boolean (*copy_private_bfd_data_p)
PARAMS ((bfd *, asection *, bfd *, asection *));
/* The level of IRIX compatibility we're striving for.
MIPS ELF specific function. */
irix_compat_t (*elf_backend_mips_irix_compat)

View File

@ -3477,8 +3477,9 @@ assign_file_positions_for_segments (abfd)
if (p->p_vaddr < (bfd_vma) off)
{
_bfd_error_handler (_("%s: Not enough room for program headers, try linking with -N"),
bfd_get_filename (abfd));
(*_bfd_error_handler)
(_("%s: Not enough room for program headers, try linking with -N"),
bfd_get_filename (abfd));
bfd_set_error (bfd_error_bad_value);
return false;
}
@ -3716,6 +3717,11 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a
}
}
/* If additional nonloadable filepos adjustments are required,
do them now. */
if (bed->set_nonloadable_filepos)
(*bed->set_nonloadable_filepos) (abfd, phdrs);
/* Clear out any program headers we allocated but did not use. */
for (; count < alloc; count++, p++)
{
@ -4274,6 +4280,7 @@ copy_private_bfd_data (ibfd, obfd)
bfd_vma maxpagesize;
struct elf_segment_map * phdr_adjust_seg = NULL;
unsigned int phdr_adjust_num = 0;
struct elf_backend_data * bed;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@ -4282,6 +4289,7 @@ copy_private_bfd_data (ibfd, obfd)
if (elf_tdata (ibfd)->phdr == NULL)
return true;
bed = get_elf_backend_data (ibfd);
iehdr = elf_elfheader (ibfd);
map_first = NULL;
@ -4309,6 +4317,13 @@ copy_private_bfd_data (ibfd, obfd)
&& (section->lma + section->_raw_size) \
<= SEGMENT_END (segment, base))
/* Returns true if the given section is contained within the
given segment. Filepos addresses are compared in an elf
backend function. */
#define IS_CONTAINED_BY_FILEPOS(sec, seg, bed) \
(bed->is_contained_by_filepos \
&& (*bed->is_contained_by_filepos) (sec, seg))
/* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */
#define IS_COREFILE_NOTE(p, s) \
(p->p_type == PT_NOTE \
@ -4337,13 +4352,15 @@ copy_private_bfd_data (ibfd, obfd)
2. It is an allocated segment,
3. There is an output section associated with it,
4. The section has not already been allocated to a previous segment. */
#define INCLUDE_SECTION_IN_SEGMENT(section, segment) \
#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \
(((((segment->p_paddr \
? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
: IS_CONTAINED_BY_VMA (section, segment)) \
|| IS_SOLARIS_PT_INTERP (segment, section)) \
&& (section->flags & SEC_ALLOC) != 0) \
|| IS_COREFILE_NOTE (segment, section)) \
|| IS_COREFILE_NOTE (segment, section) \
|| (IS_CONTAINED_BY_FILEPOS (section, segment, bed) \
&& (section->flags & SEC_ALLOC) == 0)) \
&& section->output_section != NULL \
&& section->segment_mark == false)
@ -4443,7 +4460,7 @@ copy_private_bfd_data (ibfd, obfd)
/* Compute how many sections might be placed into this segment. */
section_count = 0;
for (section = ibfd->sections; section != NULL; section = section->next)
if (INCLUDE_SECTION_IN_SEGMENT (section, segment))
if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
++section_count;
/* Allocate a segment map big enough to contain all of the
@ -4488,9 +4505,9 @@ copy_private_bfd_data (ibfd, obfd)
no sections, but ordinary, loadable segments should contain
something. */
if (segment->p_type == PT_LOAD)
_bfd_error_handler
(_("%s: warning: Empty loadable segment detected\n"),
bfd_archive_filename (ibfd));
(*_bfd_error_handler)
(_("%s: warning: Empty loadable segment detected\n"),
bfd_archive_filename (ibfd));
map->count = 0;
*pointer_to_map = map;
@ -4546,7 +4563,7 @@ copy_private_bfd_data (ibfd, obfd)
section != NULL;
section = section->next)
{
if (INCLUDE_SECTION_IN_SEGMENT (section, segment))
if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
{
output_section = section->output_section;
@ -4572,6 +4589,7 @@ copy_private_bfd_data (ibfd, obfd)
/* Match up the physical address of the segment with the
LMA address of the output section. */
if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr)
|| IS_CONTAINED_BY_FILEPOS (section, segment, bed)
|| IS_COREFILE_NOTE (segment, section))
{
if (matching_lma == 0)
@ -4641,7 +4659,7 @@ copy_private_bfd_data (ibfd, obfd)
}
/* Step Three: Loop over the sections again, this time assigning
those that fit to the current segment and remvoing them from the
those that fit to the current segment and removing them from the
sections array; but making sure not to leave large gaps. Once all
possible sections have been assigned to the current segment it is
added to the list of built segments and if sections still remain
@ -4692,7 +4710,7 @@ copy_private_bfd_data (ibfd, obfd)
maxpagesize then we need to start a new segment. */
if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size,
maxpagesize)
< BFD_ALIGN (output_section->lma, maxpagesize))
< BFD_ALIGN (output_section->lma, maxpagesize))
|| ((prev_sec->lma + prev_sec->_raw_size)
> output_section->lma))
{
@ -4805,6 +4823,7 @@ copy_private_bfd_data (ibfd, obfd)
#undef SEGMENT_END
#undef IS_CONTAINED_BY_VMA
#undef IS_CONTAINED_BY_LMA
#undef IS_CONTAINED_BY_FILEPOS
#undef IS_COREFILE_NOTE
#undef IS_SOLARIS_PT_INTERP
#undef INCLUDE_SECTION_IN_SEGMENT
@ -4824,6 +4843,7 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
asection *osec;
{
Elf_Internal_Shdr *ihdr, *ohdr;
const struct elf_backend_data *bed = get_elf_backend_data (ibfd);
if (ibfd->xvec->flavour != bfd_target_elf_flavour
|| obfd->xvec->flavour != bfd_target_elf_flavour)
@ -4833,24 +4853,31 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
This must be done here, rather than in the copy_private_bfd_data
entry point, because the latter is called after the section
contents have been set, which means that the program headers have
already been worked out. */
if (elf_tdata (obfd)->segment_map == NULL
&& elf_tdata (ibfd)->phdr != NULL)
already been worked out. The backend function provides a way to
override the test conditions and code path for the call to
copy_private_bfd_data. */
if (bed->copy_private_bfd_data_p)
{
asection *s;
if ((*bed->copy_private_bfd_data_p) (ibfd, isec, obfd, osec))
if (! copy_private_bfd_data (ibfd, obfd))
return false;
}
else if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
{
asection *s;
/* Only set up the segments if there are no more SEC_ALLOC
sections. FIXME: This won't do the right thing if objcopy is
used to remove the last SEC_ALLOC section, since objcopy
won't call this routine in that case. */
for (s = isec->next; s != NULL; s = s->next)
if ((s->flags & SEC_ALLOC) != 0)
break;
if (s == NULL)
{
if (! copy_private_bfd_data (ibfd, obfd))
return false;
}
/* Only set up the segments if there are no more SEC_ALLOC
sections. FIXME: This won't do the right thing if objcopy is
used to remove the last SEC_ALLOC section, since objcopy
won't call this routine in that case. */
for (s = isec->next; s != NULL; s = s->next)
if ((s->flags & SEC_ALLOC) != 0)
break;
if (s == NULL)
{
if (! copy_private_bfd_data (ibfd, obfd))
return false;
}
}
ihdr = &elf_section_data (isec)->this_hdr;

View File

@ -3146,4 +3146,6 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
#define elf_backend_relocate_section elf_i386_relocate_section
#define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections
#ifndef ELF32_I386_C_INCLUDED
#include "elf32-target.h"
#endif

111
bfd/elf32-i386qnx.c Normal file
View File

@ -0,0 +1,111 @@
/* Intel 80386/80486 QNX specific support for 32-bit ELF
Copyright 2002
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. */
#define ELF32_I386_C_INCLUDED
#include "elf32-i386.c"
/* Returns the end address of the segment + 1. */
#define SEGMENT_END(segment, start) \
(start + (segment->p_memsz > segment->p_filesz \
? segment->p_memsz : segment->p_filesz))
static boolean elf_i386qnx_copy_private_bfd_data_p
PARAMS ((bfd *, asection *, bfd *, asection *));
static boolean elf_i386qnx_is_contained_by_filepos
PARAMS ((asection *, Elf_Internal_Phdr *));
static void elf_i386qnx_set_nonloadable_filepos
PARAMS ((bfd *, Elf_Internal_Phdr *));
static boolean
elf_i386qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
bfd *ibfd;
asection *isec;
bfd *obfd;
asection *osec;
{
/* We don't use these parameters, but another target might. */
ibfd = ibfd;
obfd = obfd;
osec = osec;
return isec->next == NULL;
}
static boolean
elf_i386qnx_is_contained_by_filepos (section, segment)
asection *section;
Elf_Internal_Phdr *segment;
{
return ((bfd_vma) section->filepos >= segment->p_offset
&& ((bfd_vma) section->filepos + section->_raw_size
<= SEGMENT_END (segment, segment->p_offset)));
}
static void
elf_i386qnx_set_nonloadable_filepos (abfd, phdrs)
bfd *abfd;
Elf_Internal_Phdr *phdrs;
{
struct elf_segment_map *m;
Elf_Internal_Phdr *p;
file_ptr off = 0;
for (m = elf_tdata (abfd)->segment_map, p = phdrs;
m != NULL;
m = m->next, p++)
{
unsigned int i;
asection **secpp;
for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
{
asection *sec;
sec = *secpp;
if (p->p_type == PT_LOAD)
off = sec->filepos;
else
{
if (i == 0)
{
if (sec->filepos)
p->p_offset = sec->filepos;
else
p->p_offset = off;
}
if (!sec->filepos)
{
off += sec->_raw_size;
p->p_filesz += sec->_raw_size;
}
}
}
}
return;
}
#undef TARGET_LITTLE_SYM
#define TARGET_LITTLE_SYM bfd_elf32_i386qnx_vec
#define elf_backend_set_nonloadable_filepos elf_i386qnx_set_nonloadable_filepos
#define elf_backend_is_contained_by_filepos elf_i386qnx_is_contained_by_filepos
#define elf_backend_copy_private_bfd_data_p elf_i386qnx_copy_private_bfd_data_p
#include "elf32-target.h"

View File

@ -378,6 +378,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_write_section
#define elf_backend_write_section NULL
#endif
#ifndef elf_backend_set_nonloadable_filepos
#define elf_backend_set_nonloadable_filepos NULL
#endif
#ifndef elf_backend_is_contained_by_filepos
#define elf_backend_is_contained_by_filepos NULL
#endif
#ifndef elf_backend_copy_private_bfd_data_p
#define elf_backend_copy_private_bfd_data_p NULL
#endif
#ifndef elf_backend_mips_irix_compat
#define elf_backend_mips_irix_compat NULL
#endif
@ -479,6 +488,9 @@ static const struct elf_backend_data elfNN_bed =
elf_backend_discard_info,
elf_backend_ignore_discarded_relocs,
elf_backend_write_section,
elf_backend_set_nonloadable_filepos,
elf_backend_is_contained_by_filepos,
elf_backend_copy_private_bfd_data_p,
elf_backend_mips_irix_compat,
elf_backend_mips_rtype_to_howto,
elf_backend_ecoff_debug_swap,

View File

@ -514,6 +514,7 @@ extern const bfd_target bfd_elf32_hppa_linux_vec;
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_vec;
extern const bfd_target bfd_elf32_i386qnx_vec;
extern const bfd_target bfd_elf32_i860_little_vec;
extern const bfd_target bfd_elf32_i860_vec;
extern const bfd_target bfd_elf32_i960_vec;
@ -766,6 +767,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_hppa_vec,
&bfd_elf32_i370_vec,
&bfd_elf32_i386_vec,
&bfd_elf32_i386qnx_vec,
&bfd_elf32_i860_little_vec,
&bfd_elf32_i860_vec,
&bfd_elf32_i960_vec,