binutils-gdb/bfd
Ian Lance Taylor 374d2ef905 Add support for creating shared libraries under i386 ELF and SPARC
ELF.  Based on patches by Eric Youngdale <ericy@cais.cais.com>.
	* libelf.h (struct elf_link_hash_entry): Remove copy_offset field.
	Add got_offset and plt_offset fields.
	(ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define.
	(ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define.
	(ELF_LINK_HASH_NEEDS_COPY): Define.
	(struct elf_backend_data): Add check_relocs field.
	(struct bfd_elf_section_data): Change relocs from PTR to
	Elf_Internal_Rela *.
	(struct elf_obj_tdata): Add local_got_offsets field.
	(elf_local_got_offsets): Define accessor macro.
	(bfd_elf32_link_create_dynamic_sections): Declare.
	(bfd_elf32_link_record_dynamic_symbol): Declare.
	(bfd_elf64_link_create_dynamic_sections): Declare.
	(bfd_elf64_link_record_dynamic_symbol): Declare.
	* elfcode.h (elf_slurp_reloc_table): Don't use the section data
	relocs field.
	(elf_link_record_dynamic_symbol): Make globally visible.  Use
	macro to rename to NAME(bfd_elf,link_record_dynamic_symbol).
	(elf_link_add_object_symbols): If creating a shared library, put
	make all local symbols dynamic.  Don't bother with the
	DYNAMIC_MULTIPLE flags.  Call the check_relocs backend function if
	it is defined.
	(elf_link_create_dynamic_sections): Make globally visible.  Use
	macro to rename to NAME(bfd_elf,link_create_dynamic_sections).  If
	creating a shared library, make sure that _DYNAMIC is added as a
	dynamic symbol.
	(elf_link_read_relocs): New function.
	(NAME(bfd_elf,record_link_assignment)): If creating a shared
	library, always create symbols, and always make them dynamic.
	(elf_bfd_final_link): Permit creation of shared libraries.
	(elf_link_input_bfd): Use elf_link_read_relocs to get the relocs.
	* elf.c (_bfd_elf_link_hash_newfunc): Don't initialize
	copy_offset.  Initialize got_offset and plt_offset.
	* elf32-target.h (elf_backend_check_relocs): Define as 0 if not
	defined.
	(elf32_bed): Initialize check_relocs field.
	* elf64-target.h (elf_backend_check_relocs): Define as 0 if not
	defined.
	(elf64_bed): Initialize check_relocs field.
	* elf32-i386.c (elf_howto_table): Change R_386_PLT32 and
	R_386_GOTPC to be pc_relative and pcrel_offset.
	(elf_i386_pic_plt0_entry): Define.
	(elf_i386_pic_plt_entry): Define.
	(elf_i386_create_dynamic_sections): Create a .got.plt section, and
	define _GLOBAL_OFFSET_TABLE_ at the start of it.  If creating a
	shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
	dynamic symbol.  Don't create .rel.bss if creating a shared
	library.
	(elf_i386_check_relocs): New function.
	(elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the
	symbol already has one.  When making a PLT entry, set plt_offset.
	Don't create a copy reloc when creating a shared library.  Don't
	set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
	(elf_i386_allocate_dynamic_section): Remove.
	(elf_i386_size_dynamic_sections): Look through all the sections
	rather than assuming we know their names.  Remove any empty reloc
	or plt sections.  Only add a DT_DEBUG entry if not creating a
	shared library.  Only add a DT_PLTGOT entry if there is a PLT.
	Add a DT_TEXTREL entry if required.
	(elf_i386_relocate_section): Permit undefined symbols when
	creating a shared library.  Handle the special relocation types
	specially.
	(elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset
	is set.  If creating a shared library, produce a PIC PLT entry.
	Only mark a PLT symbol as undefined if it was not defined by a
	regular object file.  Create a GOT entry if got_offset is set.
	Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
	(elf_i386_finish_dynamic_sections): Change the handling of
	DT_RELSZ to simply subtract out the size of .rel.plt.  If creating
	a shared library, produce PIC PLT code.
	(elf_backend_check_relocs): Define.
	* elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10,
	R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow.
	(elf32_sparc_create_dynamic_sections): If creating a shared
	library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
        dynamic symbol, and set the type to STT_OBJECT.  Likewise for
        _PROCEDURE_LINKAGE_TABLE_.  Don't create .rel.bss if creating a
        shared library.
	(elf32_sparc_check_relocs): New function.
	(elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the
	symbol already has one.  When making a PLT entry, set plt_offset.
	Don't create a copy reloc when creating a shared library.  Don't
	set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
	(elf32_sparc_allocate_dynamic_section): Remove.
	(elf32_sparc_size_dynamic_sections): Look through all the sections
	rather than assuming we know their names.  Only add a DT_DEBUG
	entry if not creating a shared library.  Add a DT_TEXTREL entry if
	required.
	(elf32_sparc_relocate_section): Permit undefined symbols when
	creating a shared library.  Handle the special relocation types
	specially.
	(elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset
	is set.  Only mark a PLT symbol as undefined if it was not defined
	by a regular object file.  Create a GOT entry if got_offset is
	set.  Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
	(elf32_sparc_finish_dynamic_sections): Store dynobj in a local
	variable.
	(elf_backend_check_relocs): Define.
1994-07-26 17:18:37 +00:00
..
doc * bfd.texinfo: Added Hash Tables node. 1994-01-03 16:48:24 +00:00
hosts Update to reflect comings and goings of ns32k and mach-related files 1994-07-25 20:04:11 +00:00
.Sanitize Update to reflect comings and goings of ns32k and mach-related files 1994-07-25 20:04:11 +00:00
COPYING
ChangeLog Add support for creating shared libraries under i386 ELF and SPARC 1994-07-26 17:18:37 +00:00
ChangeLog.1 Split ChangeLog into two. 1993-11-23 08:06:20 +00:00
ChangeLog.mpw * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_in) [MPW_C]: 1994-06-30 00:20:40 +00:00
Makefile.in * configure.in (pc532mach_vec): Change to pc532machaout_vec. 1994-07-25 20:00:10 +00:00
PORTING
TODO
VERSION * Makefile.in (diststuff): New target. 1993-11-15 20:10:49 +00:00
aix386-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
aout-adobe.c * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector. 1994-04-07 01:58:27 +00:00
aout-encap.c * aout-encap.c (ARCH): Don't define. Obsolete. 1994-07-12 15:46:32 +00:00
aout-ns32k.h NS32K changes from Ian Dall. 1994-07-14 21:35:54 +00:00
aout-target.h Comment change. 1994-06-20 15:30:56 +00:00
aout0.c For PR 1927. 1994-05-04 19:37:36 +00:00
aout32.c
aout64.c
aoutf1.h * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a 1994-06-13 18:25:12 +00:00
aoutx.h * aoutx.h (NAME(aout,some_aout_object_p)): Just check 1994-07-22 15:13:33 +00:00
archive.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
archures.c doc cleanup 1993-11-05 19:51:52 +00:00
bfd-in.h * libelf.h (struct elf_obj_tdata): New field dt_needed_name. 1994-06-16 00:01:32 +00:00
bfd-in2.h * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath 1994-07-20 19:51:18 +00:00
bfd.c * targets.c (bfd_target): Add _bfd_free_cached_info field. 1994-04-01 17:55:47 +00:00
bout.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
cache.c Modified Files: 1994-02-28 23:49:08 +00:00
cf-i386lynx.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
cf-m68klynx.c * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by 1994-04-29 19:09:51 +00:00
cf-sparclynx.c A number of minor Lynx-related changes, plus basic Sparc Lynx support. 1993-10-29 02:01:43 +00:00
cisco-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-a29k.c * section.c (bfd_abs_section): Make const. 1994-06-21 16:47:07 +00:00
coff-alpha.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coff-apollo.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-go32.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coff-h8300.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coff-h8500.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coff-i386.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-i960.c * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR. 1994-06-10 17:27:22 +00:00
coff-m68k.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-m88k.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-mips.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coff-rs6000.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-sh.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coff-sparc.c * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare 1994-06-15 19:54:15 +00:00
coff-u68k.c
coff-we32k.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
coff-z8k.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coffcode.h * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from 1994-05-10 18:29:19 +00:00
coffgen.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
coffswap.h * coffcode.h (bfd_coff_backend_data): Added new arguments to 1994-02-01 17:11:56 +00:00
config.bfd NS32K changes from Ian Dall. 1994-07-14 21:35:54 +00:00
configure.bat changes from gas-2.3/binutils-2.4 dist (details in branch log msgs, changelogs) 1994-05-27 16:58:05 +00:00
configure.host NS32K changes from Ian Dall. 1994-07-14 21:35:54 +00:00
configure.in unsanitize v9 1994-06-15 22:10:50 +00:00
core.c * Most files: 1994-03-15 15:13:13 +00:00
cpu-a29k.c * Most files: 1994-03-15 15:13:13 +00:00
cpu-alpha.c
cpu-h8300.c
cpu-h8500.c
cpu-hppa.c
cpu-i386.c
cpu-i960.c
cpu-m88k.c
cpu-rs6000.c
cpu-vax.c
cpu-we32k.c
cpu-z8k.c
ctor.c * Most files: 1994-03-15 15:13:13 +00:00
demo64.c
dep-in.sed Make "make dep" easier to work with. Updated lots of dependencies. 1993-10-13 19:04:08 +00:00
ecoff.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
ecofflink.c * coff-mips.c (mips_relocate_section): When relaxing, adjust local 1994-04-15 18:35:32 +00:00
ecoffswap.h * ecoff.c (ecoff_swap_tir_in): Change input argument to const. 1994-06-20 18:26:55 +00:00
elf.c * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to 1994-07-22 18:53:23 +00:00
elf32-hppa.c * bfd-in2.h: Rebuilt. 1994-05-16 19:34:13 +00:00
elf32-hppa.h * bfd-in2.h: Rebuilt. 1994-05-16 19:34:13 +00:00
elf32-i386.c * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to 1994-07-22 18:53:23 +00:00
elf32-mips.c * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c, 1994-06-20 19:39:15 +00:00
elf32-sparc.c * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to 1994-07-22 18:53:23 +00:00
elf32-target.h Add support for creating shared libraries under i386 ELF and SPARC 1994-07-26 17:18:37 +00:00
elf32.c
elf64-gen.c
elf64-sparc.c
elf64-target.h Add support for creating shared libraries under i386 ELF and SPARC 1994-07-26 17:18:37 +00:00
elf64.c
elfcode.h Add support for creating shared libraries under i386 ELF and SPARC 1994-07-26 17:18:37 +00:00
filemode.c
format.c * format.c (bfd_check_format_matches): Put the new entry in the 1994-01-26 21:53:55 +00:00
gen-aout.c
genlink.h Added new files for linker support, and removed old seclet files. 1993-12-30 20:03:34 +00:00
hash.c Make all callers of malloc or realloc (including via obstacks) 1994-02-12 00:45:54 +00:00
host-aout.c
hp300bsd.c
hp300hpux.c * hp300hpux.c (MY_final_link_callback): Define to avoid warning. 1994-06-20 15:11:34 +00:00
hppa_stubs.h * Support code for enabling the new style linker for PA ELF. 1994-07-01 19:00:17 +00:00
hppabsd-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
hpux-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
i386aout.c
i386bsd.c
i386dynix.c * i386dynix.c, config/i386-dynix.mt: New files, handling Dynix 1994-03-30 08:53:45 +00:00
i386linux.c Thu Jun 16 14:25:22 1994 Eric Youngdale (ericy@cais.cais.com) 1994-06-16 18:29:21 +00:00
i386lynx.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
i386mach3.c * i386mach3.c (N_TXTADDR): Don't define after all. 1993-12-31 21:11:49 +00:00
i386os9k.c * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector. 1994-04-07 01:58:27 +00:00
ieee.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
init.c doc cleanup 1993-11-05 19:51:52 +00:00
irix-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
libaout.h * libaout.h (struct aoutdata): Add q_magic_format to subformat 1994-06-14 22:04:54 +00:00
libbfd-in.h * libbfd-in.h (bfd_realloc): Change last arg to "size_t size". 1994-06-05 19:03:08 +00:00
libbfd.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
libbfd.h * libbfd.h (bfd_realloc): Change last arg to "size_t size". 1994-06-03 17:01:17 +00:00
libcoff-in.h Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) 1994-03-30 22:15:07 +00:00
libcoff.h Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) 1994-03-30 22:15:07 +00:00
libecoff.h * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c, 1994-06-20 19:39:15 +00:00
libelf.h Add support for creating shared libraries under i386 ELF and SPARC 1994-07-26 17:18:37 +00:00
libhppa.h Fix typo in last check-in. 1994-05-16 16:35:36 +00:00
libieee.h
libnlm.h * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr 1994-04-21 16:13:01 +00:00
liboasys.h
linker.c linker.c (FAIL): Undefine macro before defining as enum. 1994-06-23 00:10:06 +00:00
lynx-core.c * Makefile.in (OPTIONAL_BACKENDS): Add lynx-core.o. 1993-09-22 14:54:50 +00:00
m68klynx.c * aout-encap.c (ARCH): Don't define. Obsolete. 1994-07-12 15:46:32 +00:00
m88kmach3.c Mach 3 support. 1994-07-05 21:50:43 +00:00
makefile.dos changes from gas-2.3/binutils-2.4 dist (details in branch log msgs, changelogs) 1994-05-27 16:58:05 +00:00
mipsbsd.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
mpw-config.in * mpw-config.in: Use sed instead of StreamEdit, add definitions 1994-06-26 23:00:20 +00:00
mpw-make.in * mpw-config.in: Use sed instead of StreamEdit, add definitions 1994-06-26 23:00:20 +00:00
netbsd386.c * aout-encap.c (ARCH): Don't define. Obsolete. 1994-07-12 15:46:32 +00:00
netbsd532.c NS32K changes from Ian Dall. 1994-07-14 21:35:54 +00:00
newsos3.c
nlm-target.h * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector. 1994-04-07 01:58:27 +00:00
nlm.c
nlm32-alpha.c An annoying typo (faflse instead of false). Oopsie. 1994-03-28 23:03:21 +00:00
nlm32-i386.c * libbfd.c (bfd_read): Set bfd_error as appropriate for a short 1994-03-26 18:28:29 +00:00
nlm32-ppc.c start-sanitize-powerpc-netware 1994-04-20 18:38:22 +00:00
nlm32-sparc.c * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol 1994-03-31 19:05:03 +00:00
nlm32.c
nlm64.c
nlmcode.h * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
nlmswap.h * nlmswap.h: Declare functions. 1993-12-02 02:19:25 +00:00
oasys.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
opncls.c Make all callers of malloc or realloc (including via obstacks) 1994-02-12 00:45:54 +00:00
osf-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
pc532-mach.c NS32K changes from Ian Dall. 1994-07-14 21:35:54 +00:00
ptrace-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00
reloc.c NS32K changes from Ian Dall. 1994-07-14 21:35:54 +00:00
reloc16.c * bout.c (calljx_callback, callj_callback): Use get_value to get 1994-01-24 18:05:08 +00:00
rs6000-core.c * coff-rs6000.c: Add Lynx core file support, use HOST_AIX, where 1994-02-15 01:28:16 +00:00
section.c * Most files: 1994-03-15 15:13:13 +00:00
som.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
som.h * som.h (R_HPPA_COMPLEX): Define. 1994-07-05 01:19:31 +00:00
sparclynx.c * sparclynx.c: Setup appropriate macros to enable core file 1994-01-22 20:27:55 +00:00
srec.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
stab-syms.c
sunos.c * sunos.c (sunos_add_one_symbol): Treat a common symbol from a 1994-06-17 18:47:50 +00:00
syms.c * Most files: 1994-03-15 15:13:13 +00:00
targets.c unsanitize v9 1994-06-15 22:10:50 +00:00
tekhex.c * Many files: change all bfd_target vectors to be const. Change 1994-06-20 21:55:45 +00:00
trad-core.c * targets.c (bfd_target): Rearranged fields in target vector. 1994-04-06 22:00:40 +00:00