* emultempl/aix.em: Convert to C90, remove unnecessary prototypes
and casts. Replace PTR with void *. Formatting. * emultempl/alphaelf.em: Likewise * emultempl/armcoff.em: Likewise * emultempl/armelf.em: Likewise * emultempl/armelf_oabi.em: Likewise * emultempl/beos.em: Likewise * emultempl/elf32.em: Likewise * emultempl/generic.em: Likewise * emultempl/gld960.em: Likewise * emultempl/gld960c.em: Likewise * emultempl/hppaelf.em: Likewise * emultempl/linux.em: Likewise * emultempl/lnk960.em: Likewise * emultempl/m68hc1xelf.em: Likewise * emultempl/m68kcoff.em: Likewise * emultempl/m68kelf.em: Likewise * emultempl/mipsecoff.em: Likewise * emultempl/mipself.em: Likewise * emultempl/mmix-elfnmmo.em: Likewise * emultempl/mmixelf.em: Likewise * emultempl/mmo.em: Likewise * emultempl/needrelax.em: Likewise * emultempl/netbsd.em: Likewise * emultempl/pe.em: Likewise * emultempl/sh64elf.em: Likewise * emultempl/sunos.em: Likewise * emultempl/ticoff.em: Likewise * emultempl/vanilla.em: Likewise * emultempl/xtensaelf.em: Likewise * Makefile.am: Correct dependencies. * Makefile.in: Regenerate.
This commit is contained in:
parent
a9232bb265
commit
0c7a8e5acd
35
ld/ChangeLog
35
ld/ChangeLog
|
@ -1,3 +1,38 @@
|
|||
2003-06-27 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* emultempl/aix.em: Convert to C90, remove unnecessary prototypes
|
||||
and casts. Replace PTR with void *. Formatting.
|
||||
* emultempl/alphaelf.em: Likewise
|
||||
* emultempl/armcoff.em: Likewise
|
||||
* emultempl/armelf.em: Likewise
|
||||
* emultempl/armelf_oabi.em: Likewise
|
||||
* emultempl/beos.em: Likewise
|
||||
* emultempl/elf32.em: Likewise
|
||||
* emultempl/generic.em: Likewise
|
||||
* emultempl/gld960.em: Likewise
|
||||
* emultempl/gld960c.em: Likewise
|
||||
* emultempl/hppaelf.em: Likewise
|
||||
* emultempl/linux.em: Likewise
|
||||
* emultempl/lnk960.em: Likewise
|
||||
* emultempl/m68hc1xelf.em: Likewise
|
||||
* emultempl/m68kcoff.em: Likewise
|
||||
* emultempl/m68kelf.em: Likewise
|
||||
* emultempl/mipsecoff.em: Likewise
|
||||
* emultempl/mipself.em: Likewise
|
||||
* emultempl/mmix-elfnmmo.em: Likewise
|
||||
* emultempl/mmixelf.em: Likewise
|
||||
* emultempl/mmo.em: Likewise
|
||||
* emultempl/needrelax.em: Likewise
|
||||
* emultempl/netbsd.em: Likewise
|
||||
* emultempl/pe.em: Likewise
|
||||
* emultempl/sh64elf.em: Likewise
|
||||
* emultempl/sunos.em: Likewise
|
||||
* emultempl/ticoff.em: Likewise
|
||||
* emultempl/vanilla.em: Likewise
|
||||
* emultempl/xtensaelf.em: Likewise
|
||||
* Makefile.am: Correct dependencies.
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2003-06-25 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* ld.texinfo: Correct spelling of "relocatable".
|
||||
|
|
|
@ -637,38 +637,42 @@ eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
|
|||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
|
||||
eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
|
||||
eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
|
||||
eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
|
||||
eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
|
||||
eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)"
|
||||
eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
|
||||
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)"
|
||||
eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
|
||||
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)"
|
||||
eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
|
||||
eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
|
||||
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
|
||||
eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
|
||||
|
@ -676,10 +680,11 @@ eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
|
|||
${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
|
||||
eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
|
||||
$(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
|
||||
eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
|
||||
eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
|
||||
|
@ -704,6 +709,7 @@ eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \
|
|||
${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)"
|
||||
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
|
||||
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
|
||||
eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
|
||||
|
@ -970,16 +976,20 @@ elnk960.c: $(srcdir)/emulparams/lnk960.sh \
|
|||
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
|
||||
em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
|
||||
em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
|
||||
em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
|
||||
em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
|
||||
em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
|
||||
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
|
||||
|
|
|
@ -1363,38 +1363,42 @@ eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
|
|||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
|
||||
eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
|
||||
eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
|
||||
eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
|
||||
eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
|
||||
eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)"
|
||||
eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
|
||||
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)"
|
||||
eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
|
||||
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)"
|
||||
eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
|
||||
eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
|
||||
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
|
||||
eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
|
||||
|
@ -1402,10 +1406,11 @@ eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
|
|||
${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
|
||||
eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
|
||||
$(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
|
||||
eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
|
||||
eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
|
||||
|
@ -1430,6 +1435,7 @@ eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \
|
|||
${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)"
|
||||
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
|
||||
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(srcdir)/emultempl/mipself.em \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
|
||||
eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
|
||||
|
@ -1696,16 +1702,20 @@ elnk960.c: $(srcdir)/emulparams/lnk960.sh \
|
|||
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
|
||||
em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
|
||||
em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
|
||||
em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
|
||||
em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
|
||||
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
$(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
|
||||
$(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
|
||||
${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
|
||||
em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
|
||||
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
|
||||
|
|
|
@ -56,40 +56,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "libcoff.h"
|
||||
#include "libxcoff.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse
|
||||
PARAMS ((void));
|
||||
static bfd_boolean gld${EMULATION_NAME}_parse_args
|
||||
PARAMS ((int, char **));
|
||||
static void gld${EMULATION_NAME}_add_options
|
||||
PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
static bfd_boolean gld${EMULATION_NAME}_handle_option
|
||||
PARAMS ((int));
|
||||
static void gld${EMULATION_NAME}_after_open
|
||||
PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_choose_target
|
||||
PARAMS ((int, char **));
|
||||
static void gld${EMULATION_NAME}_before_allocation
|
||||
PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_read_file
|
||||
PARAMS ((const char *, bfd_boolean));
|
||||
static void gld${EMULATION_NAME}_free
|
||||
PARAMS ((PTR));
|
||||
static void gld${EMULATION_NAME}_find_relocs
|
||||
PARAMS ((lang_statement_union_type *));
|
||||
static void gld${EMULATION_NAME}_find_exp_assignment
|
||||
PARAMS ((etree_type *));
|
||||
static char *gld${EMULATION_NAME}_get_script
|
||||
PARAMS ((int *isfile));
|
||||
static bfd_boolean gld${EMULATION_NAME}_unrecognized_file
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static void gld${EMULATION_NAME}_create_output_section_statements
|
||||
PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_set_output_arch
|
||||
PARAMS ((void));
|
||||
static int is_syscall
|
||||
PARAMS ((char *, unsigned int *));
|
||||
static int change_symbol_mode
|
||||
PARAMS ((char *));
|
||||
static void gld${EMULATION_NAME}_read_file (const char *, bfd_boolean);
|
||||
static void gld${EMULATION_NAME}_free (void *);
|
||||
static void gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *);
|
||||
static void gld${EMULATION_NAME}_find_exp_assignment (etree_type *);
|
||||
|
||||
|
||||
/* The file alignment required for each section. */
|
||||
static unsigned long file_align;
|
||||
|
@ -160,7 +131,7 @@ static char *command_line_blibpath = NULL;
|
|||
/* This routine is called before anything else is done. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
if (arch)
|
||||
|
@ -210,13 +181,9 @@ enum
|
|||
};
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns;
|
||||
char **shortopts;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
gld${EMULATION_NAME}_add_options
|
||||
(int ns, char **shortopts, int nl, struct option **longopts,
|
||||
int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static const char xtra_short[] = "D:H:KT:z";
|
||||
static const struct option xtra_long[] = {
|
||||
|
@ -291,15 +258,13 @@ gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longo
|
|||
|
||||
*shortopts = (char *) xrealloc (*shortopts, ns + sizeof (xtra_short));
|
||||
memcpy (*shortopts + ns, &xtra_short, sizeof (xtra_short));
|
||||
*longopts = (struct option *)
|
||||
xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
|
||||
*longopts = xrealloc (*longopts,
|
||||
nl * sizeof (struct option) + sizeof (xtra_long));
|
||||
memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_parse_args (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
gld${EMULATION_NAME}_parse_args (int argc, char **argv)
|
||||
{
|
||||
int indx;
|
||||
|
||||
|
@ -327,8 +292,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
|
|||
}
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_handle_option (optc)
|
||||
int optc;
|
||||
gld${EMULATION_NAME}_handle_option (int optc)
|
||||
{
|
||||
bfd_signed_vma val;
|
||||
const char *end;
|
||||
|
@ -570,8 +534,7 @@ gld${EMULATION_NAME}_handle_option (optc)
|
|||
as an import file. This is for AIX compatibility. */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_unrecognized_file (entry)
|
||||
lang_input_statement_type *entry;
|
||||
gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry)
|
||||
{
|
||||
FILE *e;
|
||||
bfd_boolean ret;
|
||||
|
@ -607,7 +570,7 @@ gld${EMULATION_NAME}_unrecognized_file (entry)
|
|||
/* This is called after the input files have been opened. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
bfd_boolean r;
|
||||
struct set_info *p;
|
||||
|
@ -652,7 +615,7 @@ gld${EMULATION_NAME}_after_open ()
|
|||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation ()
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
struct filelist *fl;
|
||||
struct export_symbol_list *el;
|
||||
|
@ -834,9 +797,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_choose_target (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
gld${EMULATION_NAME}_choose_target (int argc, char **argv)
|
||||
{
|
||||
int i, j, jmax;
|
||||
static char *from_outside;
|
||||
|
@ -871,8 +832,7 @@ gld${EMULATION_NAME}_choose_target (argc, argv)
|
|||
1 : state changed
|
||||
0 : no change */
|
||||
static int
|
||||
change_symbol_mode (input)
|
||||
char *input;
|
||||
change_symbol_mode (char *input)
|
||||
{
|
||||
char *symbol_mode_string[] = {
|
||||
"# 32", /* 0x01 */
|
||||
|
@ -906,9 +866,7 @@ change_symbol_mode (input)
|
|||
0 : ignore
|
||||
-1 : error, try something else */
|
||||
static int
|
||||
is_syscall (input, flag)
|
||||
char *input;
|
||||
unsigned int *flag;
|
||||
is_syscall (char *input, unsigned int *flag)
|
||||
{
|
||||
unsigned int bit;
|
||||
char *string;
|
||||
|
@ -958,9 +916,7 @@ is_syscall (input, flag)
|
|||
this is called by the handle_option emulation routine. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_read_file (filename, import)
|
||||
const char *filename;
|
||||
bfd_boolean import;
|
||||
gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import)
|
||||
{
|
||||
struct obstack *o;
|
||||
FILE *f;
|
||||
|
@ -1201,8 +1157,7 @@ gld${EMULATION_NAME}_read_file (filename, import)
|
|||
/* This routine saves us from worrying about declaring free. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_free (p)
|
||||
PTR p;
|
||||
gld${EMULATION_NAME}_free (void *p)
|
||||
{
|
||||
free (p);
|
||||
}
|
||||
|
@ -1212,8 +1167,7 @@ gld${EMULATION_NAME}_free (p)
|
|||
to symbols. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_relocs (s)
|
||||
lang_statement_union_type *s;
|
||||
gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *s)
|
||||
{
|
||||
if (s->header.type == lang_reloc_statement_enum)
|
||||
{
|
||||
|
@ -1233,8 +1187,7 @@ gld${EMULATION_NAME}_find_relocs (s)
|
|||
/* Look through an expression for an assignment statement. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_exp_assignment (exp)
|
||||
etree_type *exp;
|
||||
gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
|
||||
{
|
||||
struct bfd_link_hash_entry *h;
|
||||
|
||||
|
@ -1278,8 +1231,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -1332,7 +1284,7 @@ fi
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_create_output_section_statements ()
|
||||
gld${EMULATION_NAME}_create_output_section_statements (void)
|
||||
{
|
||||
/* __rtinit */
|
||||
if ((bfd_get_flavour (output_bfd) == bfd_target_xcoff_flavour)
|
||||
|
@ -1371,7 +1323,7 @@ gld${EMULATION_NAME}_create_output_section_statements ()
|
|||
}
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_set_output_arch ()
|
||||
gld${EMULATION_NAME}_set_output_arch (void)
|
||||
{
|
||||
bfd_set_arch_mach (output_bfd,
|
||||
bfd_xcoff_architecture (output_bfd),
|
||||
|
|
|
@ -27,16 +27,13 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
#include "elf/alpha.h"
|
||||
#include "elf-bfd.h"
|
||||
|
||||
static void alpha_after_parse PARAMS ((void));
|
||||
static void alpha_finish PARAMS ((void));
|
||||
|
||||
static int elf64alpha_32bit = 0;
|
||||
|
||||
/* Set the start address as in the Tru64 ld. */
|
||||
#define ALPHA_TEXT_START_32BIT 0x12000000
|
||||
|
||||
static void
|
||||
alpha_after_parse ()
|
||||
alpha_after_parse (void)
|
||||
{
|
||||
if (elf64alpha_32bit && !link_info.shared && !link_info.relocatable)
|
||||
lang_section_start (".interp",
|
||||
|
@ -46,7 +43,7 @@ alpha_after_parse ()
|
|||
}
|
||||
|
||||
static void
|
||||
alpha_finish ()
|
||||
alpha_finish (void)
|
||||
{
|
||||
if (elf64alpha_32bit)
|
||||
elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
|
||||
|
|
|
@ -40,18 +40,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
static void gld${EMULATION_NAME}_add_options
|
||||
PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
|
||||
static bfd_boolean gld${EMULATION_NAME}_handle_option PARAMS ((int));
|
||||
static void gld${EMULATION_NAME}_finish PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
|
||||
/* If TRUE, then interworking stubs which support calls to old, non-interworking
|
||||
aware ARM code should be generated. */
|
||||
/* If TRUE, then interworking stubs which support calls to old,
|
||||
non-interworking aware ARM code should be generated. */
|
||||
|
||||
static int support_old_code = 0;
|
||||
static char * thumb_entry_symbol = NULL;
|
||||
|
@ -60,13 +50,10 @@ static char * thumb_entry_symbol = NULL;
|
|||
#define OPTION_THUMB_ENTRY 301
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns ATTRIBUTE_UNUSED;
|
||||
char **shortopts ATTRIBUTE_UNUSED;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
gld${EMULATION_NAME}_add_options
|
||||
(int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
|
||||
struct option **longopts, int nrl ATTRIBUTE_UNUSED,
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static const struct option xtra_long[] = {
|
||||
{"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
|
||||
|
@ -74,22 +61,20 @@ gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longo
|
|||
{NULL, no_argument, NULL, 0}
|
||||
};
|
||||
|
||||
*longopts = (struct option *)
|
||||
xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
|
||||
*longopts = xrealloc (*longopts,
|
||||
nl * sizeof (struct option) + sizeof (xtra_long));
|
||||
memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
|
||||
}
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_list_options (file)
|
||||
FILE * file;
|
||||
gld${EMULATION_NAME}_list_options (FILE *file)
|
||||
{
|
||||
fprintf (file, _(" --support-old-code Support interworking with old code\n"));
|
||||
fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"));
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_handle_option (optc)
|
||||
int optc;
|
||||
gld${EMULATION_NAME}_handle_option (int optc)
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
|
@ -104,12 +89,12 @@ gld${EMULATION_NAME}_handle_option (optc)
|
|||
thumb_entry_symbol = optarg;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_set_output_arch ("`echo ${ARCH}`");
|
||||
|
@ -120,7 +105,7 @@ gld${EMULATION_NAME}_before_parse ()
|
|||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation ()
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
/* we should be able to set the size of the interworking stub section */
|
||||
|
||||
|
@ -143,7 +128,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
}
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
|
||||
{
|
||||
|
@ -154,7 +139,7 @@ gld${EMULATION_NAME}_after_open ()
|
|||
einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
LANG_FOR_EACH_INPUT_STATEMENT (is)
|
||||
{
|
||||
|
@ -165,13 +150,13 @@ gld${EMULATION_NAME}_after_open ()
|
|||
}
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_finish PARAMS((void))
|
||||
gld${EMULATION_NAME}_finish (void)
|
||||
{
|
||||
struct bfd_link_hash_entry * h;
|
||||
|
||||
if (thumb_entry_symbol == NULL)
|
||||
return;
|
||||
|
||||
|
||||
h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
|
||||
FALSE, FALSE, TRUE);
|
||||
|
||||
|
@ -182,21 +167,21 @@ gld${EMULATION_NAME}_finish PARAMS((void))
|
|||
{
|
||||
static char buffer[32];
|
||||
bfd_vma val;
|
||||
|
||||
|
||||
/* Special procesing is required for a Thumb entry symbol. The
|
||||
bottom bit of its address must be set. */
|
||||
val = (h->u.def.value
|
||||
+ bfd_get_section_vma (output_bfd,
|
||||
h->u.def.section->output_section)
|
||||
+ h->u.def.section->output_offset);
|
||||
|
||||
|
||||
val |= 1;
|
||||
|
||||
/* Now convert this value into a string and store it in entry_symbol
|
||||
where the lang_finish() function will pick it up. */
|
||||
where the lang_finish() function will pick it up. */
|
||||
buffer[0] = '0';
|
||||
buffer[1] = 'x';
|
||||
|
||||
|
||||
sprintf_vma (buffer + 2, val);
|
||||
|
||||
if (entry_symbol.name != NULL && entry_from_cmdline)
|
||||
|
@ -209,8 +194,7 @@ gld${EMULATION_NAME}_finish PARAMS((void))
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -221,7 +205,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -242,7 +226,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -262,7 +246,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse,
|
||||
syslib_default,
|
||||
|
|
|
@ -28,9 +28,8 @@ static int no_pipeline_knowledge = 0;
|
|||
static char *thumb_entry_symbol = NULL;
|
||||
static bfd *bfd_for_interwork;
|
||||
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_set_output_arch ("`echo ${ARCH}`");
|
||||
|
@ -39,10 +38,8 @@ gld${EMULATION_NAME}_before_parse ()
|
|||
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
|
||||
}
|
||||
|
||||
static void arm_elf_after_open PARAMS ((void));
|
||||
|
||||
static void
|
||||
arm_elf_after_open ()
|
||||
arm_elf_after_open (void)
|
||||
{
|
||||
if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
|
||||
{
|
||||
|
@ -65,12 +62,8 @@ arm_elf_after_open ()
|
|||
gld${EMULATION_NAME}_after_open ();
|
||||
}
|
||||
|
||||
static void arm_elf_set_bfd_for_interworking
|
||||
PARAMS ((lang_statement_union_type *));
|
||||
|
||||
static void
|
||||
arm_elf_set_bfd_for_interworking (statement)
|
||||
lang_statement_union_type *statement;
|
||||
arm_elf_set_bfd_for_interworking (lang_statement_union_type *statement)
|
||||
{
|
||||
if (statement->header.type == lang_input_section_enum
|
||||
&& !statement->input_section.ifile->just_syms_flag)
|
||||
|
@ -90,10 +83,8 @@ arm_elf_set_bfd_for_interworking (statement)
|
|||
}
|
||||
}
|
||||
|
||||
static void arm_elf_before_allocation PARAMS ((void));
|
||||
|
||||
static void
|
||||
arm_elf_before_allocation ()
|
||||
arm_elf_before_allocation (void)
|
||||
{
|
||||
bfd *tem;
|
||||
|
||||
|
@ -138,10 +129,8 @@ arm_elf_before_allocation ()
|
|||
bfd_elf32_arm_allocate_interworking_sections (& link_info);
|
||||
}
|
||||
|
||||
static void arm_elf_finish PARAMS ((void));
|
||||
|
||||
static void
|
||||
arm_elf_finish ()
|
||||
arm_elf_finish (void)
|
||||
{
|
||||
struct bfd_link_hash_entry * h;
|
||||
|
||||
|
@ -150,7 +139,7 @@ arm_elf_finish ()
|
|||
|
||||
if (thumb_entry_symbol == NULL)
|
||||
return;
|
||||
|
||||
|
||||
h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
|
||||
FALSE, FALSE, TRUE);
|
||||
|
||||
|
@ -161,21 +150,21 @@ arm_elf_finish ()
|
|||
{
|
||||
static char buffer[32];
|
||||
bfd_vma val;
|
||||
|
||||
|
||||
/* Special procesing is required for a Thumb entry symbol. The
|
||||
bottom bit of its address must be set. */
|
||||
val = (h->u.def.value
|
||||
+ bfd_get_section_vma (output_bfd,
|
||||
h->u.def.section->output_section)
|
||||
+ h->u.def.section->output_offset);
|
||||
|
||||
|
||||
val |= 1;
|
||||
|
||||
/* Now convert this value into a string and store it in entry_symbol
|
||||
where the lang_finish() function will pick it up. */
|
||||
where the lang_finish() function will pick it up. */
|
||||
buffer[0] = '0';
|
||||
buffer[1] = 'x';
|
||||
|
||||
|
||||
sprintf_vma (buffer + 2, val);
|
||||
|
||||
if (entry_symbol.name != NULL && entry_from_cmdline)
|
||||
|
|
|
@ -47,13 +47,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
static void gld${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_set_output_arch ("`echo ${ARCH}`");
|
||||
|
@ -64,7 +59,7 @@ gld${EMULATION_NAME}_before_parse ()
|
|||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation ()
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
/* we should be able to set the size of the interworking stub section */
|
||||
|
||||
|
@ -86,7 +81,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
}
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
|
||||
LANG_FOR_EACH_INPUT_STATEMENT (is)
|
||||
|
@ -98,8 +93,7 @@ gld${EMULATION_NAME}_after_open ()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -110,7 +104,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -131,7 +125,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -151,7 +145,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse,
|
||||
syslib_default,
|
||||
|
|
|
@ -51,33 +51,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
#define TARGET_IS_${EMULATION_NAME}
|
||||
|
||||
static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
static bfd_boolean gld${EMULATION_NAME}_place_orphan
|
||||
PARAMS ((lang_input_statement_type *, asection *));
|
||||
static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
|
||||
|
||||
static int sort_by_file_name PARAMS ((const PTR, const PTR));
|
||||
static int sort_by_section_name PARAMS ((const PTR, const PTR));
|
||||
static lang_statement_union_type **sort_sections_1
|
||||
PARAMS ((lang_statement_union_type **, lang_statement_union_type *, int,
|
||||
int (*) PARAMS((const PTR, const PTR))));
|
||||
static void sort_sections PARAMS ((lang_statement_union_type *));
|
||||
|
||||
static void set_pe_name PARAMS ((char *, long int));
|
||||
static void set_pe_subsystem PARAMS ((void));
|
||||
static void set_pe_value PARAMS ((char *));
|
||||
static void set_pe_stack_heap PARAMS ((char *, char *));
|
||||
|
||||
static struct internal_extra_pe_aouthdr pe;
|
||||
static int dll;
|
||||
|
||||
extern const char *output_filename;
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_before_parse()
|
||||
gld_${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
if (arch)
|
||||
|
@ -109,17 +89,11 @@ gld_${EMULATION_NAME}_before_parse()
|
|||
#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
|
||||
#define OPTION_HEAP (OPTION_SUBSYSTEM + 1)
|
||||
|
||||
static void gld${EMULATION_NAME}_add_options
|
||||
PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns ATTRIBUTE_UNUSED;
|
||||
char **shortopts ATTRIBUTE_UNUSED;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
gld${EMULATION_NAME}_add_options
|
||||
(int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
|
||||
struct option **longopts, int nrl ATTRIBUTE_UNUSED,
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static const struct option xtra_long[] = {
|
||||
/* PE options */
|
||||
|
@ -185,9 +159,7 @@ static definfo init[] =
|
|||
|
||||
|
||||
static void
|
||||
set_pe_name (name, val)
|
||||
char *name;
|
||||
long val;
|
||||
set_pe_name (char *name, long val)
|
||||
{
|
||||
int i;
|
||||
/* Find the name and set it. */
|
||||
|
@ -205,7 +177,7 @@ set_pe_name (name, val)
|
|||
|
||||
|
||||
static void
|
||||
set_pe_subsystem ()
|
||||
set_pe_subsystem (void)
|
||||
{
|
||||
const char *sver;
|
||||
int len;
|
||||
|
@ -281,11 +253,8 @@ set_pe_subsystem ()
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
set_pe_value (name)
|
||||
char *name;
|
||||
|
||||
set_pe_value (char *name)
|
||||
{
|
||||
char *end;
|
||||
set_pe_name (name, strtoul (optarg, &end, 0));
|
||||
|
@ -298,9 +267,7 @@ set_pe_value (name)
|
|||
}
|
||||
|
||||
static void
|
||||
set_pe_stack_heap (resname, comname)
|
||||
char *resname;
|
||||
char *comname;
|
||||
set_pe_stack_heap (char *resname, char *comname)
|
||||
{
|
||||
set_pe_value (resname);
|
||||
if (*optarg == ',')
|
||||
|
@ -315,12 +282,8 @@ set_pe_stack_heap (resname, comname)
|
|||
}
|
||||
|
||||
|
||||
static bfd_boolean gld${EMULATION_NAME}_handle_option
|
||||
PARAMS ((int));
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_handle_option (optc)
|
||||
int optc;
|
||||
gld${EMULATION_NAME}_handle_option (int optc)
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
|
@ -328,7 +291,7 @@ gld${EMULATION_NAME}_handle_option (optc)
|
|||
return FALSE;
|
||||
|
||||
case OPTION_BASE_FILE:
|
||||
link_info.base_file = (PTR) fopen (optarg, FOPEN_WB);
|
||||
link_info.base_file = fopen (optarg, FOPEN_WB);
|
||||
if (link_info.base_file == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: Can't open base file %s\n",
|
||||
|
@ -385,7 +348,7 @@ gld${EMULATION_NAME}_handle_option (optc)
|
|||
read. */
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_set_symbols()
|
||||
gld_${EMULATION_NAME}_set_symbols (void)
|
||||
{
|
||||
/* Run through and invent symbols for all the
|
||||
names and insert the defaults. */
|
||||
|
@ -437,7 +400,7 @@ gld_${EMULATION_NAME}_set_symbols()
|
|||
}
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_after_open()
|
||||
gld_${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
/* Pass the wacky PE command line options into the output bfd.
|
||||
FIXME: This should be done via a function, rather than by
|
||||
|
@ -455,9 +418,7 @@ gld_${EMULATION_NAME}_after_open()
|
|||
/* Callback functions for qsort in sort_sections. */
|
||||
|
||||
static int
|
||||
sort_by_file_name (a, b)
|
||||
const PTR a;
|
||||
const PTR b;
|
||||
sort_by_file_name (const void *a, const void *b)
|
||||
{
|
||||
const lang_statement_union_type *const *ra = a;
|
||||
const lang_statement_union_type *const *rb = b;
|
||||
|
@ -512,9 +473,7 @@ return 0;
|
|||
}
|
||||
|
||||
static int
|
||||
sort_by_section_name (a, b)
|
||||
const PTR a;
|
||||
const PTR b;
|
||||
sort_by_section_name (const void *a, const void *b)
|
||||
{
|
||||
const lang_statement_union_type *const *ra = a;
|
||||
const lang_statement_union_type *const *rb = b;
|
||||
|
@ -539,10 +498,10 @@ sort_by_section_name (a, b)
|
|||
The result is a pointer to the last element's "next" pointer. */
|
||||
|
||||
static lang_statement_union_type **
|
||||
sort_sections_1 (startptr, next_after, count, sort_func)
|
||||
lang_statement_union_type **startptr,*next_after;
|
||||
int count;
|
||||
int (*sort_func) PARAMS ((const PTR, const PTR));
|
||||
sort_sections_1 (lang_statement_union_type **startptr,
|
||||
lang_statement_union_type *next_after,
|
||||
int count,
|
||||
int (*sort_func) (const void *, const void *))
|
||||
{
|
||||
lang_statement_union_type **vec;
|
||||
lang_statement_union_type *p;
|
||||
|
@ -585,8 +544,7 @@ sort_sections_1 (startptr, next_after, count, sort_func)
|
|||
place_orphans routine to implement grouped sections. */
|
||||
|
||||
static void
|
||||
sort_sections (s)
|
||||
lang_statement_union_type *s;
|
||||
sort_sections (lang_statement_union_type *s)
|
||||
{
|
||||
for (; s ; s = s->header.next)
|
||||
switch (s->header.type)
|
||||
|
@ -673,7 +631,7 @@ sort_sections (s)
|
|||
}
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_before_allocation()
|
||||
gld_${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
extern lang_statement_list_type *stat_ptr;
|
||||
|
||||
|
@ -730,9 +688,7 @@ gld_${EMULATION_NAME}_before_allocation()
|
|||
|
||||
/*ARGSUSED*/
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_place_orphan (file, s)
|
||||
lang_input_statement_type *file;
|
||||
asection *s;
|
||||
gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
|
||||
{
|
||||
const char *secname;
|
||||
char *output_secname, *ps;
|
||||
|
@ -821,8 +777,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
|
|||
}
|
||||
|
||||
static char *
|
||||
gld_${EMULATION_NAME}_get_script(isfile)
|
||||
int *isfile;
|
||||
gld_${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
# Scripts compiled in.
|
||||
# sed commands to quote an ld script as a C string.
|
||||
|
|
|
@ -53,38 +53,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include <ldgram.h>
|
||||
#include "elf/common.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse
|
||||
PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_vercheck
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static void gld${EMULATION_NAME}_stat_needed
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static bfd_boolean gld${EMULATION_NAME}_try_needed
|
||||
PARAMS ((const char *, int));
|
||||
static bfd_boolean gld${EMULATION_NAME}_search_needed
|
||||
PARAMS ((const char *, const char *, int));
|
||||
static void gld${EMULATION_NAME}_check_needed
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static void gld${EMULATION_NAME}_after_open
|
||||
PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_find_exp_assignment
|
||||
PARAMS ((etree_type *));
|
||||
static void gld${EMULATION_NAME}_find_statement_assignment
|
||||
PARAMS ((lang_statement_union_type *));
|
||||
static void gld${EMULATION_NAME}_before_allocation
|
||||
PARAMS ((void));
|
||||
static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive
|
||||
PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
|
||||
static lang_output_section_statement_type *output_rel_find
|
||||
PARAMS ((asection *));
|
||||
static asection *output_prev_sec_find
|
||||
PARAMS ((lang_output_section_statement_type *));
|
||||
/* Declare functions used by various EXTRA_EM_FILEs. */
|
||||
static void gld${EMULATION_NAME}_before_parse (void);
|
||||
static void gld${EMULATION_NAME}_after_open (void);
|
||||
static void gld${EMULATION_NAME}_before_allocation (void);
|
||||
static bfd_boolean gld${EMULATION_NAME}_place_orphan
|
||||
PARAMS ((lang_input_statement_type *, asection *));
|
||||
static void gld${EMULATION_NAME}_finish
|
||||
PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script
|
||||
PARAMS ((int *isfile));
|
||||
(lang_input_statement_type *file, asection *s);
|
||||
static void gld${EMULATION_NAME}_finish (void);
|
||||
|
||||
EOF
|
||||
|
||||
|
@ -104,7 +79,7 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
if (arch)
|
||||
|
@ -152,8 +127,7 @@ static bfd_boolean global_vercheck_failed;
|
|||
a conflicting version. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_vercheck (s)
|
||||
lang_input_statement_type *s;
|
||||
gld${EMULATION_NAME}_vercheck (lang_input_statement_type *s)
|
||||
{
|
||||
const char *soname;
|
||||
struct bfd_link_needed_list *l;
|
||||
|
@ -190,10 +164,10 @@ gld${EMULATION_NAME}_vercheck (s)
|
|||
if (strncmp (soname, l->name, suffix - l->name) == 0)
|
||||
{
|
||||
/* Here we know that S is a dynamic object FOO.SO.VER1, and
|
||||
the object we are considering needs a dynamic object
|
||||
FOO.SO.VER2, and VER1 and VER2 are different. This
|
||||
appears to be a version mismatch, so we tell the caller
|
||||
to try a different version of this library. */
|
||||
the object we are considering needs a dynamic object
|
||||
FOO.SO.VER2, and VER1 and VER2 are different. This
|
||||
appears to be a version mismatch, so we tell the caller
|
||||
to try a different version of this library. */
|
||||
global_vercheck_failed = TRUE;
|
||||
return;
|
||||
}
|
||||
|
@ -205,8 +179,7 @@ gld${EMULATION_NAME}_vercheck (s)
|
|||
the file. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_stat_needed (s)
|
||||
lang_input_statement_type *s;
|
||||
gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
|
||||
{
|
||||
struct stat st;
|
||||
const char *suffix;
|
||||
|
@ -261,9 +234,7 @@ gld${EMULATION_NAME}_stat_needed (s)
|
|||
to skip the check for a conflicting version. */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_try_needed (name, force)
|
||||
const char *name;
|
||||
int force;
|
||||
gld${EMULATION_NAME}_try_needed (const char *name, int force)
|
||||
{
|
||||
bfd *abfd;
|
||||
const char *soname;
|
||||
|
@ -310,16 +281,16 @@ gld${EMULATION_NAME}_try_needed (name, force)
|
|||
{
|
||||
bfd_close (abfd);
|
||||
/* Return FALSE to force the caller to move on to try
|
||||
another file on the search path. */
|
||||
another file on the search path. */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* But wait! It gets much worse. On Linux, if a shared
|
||||
library does not use libc at all, we are supposed to skip
|
||||
it the first time around in case we encounter a shared
|
||||
library later on with the same name which does use the
|
||||
version of libc that we want. This is much too horrible
|
||||
to use on any system other than Linux. */
|
||||
library does not use libc at all, we are supposed to skip
|
||||
it the first time around in case we encounter a shared
|
||||
library later on with the same name which does use the
|
||||
version of libc that we want. This is much too horrible
|
||||
to use on any system other than Linux. */
|
||||
|
||||
EOF
|
||||
case ${target} in
|
||||
|
@ -369,7 +340,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
if (global_found)
|
||||
{
|
||||
/* Return TRUE to indicate that we found the file, even though
|
||||
we aren't going to do anything with it. */
|
||||
we aren't going to do anything with it. */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -393,10 +364,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
/* Search for a needed file in a path. */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_search_needed (path, name, force)
|
||||
const char *path;
|
||||
const char *name;
|
||||
int force;
|
||||
gld${EMULATION_NAME}_search_needed (const char *path, const char *name, int force)
|
||||
{
|
||||
const char *s;
|
||||
size_t len;
|
||||
|
@ -445,11 +413,8 @@ if [ "x${USE_LIBPATH}" = xyes ] ; then
|
|||
|
||||
/* Add the sysroot to every entry in a colon-separated path. */
|
||||
|
||||
static char * gld${EMULATION_NAME}_add_sysroot PARAMS ((const char *));
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_add_sysroot (path)
|
||||
const char *path;
|
||||
gld${EMULATION_NAME}_add_sysroot (const char *path)
|
||||
{
|
||||
int len, colons, i;
|
||||
char *ret, *p;
|
||||
|
@ -472,7 +437,7 @@ gld${EMULATION_NAME}_add_sysroot (path)
|
|||
while (path[i])
|
||||
if (path[i] == ':')
|
||||
{
|
||||
*p++ = path[i++];
|
||||
*p++ = path[i++];
|
||||
strcpy (p, ld_sysroot);
|
||||
p = p + strlen (p);
|
||||
}
|
||||
|
@ -491,13 +456,8 @@ EOF
|
|||
in which we may find shared libraries. /etc/ld.so.conf is really
|
||||
only meaningful on Linux. */
|
||||
|
||||
static bfd_boolean gld${EMULATION_NAME}_check_ld_so_conf
|
||||
PARAMS ((const char *, int));
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_check_ld_so_conf (name, force)
|
||||
const char *name;
|
||||
int force;
|
||||
gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force)
|
||||
{
|
||||
static bfd_boolean initialized;
|
||||
static char *ld_so_conf;
|
||||
|
@ -588,8 +548,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
/* See if an input file matches a DT_NEEDED entry by name. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_check_needed (s)
|
||||
lang_input_statement_type *s;
|
||||
gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
|
||||
{
|
||||
if (global_found)
|
||||
return;
|
||||
|
@ -638,7 +597,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
/* This is called after all the input files have been opened. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
struct bfd_link_needed_list *needed, *l;
|
||||
|
||||
|
@ -794,8 +753,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
/* Look through an expression for an assignment statement. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_exp_assignment (exp)
|
||||
etree_type *exp;
|
||||
gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
|
||||
{
|
||||
struct bfd_link_hash_entry *h;
|
||||
|
||||
|
@ -855,8 +813,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
|
|||
symbols which are referred to by dynamic objects. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_statement_assignment (s)
|
||||
lang_statement_union_type *s;
|
||||
gld${EMULATION_NAME}_find_statement_assignment (lang_statement_union_type *s)
|
||||
{
|
||||
if (s->header.type == lang_assignment_statement_enum)
|
||||
gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp);
|
||||
|
@ -883,7 +840,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation ()
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
const char *rpath;
|
||||
asection *sinterp;
|
||||
|
@ -899,7 +856,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
if (rpath == NULL)
|
||||
rpath = (const char *) getenv ("LD_RUN_PATH");
|
||||
if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
|
||||
(output_bfd, command_line.soname, rpath,
|
||||
(output_bfd, command_line.soname, rpath,
|
||||
command_line.filter_shlib,
|
||||
(const char * const *) command_line.auxiliary_filters,
|
||||
&link_info, &sinterp, lang_elf_version_info)))
|
||||
|
@ -964,10 +921,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
like hpux). */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
|
||||
const char *arch;
|
||||
search_dirs_type *search;
|
||||
lang_input_statement_type *entry;
|
||||
gld${EMULATION_NAME}_open_dynamic_archive
|
||||
(const char *arch, search_dirs_type *search, lang_input_statement_type *entry)
|
||||
{
|
||||
const char *filename;
|
||||
char *string;
|
||||
|
@ -1043,8 +998,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
/* A variant of lang_output_section_find. Used by place_orphan. */
|
||||
|
||||
static lang_output_section_statement_type *
|
||||
output_rel_find (sec)
|
||||
asection *sec;
|
||||
output_rel_find (asection *sec)
|
||||
{
|
||||
lang_statement_union_type *u;
|
||||
lang_output_section_statement_type *lookup;
|
||||
|
@ -1089,8 +1043,7 @@ output_rel_find (sec)
|
|||
Used by place_orphan. */
|
||||
|
||||
static asection *
|
||||
output_prev_sec_find (os)
|
||||
lang_output_section_statement_type *os;
|
||||
output_prev_sec_find (lang_output_section_statement_type *os)
|
||||
{
|
||||
asection *s = (asection *) NULL;
|
||||
lang_statement_union_type *u;
|
||||
|
@ -1122,9 +1075,7 @@ struct orphan_save {
|
|||
};
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_place_orphan (file, s)
|
||||
lang_input_statement_type *file;
|
||||
asection *s;
|
||||
gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
|
||||
{
|
||||
static struct orphan_save hold_text;
|
||||
static struct orphan_save hold_rodata;
|
||||
|
@ -1422,7 +1373,7 @@ if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_finish ()
|
||||
gld${EMULATION_NAME}_finish (void)
|
||||
{
|
||||
if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
|
||||
{
|
||||
|
@ -1447,8 +1398,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -1573,17 +1523,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
|
||||
#define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1)
|
||||
|
||||
static void gld${EMULATION_NAME}_add_options
|
||||
PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns;
|
||||
char **shortopts;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
gld${EMULATION_NAME}_add_options
|
||||
(int ns, char **shortopts, int nl, struct option **longopts,
|
||||
int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static const char xtra_short[] = "${PARSE_AND_LIST_SHORTOPTS}z:";
|
||||
static const struct option xtra_long[] = {
|
||||
|
@ -1615,12 +1558,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
|
||||
}
|
||||
|
||||
static bfd_boolean gld${EMULATION_NAME}_handle_option
|
||||
PARAMS ((int));
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_handle_option (optc)
|
||||
int optc;
|
||||
gld${EMULATION_NAME}_handle_option (int optc)
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
|
@ -1683,7 +1622,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
else if (strcmp (optarg, "nocombreloc") == 0)
|
||||
link_info.combreloc = FALSE;
|
||||
else if (strcmp (optarg, "nocopyreloc") == 0)
|
||||
link_info.nocopyreloc = TRUE;
|
||||
link_info.nocopyreloc = TRUE;
|
||||
else if (strcmp (optarg, "execstack") == 0)
|
||||
{
|
||||
link_info.execstack = TRUE;
|
||||
|
@ -1716,11 +1655,8 @@ EOF
|
|||
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void gld${EMULATION_NAME}_list_options PARAMS ((FILE * file));
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_list_options (file)
|
||||
FILE * file;
|
||||
gld${EMULATION_NAME}_list_options (FILE * file)
|
||||
{
|
||||
EOF
|
||||
|
||||
|
|
|
@ -39,9 +39,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
|
||||
EOF
|
||||
|
||||
# Import any needed special functions and/or overrides.
|
||||
|
@ -54,7 +51,7 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_set_output_arch ("`echo ${ARCH}`");
|
||||
|
@ -68,8 +65,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script(isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -80,7 +76,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -101,7 +97,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -121,7 +117,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
{
|
||||
${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse},
|
||||
${LDEMUL_SYSLIB-syslib_default},
|
||||
|
|
|
@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with GLD; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
/*
|
||||
* emulate the Intels port of gld
|
||||
*/
|
||||
|
||||
|
@ -39,15 +39,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld960_before_parse PARAMS ((void));
|
||||
static char *gld960_choose_target PARAMS ((int, char **));
|
||||
static void gld960_set_output_arch PARAMS ((void));
|
||||
static char *gld960_get_script PARAMS ((int *));
|
||||
|
||||
#ifdef GNU960
|
||||
|
||||
static void
|
||||
gld960_before_parse()
|
||||
gld960_before_parse (void)
|
||||
{
|
||||
static char *env_variables[] = { "G960LIB", "G960BASE", 0 };
|
||||
char **p;
|
||||
|
@ -67,7 +62,7 @@ gld960_before_parse()
|
|||
|
||||
#else /* not GNU960 */
|
||||
|
||||
static void gld960_before_parse()
|
||||
static void gld960_before_parse (void)
|
||||
{
|
||||
char *env ;
|
||||
env = getenv("G960LIB");
|
||||
|
@ -84,15 +79,13 @@ static void gld960_before_parse()
|
|||
|
||||
|
||||
static void
|
||||
gld960_set_output_arch()
|
||||
gld960_set_output_arch (void)
|
||||
{
|
||||
bfd_set_arch_mach(output_bfd, ldfile_output_architecture, bfd_mach_i960_core);
|
||||
}
|
||||
|
||||
static char *
|
||||
gld960_choose_target (argc, argv)
|
||||
int argc ATTRIBUTE_UNUSED;
|
||||
char **argv ATTRIBUTE_UNUSED;
|
||||
gld960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef GNU960
|
||||
|
||||
|
@ -113,8 +106,7 @@ gld960_choose_target (argc, argv)
|
|||
}
|
||||
|
||||
static char *
|
||||
gld960_get_script(isfile)
|
||||
int *isfile;
|
||||
gld960_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -125,7 +117,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -146,7 +138,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -166,7 +158,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_gld960_emulation =
|
||||
struct ld_emulation_xfer_struct ld_gld960_emulation =
|
||||
{
|
||||
gld960_before_parse,
|
||||
syslib_default,
|
||||
|
|
|
@ -41,15 +41,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld960_before_parse PARAMS ((void));
|
||||
static void gld960_set_output_arch PARAMS ((void));
|
||||
static char *gld960_choose_target PARAMS ((int, char **));
|
||||
static char *gld960_get_script PARAMS ((int *));
|
||||
|
||||
#ifdef GNU960
|
||||
|
||||
static void
|
||||
gld960_before_parse()
|
||||
gld960_before_parse (void)
|
||||
{
|
||||
static char *env_variables[] = { "G960LIB", "G960BASE", 0 };
|
||||
char **p;
|
||||
|
@ -69,7 +64,7 @@ gld960_before_parse()
|
|||
|
||||
#else /* not GNU960 */
|
||||
|
||||
static void gld960_before_parse()
|
||||
static void gld960_before_parse (void)
|
||||
{
|
||||
char *env ;
|
||||
env = getenv("G960LIB");
|
||||
|
@ -87,7 +82,7 @@ static void gld960_before_parse()
|
|||
|
||||
|
||||
static void
|
||||
gld960_set_output_arch()
|
||||
gld960_set_output_arch (void)
|
||||
{
|
||||
if (ldfile_output_machine_name != NULL
|
||||
&& *ldfile_output_machine_name != '\0')
|
||||
|
@ -105,9 +100,7 @@ gld960_set_output_arch()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld960_choose_target (argc, argv)
|
||||
int argc ATTRIBUTE_UNUSED;
|
||||
char **argv ATTRIBUTE_UNUSED;
|
||||
gld960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef GNU960
|
||||
|
||||
|
@ -128,8 +121,7 @@ gld960_choose_target (argc, argv)
|
|||
}
|
||||
|
||||
static char *
|
||||
gld960_get_script(isfile)
|
||||
int *isfile;
|
||||
gld960_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
|
|
@ -27,14 +27,6 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
#include "ldctor.h"
|
||||
#include "elf32-hppa.h"
|
||||
|
||||
static void hppaelf_after_parse PARAMS ((void));
|
||||
static void hppaelf_create_output_section_statements PARAMS ((void));
|
||||
static asection *hppaelf_add_stub_section
|
||||
PARAMS ((const char *, asection *));
|
||||
static void hppaelf_layout_sections_again PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_finish PARAMS ((void));
|
||||
static void build_section_lists PARAMS ((lang_statement_union_type *));
|
||||
|
||||
|
||||
/* Fake input file for stubs. */
|
||||
static lang_input_statement_type *stub_file;
|
||||
|
@ -56,7 +48,7 @@ static bfd_signed_vma group_size = 1;
|
|||
and adds millicode library to the list of input files. */
|
||||
|
||||
static void
|
||||
hppaelf_after_parse ()
|
||||
hppaelf_after_parse (void)
|
||||
{
|
||||
if (link_info.relocatable)
|
||||
lang_add_unique (".text");
|
||||
|
@ -72,7 +64,7 @@ hppaelf_after_parse ()
|
|||
fake input file to hold the stub sections. */
|
||||
|
||||
static void
|
||||
hppaelf_create_output_section_statements ()
|
||||
hppaelf_create_output_section_statements (void)
|
||||
{
|
||||
stub_file = lang_add_input_file ("linker stubs",
|
||||
lang_input_file_is_fake_enum,
|
||||
|
@ -99,13 +91,8 @@ struct hook_stub_info
|
|||
|
||||
/* Traverse the linker tree to find the spot where the stub goes. */
|
||||
|
||||
static bfd_boolean hook_in_stub
|
||||
PARAMS ((struct hook_stub_info *, lang_statement_union_type **));
|
||||
|
||||
static bfd_boolean
|
||||
hook_in_stub (info, lp)
|
||||
struct hook_stub_info *info;
|
||||
lang_statement_union_type **lp;
|
||||
hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
|
||||
{
|
||||
lang_statement_union_type *l;
|
||||
bfd_boolean ret;
|
||||
|
@ -177,9 +164,7 @@ hook_in_stub (info, lp)
|
|||
immediately before INPUT_SECTION. */
|
||||
|
||||
static asection *
|
||||
hppaelf_add_stub_section (stub_sec_name, input_section)
|
||||
const char *stub_sec_name;
|
||||
asection *input_section;
|
||||
hppaelf_add_stub_section (const char *stub_sec_name, asection *input_section)
|
||||
{
|
||||
asection *stub_sec;
|
||||
flagword flags;
|
||||
|
@ -220,7 +205,7 @@ hppaelf_add_stub_section (stub_sec_name, input_section)
|
|||
/* Another call-back for elf32_hppa_size_stubs. */
|
||||
|
||||
static void
|
||||
hppaelf_layout_sections_again ()
|
||||
hppaelf_layout_sections_again (void)
|
||||
{
|
||||
/* If we have changed sizes of the stub sections, then we need
|
||||
to recalculate all the section offsets. This may mean we need to
|
||||
|
@ -243,8 +228,7 @@ hppaelf_layout_sections_again ()
|
|||
|
||||
|
||||
static void
|
||||
build_section_lists (statement)
|
||||
lang_statement_union_type *statement;
|
||||
build_section_lists (lang_statement_union_type *statement)
|
||||
{
|
||||
if (statement->header.type == lang_input_section_enum
|
||||
&& !statement->input_section.ifile->just_syms_flag
|
||||
|
@ -261,7 +245,7 @@ build_section_lists (statement)
|
|||
to build linker stubs. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_finish ()
|
||||
gld${EMULATION_NAME}_finish (void)
|
||||
{
|
||||
/* bfd_elf32_discard_info just plays with debugging sections,
|
||||
ie. doesn't affect any code, so we can delay resizing the
|
||||
|
@ -326,23 +310,16 @@ gld${EMULATION_NAME}_finish ()
|
|||
/* Avoid processing the fake stub_file in vercheck, stat_needed and
|
||||
check_needed routines. */
|
||||
|
||||
static void hppa_for_each_input_file_wrapper
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static void hppa_lang_for_each_input_file
|
||||
PARAMS ((void (*) (lang_input_statement_type *)));
|
||||
static void (*real_func) (lang_input_statement_type *);
|
||||
|
||||
static void (*real_func) PARAMS ((lang_input_statement_type *));
|
||||
|
||||
static void hppa_for_each_input_file_wrapper (l)
|
||||
lang_input_statement_type *l;
|
||||
static void hppa_for_each_input_file_wrapper (lang_input_statement_type *l)
|
||||
{
|
||||
if (l != stub_file)
|
||||
(*real_func) (l);
|
||||
}
|
||||
|
||||
static void
|
||||
hppa_lang_for_each_input_file (func)
|
||||
void (*func) PARAMS ((lang_input_statement_type *));
|
||||
hppa_lang_for_each_input_file (void (*func) (lang_input_statement_type *))
|
||||
{
|
||||
real_func = func;
|
||||
lang_for_each_input_file (&hppa_for_each_input_file_wrapper);
|
||||
|
|
|
@ -44,18 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive
|
||||
PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
|
||||
static void gld${EMULATION_NAME}_find_address_statement
|
||||
PARAMS ((lang_statement_union_type *));
|
||||
static void gld${EMULATION_NAME}_create_output_section_statements
|
||||
PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
if (arch)
|
||||
|
@ -74,10 +64,8 @@ gld${EMULATION_NAME}_before_parse()
|
|||
dynamic libraries have an extension of .sa. */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
|
||||
const char *arch;
|
||||
search_dirs_type *search;
|
||||
lang_input_statement_type *entry;
|
||||
gld${EMULATION_NAME}_open_dynamic_archive
|
||||
(const char *arch, search_dirs_type *search, lang_input_statement_type *entry)
|
||||
{
|
||||
char *string;
|
||||
|
||||
|
@ -110,8 +98,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
|
|||
Linux tools. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_address_statement (s)
|
||||
lang_statement_union_type *s;
|
||||
gld${EMULATION_NAME}_find_address_statement (lang_statement_union_type *s)
|
||||
{
|
||||
if (s->header.type == lang_address_statement_enum
|
||||
&& strcmp (s->address_statement.section_name, ".text") == 0)
|
||||
|
@ -124,7 +111,7 @@ gld${EMULATION_NAME}_find_address_statement (s)
|
|||
/* This is called before opening the input BFD's. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_create_output_section_statements ()
|
||||
gld${EMULATION_NAME}_create_output_section_statements (void)
|
||||
{
|
||||
lang_for_each_statement (gld${EMULATION_NAME}_find_address_statement);
|
||||
}
|
||||
|
@ -133,7 +120,7 @@ gld${EMULATION_NAME}_create_output_section_statements ()
|
|||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation ()
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
if (link_info.relocatable)
|
||||
return;
|
||||
|
@ -145,8 +132,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script(isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
|
|
@ -47,23 +47,9 @@ static lib_list_type **hll_list_tail = &hll_list;
|
|||
static lib_list_type *syslib_list;
|
||||
static lib_list_type **syslib_list_tail = &syslib_list;
|
||||
|
||||
static void append PARAMS ((lib_list_type ***, char *));
|
||||
static void lnk960_hll PARAMS ((char *));
|
||||
static void lnk960_syslib PARAMS ((char *));
|
||||
static void lnk960_before_parse PARAMS ((void));
|
||||
static void add_on PARAMS ((lib_list_type *, lang_input_file_enum_type));
|
||||
static void lnk960_after_parse PARAMS ((void));
|
||||
static void lnk960_before_allocation PARAMS ((void));
|
||||
static void lnk960_after_allocation PARAMS ((void));
|
||||
static void lnk960_set_output_arch PARAMS ((void));
|
||||
static char *lnk960_choose_target PARAMS ((int, char **));
|
||||
static char *lnk960_get_script PARAMS ((int *));
|
||||
|
||||
|
||||
static void
|
||||
append (list, name)
|
||||
lib_list_type ***list;
|
||||
char *name;
|
||||
append (lib_list_type ***list, char *name)
|
||||
{
|
||||
lib_list_type *element = (lib_list_type *) xmalloc (sizeof (lib_list_type));
|
||||
|
||||
|
@ -78,8 +64,7 @@ static bfd_boolean had_hll = FALSE;
|
|||
static bfd_boolean had_hll_name = FALSE;
|
||||
|
||||
static void
|
||||
lnk960_hll (name)
|
||||
char *name;
|
||||
lnk960_hll (char *name)
|
||||
{
|
||||
had_hll = TRUE;
|
||||
if (name != (char *) NULL)
|
||||
|
@ -89,9 +74,8 @@ lnk960_hll (name)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
lnk960_syslib (name)
|
||||
char *name;
|
||||
static void
|
||||
lnk960_syslib (char *name)
|
||||
{
|
||||
append (&syslib_list_tail, name);
|
||||
}
|
||||
|
@ -99,8 +83,8 @@ lnk960_syslib (name)
|
|||
|
||||
#ifdef GNU960
|
||||
|
||||
static void
|
||||
lnk960_before_parse ()
|
||||
static void
|
||||
lnk960_before_parse (void)
|
||||
{
|
||||
static char *env_variables[] = { "G960LIB", "G960BASE", 0 };
|
||||
char **p;
|
||||
|
@ -123,8 +107,8 @@ lnk960_before_parse ()
|
|||
|
||||
#else /* not GNU960 */
|
||||
|
||||
static void
|
||||
lnk960_before_parse ()
|
||||
static void
|
||||
lnk960_before_parse (void)
|
||||
{
|
||||
char *name = getenv ("I960BASE");
|
||||
|
||||
|
@ -145,9 +129,7 @@ lnk960_before_parse ()
|
|||
|
||||
|
||||
static void
|
||||
add_on (list, search)
|
||||
lib_list_type *list;
|
||||
lang_input_file_enum_type search;
|
||||
add_on (lib_list_type *list, lang_input_file_enum_type search)
|
||||
{
|
||||
while (list)
|
||||
{
|
||||
|
@ -155,15 +137,16 @@ add_on (list, search)
|
|||
list = list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
lnk960_after_parse ()
|
||||
lnk960_after_parse (void)
|
||||
{
|
||||
/* If there has been no arch, default to -KB */
|
||||
if (ldfile_output_machine_name[0] == 0)
|
||||
ldfile_add_arch ("KB");
|
||||
|
||||
/* if there has been no hll list then add our own */
|
||||
|
||||
|
||||
if (had_hll && !had_hll_name)
|
||||
{
|
||||
append (&hll_list_tail, "cg");
|
||||
|
@ -171,18 +154,18 @@ lnk960_after_parse ()
|
|||
|| ldfile_output_machine == bfd_mach_i960_ca)
|
||||
append (&hll_list_tail, "fpg");
|
||||
}
|
||||
|
||||
|
||||
add_on (hll_list, lang_input_file_is_l_enum);
|
||||
add_on (syslib_list, lang_input_file_is_search_file_enum);
|
||||
}
|
||||
|
||||
static void
|
||||
lnk960_before_allocation ()
|
||||
lnk960_before_allocation (void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
lnk960_after_allocation ()
|
||||
lnk960_after_allocation (void)
|
||||
{
|
||||
if (!link_info.relocatable)
|
||||
{
|
||||
|
@ -197,7 +180,7 @@ lnk960_after_allocation ()
|
|||
static struct
|
||||
{
|
||||
unsigned long number;
|
||||
char *name;
|
||||
char *name;
|
||||
}
|
||||
machine_table[] =
|
||||
{
|
||||
|
@ -227,7 +210,7 @@ machine_table[] =
|
|||
};
|
||||
|
||||
static void
|
||||
lnk960_set_output_arch ()
|
||||
lnk960_set_output_arch (void)
|
||||
{
|
||||
/* Set the output architecture and machine if possible */
|
||||
unsigned int i;
|
||||
|
@ -245,9 +228,7 @@ lnk960_set_output_arch ()
|
|||
}
|
||||
|
||||
static char *
|
||||
lnk960_choose_target (argc, argv)
|
||||
int argc ATTRIBUTE_UNUSED;
|
||||
char **argv ATTRIBUTE_UNUSED;
|
||||
lnk960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef GNU960
|
||||
|
||||
|
@ -268,8 +249,7 @@ lnk960_choose_target (argc, argv)
|
|||
}
|
||||
|
||||
static char *
|
||||
lnk960_get_script (isfile)
|
||||
int *isfile;
|
||||
lnk960_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -280,7 +260,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -301,7 +281,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -321,7 +301,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_lnk960_emulation =
|
||||
struct ld_emulation_xfer_struct ld_lnk960_emulation =
|
||||
{
|
||||
lnk960_before_parse,
|
||||
lnk960_syslib,
|
||||
|
|
|
@ -44,12 +44,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
#include "ldctor.h"
|
||||
#include "elf32-m68hc1x.h"
|
||||
|
||||
static void m68hc11elf_create_output_section_statements PARAMS ((void));
|
||||
static asection *m68hc11elf_add_stub_section
|
||||
PARAMS ((const char *, asection *));
|
||||
static void gld${EMULATION_NAME}_finish PARAMS ((void));
|
||||
static void m68hc11_elf_${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
|
||||
static asection *m68hc11elf_add_stub_section (const char *, asection *);
|
||||
|
||||
/* Fake input file for stubs. */
|
||||
static lang_input_statement_type *stub_file;
|
||||
|
@ -64,7 +59,7 @@ static int no_trampoline = 0;
|
|||
static const char* bank_window_name = 0;
|
||||
|
||||
static void
|
||||
m68hc11_elf_${EMULATION_NAME}_before_allocation ()
|
||||
m68hc11_elf_${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
lang_memory_region_type* region;
|
||||
int ret;
|
||||
|
@ -87,9 +82,9 @@ m68hc11_elf_${EMULATION_NAME}_before_allocation ()
|
|||
|
||||
/* Call into the BFD backend to do the real work. */
|
||||
if (!elf32_m68hc11_size_stubs (output_bfd,
|
||||
stub_file->the_bfd,
|
||||
&link_info,
|
||||
&m68hc11elf_add_stub_section))
|
||||
stub_file->the_bfd,
|
||||
&link_info,
|
||||
&m68hc11elf_add_stub_section))
|
||||
{
|
||||
einfo ("%X%P: can not size stub section: %E\n");
|
||||
return;
|
||||
|
@ -123,7 +118,7 @@ m68hc11_elf_${EMULATION_NAME}_before_allocation ()
|
|||
pinfo->bank_size = region->length;
|
||||
pinfo->bank_shift = 0;
|
||||
for (i = pinfo->bank_size; i != 0; i >>= 1)
|
||||
pinfo->bank_shift++;
|
||||
pinfo->bank_shift++;
|
||||
pinfo->bank_shift--;
|
||||
pinfo->bank_size = 1L << pinfo->bank_shift;
|
||||
pinfo->bank_mask = (1 << pinfo->bank_shift) - 1;
|
||||
|
@ -131,12 +126,12 @@ m68hc11_elf_${EMULATION_NAME}_before_allocation ()
|
|||
pinfo->bank_physical_end = region->origin + pinfo->bank_size;
|
||||
|
||||
if (pinfo->bank_size != region->length)
|
||||
{
|
||||
einfo (_("warning: the size of the 'window' memory region "
|
||||
"is not a power of 2\n"));
|
||||
einfo (_("warning: its size %d is truncated to %d\n"),
|
||||
region->length, pinfo->bank_size);
|
||||
}
|
||||
{
|
||||
einfo (_("warning: the size of the 'window' memory region "
|
||||
"is not a power of 2\n"));
|
||||
einfo (_("warning: its size %d is truncated to %d\n"),
|
||||
region->length, pinfo->bank_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +139,7 @@ m68hc11_elf_${EMULATION_NAME}_before_allocation ()
|
|||
fake input file to hold the stub sections. */
|
||||
|
||||
static void
|
||||
m68hc11elf_create_output_section_statements ()
|
||||
m68hc11elf_create_output_section_statements (void)
|
||||
{
|
||||
stub_file = lang_add_input_file ("linker stubs",
|
||||
lang_input_file_is_fake_enum,
|
||||
|
@ -152,8 +147,8 @@ m68hc11elf_create_output_section_statements ()
|
|||
stub_file->the_bfd = bfd_create ("linker stubs", output_bfd);
|
||||
if (stub_file->the_bfd == NULL
|
||||
|| !bfd_set_arch_mach (stub_file->the_bfd,
|
||||
bfd_get_arch (output_bfd),
|
||||
bfd_get_mach (output_bfd)))
|
||||
bfd_get_arch (output_bfd),
|
||||
bfd_get_mach (output_bfd)))
|
||||
{
|
||||
einfo ("%X%P: can not create BFD %E\n");
|
||||
return;
|
||||
|
@ -171,13 +166,8 @@ struct hook_stub_info
|
|||
|
||||
/* Traverse the linker tree to find the spot where the stub goes. */
|
||||
|
||||
static bfd_boolean hook_in_stub
|
||||
PARAMS ((struct hook_stub_info *, lang_statement_union_type **));
|
||||
|
||||
static bfd_boolean
|
||||
hook_in_stub (info, lp)
|
||||
struct hook_stub_info *info;
|
||||
lang_statement_union_type **lp;
|
||||
hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
|
||||
{
|
||||
lang_statement_union_type *l;
|
||||
bfd_boolean ret;
|
||||
|
@ -213,10 +203,10 @@ hook_in_stub (info, lp)
|
|||
|
||||
case lang_input_section_enum:
|
||||
if (l->input_section.section == info->input_section
|
||||
|| strcmp (bfd_get_section_name (output_section,
|
||||
l->input_section.section),
|
||||
bfd_get_section_name (output_section,
|
||||
info->input_section)) == 0)
|
||||
|| strcmp (bfd_get_section_name (output_section,
|
||||
l->input_section.section),
|
||||
bfd_get_section_name (output_section,
|
||||
info->input_section)) == 0)
|
||||
{
|
||||
/* We've found our section. Insert the stub immediately
|
||||
before its associated input section. */
|
||||
|
@ -253,9 +243,8 @@ hook_in_stub (info, lp)
|
|||
immediately before INPUT_SECTION. */
|
||||
|
||||
static asection *
|
||||
m68hc11elf_add_stub_section (stub_sec_name, tramp_section)
|
||||
const char *stub_sec_name;
|
||||
asection *tramp_section;
|
||||
m68hc11elf_add_stub_section (const char *stub_sec_name,
|
||||
asection *tramp_section)
|
||||
{
|
||||
asection *stub_sec;
|
||||
flagword flags;
|
||||
|
@ -263,7 +252,7 @@ m68hc11elf_add_stub_section (stub_sec_name, tramp_section)
|
|||
const char *secname;
|
||||
lang_output_section_statement_type *os;
|
||||
struct hook_stub_info info;
|
||||
|
||||
|
||||
stub_sec = bfd_make_section_anyway (stub_file->the_bfd, stub_sec_name);
|
||||
if (stub_sec == NULL)
|
||||
goto err_ret;
|
||||
|
@ -300,18 +289,18 @@ m68hc11elf_add_stub_section (stub_sec_name, tramp_section)
|
|||
to build linker stubs. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_finish ()
|
||||
gld${EMULATION_NAME}_finish (void)
|
||||
{
|
||||
/* Now build the linker stubs. */
|
||||
if (stub_file->the_bfd->sections != NULL)
|
||||
{
|
||||
/* Call again the trampoline analyzer to initialize the trampoline
|
||||
stubs with the correct symbol addresses. Since there could have
|
||||
been relaxation, the symbol addresses that were found during
|
||||
first call may no longer be correct. */
|
||||
stubs with the correct symbol addresses. Since there could have
|
||||
been relaxation, the symbol addresses that were found during
|
||||
first call may no longer be correct. */
|
||||
if (!elf32_m68hc11_size_stubs (output_bfd,
|
||||
stub_file->the_bfd,
|
||||
&link_info, 0))
|
||||
stub_file->the_bfd,
|
||||
&link_info, 0))
|
||||
{
|
||||
einfo ("%X%P: can not size stub section: %E\n");
|
||||
return;
|
||||
|
@ -325,23 +314,16 @@ gld${EMULATION_NAME}_finish ()
|
|||
/* Avoid processing the fake stub_file in vercheck, stat_needed and
|
||||
check_needed routines. */
|
||||
|
||||
static void m68hc11_for_each_input_file_wrapper
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static void m68hc11_lang_for_each_input_file
|
||||
PARAMS ((void (*) (lang_input_statement_type *)));
|
||||
static void (*real_func) (lang_input_statement_type *);
|
||||
|
||||
static void (*real_func) PARAMS ((lang_input_statement_type *));
|
||||
|
||||
static void m68hc11_for_each_input_file_wrapper (l)
|
||||
lang_input_statement_type *l;
|
||||
static void m68hc11_for_each_input_file_wrapper (lang_input_statement_type *l)
|
||||
{
|
||||
if (l != stub_file)
|
||||
(*real_func) (l);
|
||||
}
|
||||
|
||||
static void
|
||||
m68hc11_lang_for_each_input_file (func)
|
||||
void (*func) PARAMS ((lang_input_statement_type *));
|
||||
m68hc11_lang_for_each_input_file (void (*func) (lang_input_statement_type *))
|
||||
{
|
||||
real_func = func;
|
||||
lang_for_each_input_file (&m68hc11_for_each_input_file_wrapper);
|
||||
|
@ -355,8 +337,8 @@ EOF
|
|||
# parse_args and list_options functions.
|
||||
#
|
||||
PARSE_AND_LIST_PROLOGUE='
|
||||
#define OPTION_NO_TRAMPOLINE 300
|
||||
#define OPTION_BANK_WINDOW 301
|
||||
#define OPTION_NO_TRAMPOLINE 300
|
||||
#define OPTION_BANK_WINDOW 301
|
||||
'
|
||||
|
||||
# The options are repeated below so that no abbreviations are allowed.
|
||||
|
|
|
@ -37,14 +37,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldemul.h"
|
||||
#include "ldmisc.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
static void check_sections PARAMS ((bfd *, asection *, PTR));
|
||||
static void gld${EMULATION_NAME}_after_allocation PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
static void check_sections (bfd *, asection *, void *);
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse ()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_set_output_arch ("`echo ${ARCH}`");
|
||||
|
@ -58,7 +54,7 @@ gld${EMULATION_NAME}_before_parse ()
|
|||
time. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
bfd *abfd;
|
||||
|
||||
|
@ -111,13 +107,10 @@ gld${EMULATION_NAME}_after_open ()
|
|||
relocs. This is called via bfd_map_over_sections. */
|
||||
|
||||
static void
|
||||
check_sections (abfd, sec, datasec)
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
PTR datasec;
|
||||
check_sections (bfd *abfd, asection *sec, void *datasec)
|
||||
{
|
||||
if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
|
||||
&& sec != (asection *) datasec
|
||||
&& sec != datasec
|
||||
&& sec->reloc_count != 0)
|
||||
einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
|
||||
abfd, bfd_get_section_name (abfd, sec));
|
||||
|
@ -128,7 +121,7 @@ check_sections (abfd, sec, datasec)
|
|||
BFD backend routine to do the work. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_allocation ()
|
||||
gld${EMULATION_NAME}_after_allocation (void)
|
||||
{
|
||||
bfd *abfd;
|
||||
|
||||
|
@ -164,8 +157,7 @@ gld${EMULATION_NAME}_after_allocation ()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script(isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -176,7 +168,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -197,7 +189,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -217,7 +209,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse,
|
||||
syslib_default,
|
||||
|
|
|
@ -31,16 +31,14 @@ esac
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void m68k_elf_after_open PARAMS ((void));
|
||||
#ifdef SUPPORT_EMBEDDED_RELOCS
|
||||
static void check_sections PARAMS ((bfd *, asection *, PTR));
|
||||
static void check_sections (bfd *, asection *, void *);
|
||||
#endif
|
||||
static void m68k_elf_after_allocation PARAMS ((void));
|
||||
|
||||
/* This function is run after all the input files have been opened. */
|
||||
|
||||
static void
|
||||
m68k_elf_after_open ()
|
||||
m68k_elf_after_open (void)
|
||||
{
|
||||
/* Call the standard elf routine. */
|
||||
gld${EMULATION_NAME}_after_open ();
|
||||
|
@ -106,10 +104,7 @@ m68k_elf_after_open ()
|
|||
relocs. This is called via bfd_map_over_sections. */
|
||||
|
||||
static void
|
||||
check_sections (abfd, sec, datasec)
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
PTR datasec;
|
||||
check_sections (bfd *abfd, asection *sec, PTR datasec)
|
||||
{
|
||||
if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
|
||||
&& sec != (asection *) datasec
|
||||
|
@ -124,7 +119,7 @@ check_sections (abfd, sec, datasec)
|
|||
been set. */
|
||||
|
||||
static void
|
||||
m68k_elf_after_allocation ()
|
||||
m68k_elf_after_allocation (void)
|
||||
{
|
||||
/* Call the standard elf routine. */
|
||||
after_allocation_default ();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# This shell script emits a C file. -*- C -*-
|
||||
# It does some substitutions.
|
||||
if [ -z "$MACHINE" ]; then
|
||||
if [ -z "$MACHINE" ]; then
|
||||
OUTPUT_ARCH=${ARCH}
|
||||
else
|
||||
OUTPUT_ARCH=${ARCH}:${MACHINE}
|
||||
|
@ -44,14 +44,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
static void check_sections PARAMS ((bfd *, asection *, PTR));
|
||||
static void gld${EMULATION_NAME}_after_allocation PARAMS ((void));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
static void check_sections (bfd *, asection *, void *);
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
|
@ -74,7 +70,7 @@ gld${EMULATION_NAME}_before_parse()
|
|||
have been compiled using -membedded-pic. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
bfd *abfd;
|
||||
|
||||
|
@ -119,7 +115,7 @@ gld${EMULATION_NAME}_after_open ()
|
|||
|
||||
/* Double check that all other data sections are empty, as is
|
||||
required for embedded PIC code. */
|
||||
bfd_map_over_sections (abfd, check_sections, (PTR) datasec);
|
||||
bfd_map_over_sections (abfd, check_sections, datasec);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,13 +123,10 @@ gld${EMULATION_NAME}_after_open ()
|
|||
relocs. This is called via bfd_map_over_sections. */
|
||||
|
||||
static void
|
||||
check_sections (abfd, sec, sdatasec)
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
PTR sdatasec;
|
||||
check_sections (bfd *abfd, asection *sec, void *sdatasec)
|
||||
{
|
||||
if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0
|
||||
&& sec != (asection *) sdatasec
|
||||
&& sec != sdatasec
|
||||
&& sec->reloc_count != 0)
|
||||
einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
|
||||
abfd, bfd_get_section_name (abfd, sec));
|
||||
|
@ -144,7 +137,7 @@ check_sections (abfd, sec, sdatasec)
|
|||
BFD backend routine to do the work. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_allocation ()
|
||||
gld${EMULATION_NAME}_after_allocation (void)
|
||||
{
|
||||
bfd *abfd;
|
||||
|
||||
|
@ -180,8 +173,7 @@ gld${EMULATION_NAME}_after_allocation ()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script(isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
@ -192,7 +184,7 @@ then
|
|||
sc="-f stringify.sed"
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 0;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -213,7 +205,7 @@ else
|
|||
# Scripts read from the filesystem.
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
{
|
||||
{
|
||||
*isfile = 1;
|
||||
|
||||
if (link_info.relocatable && config.build_constructors)
|
||||
|
@ -233,7 +225,7 @@ fi
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse,
|
||||
syslib_default,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# This shell script emits a C file. -*- C -*-
|
||||
# Copyright 2002, 2003 Free Software Foundation, Inc.
|
||||
# Written by Mitch Lichtenberg <mpl@broadcom.com> and
|
||||
# Chris Demetriou <cgd@broadcom.com> based on m68kelf.em and mipsecoff.em.
|
||||
|
@ -17,7 +18,6 @@
|
|||
# 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.
|
||||
# This shell script emits a C file. -*- C -*-
|
||||
|
||||
|
||||
# This file is sourced from elf32.em, and defines some extra routines for m68k
|
||||
|
@ -33,17 +33,14 @@ esac
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void mips_elf${ELFSIZE}_after_open PARAMS ((void));
|
||||
#ifdef SUPPORT_EMBEDDED_RELOCS
|
||||
static void mips_elf${ELFSIZE}_check_sections PARAMS ((bfd *, asection *,
|
||||
PTR));
|
||||
static void mips_elf${ELFSIZE}_check_sections (bfd *, asection *, void *);
|
||||
#endif
|
||||
static void mips_elf${ELFSIZE}_after_allocation PARAMS ((void));
|
||||
|
||||
/* This function is run after all the input files have been opened. */
|
||||
|
||||
static void
|
||||
mips_elf${ELFSIZE}_after_open()
|
||||
mips_elf${ELFSIZE}_after_open (void)
|
||||
{
|
||||
/* Call the standard elf routine. */
|
||||
gld${EMULATION_NAME}_after_open ();
|
||||
|
@ -105,7 +102,7 @@ mips_elf${ELFSIZE}_after_open()
|
|||
/* Double check that all other data sections have no relocs,
|
||||
as is required for embedded PIC code. */
|
||||
bfd_map_over_sections (abfd, mips_elf${ELFSIZE}_check_sections,
|
||||
(PTR) datasec);
|
||||
datasec);
|
||||
}
|
||||
}
|
||||
#endif /* SUPPORT_EMBEDDED_RELOCS */
|
||||
|
@ -116,13 +113,10 @@ mips_elf${ELFSIZE}_after_open()
|
|||
relocs. This is called via bfd_map_over_sections. */
|
||||
|
||||
static void
|
||||
mips_elf${ELFSIZE}_check_sections (abfd, sec, sdatasec)
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
PTR sdatasec;
|
||||
mips_elf${ELFSIZE}_check_sections (bfd *abfd, asection *sec, void *sdatasec)
|
||||
{
|
||||
if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
|
||||
&& sec != (asection *) sdatasec
|
||||
&& sec != sdatasec
|
||||
&& sec->reloc_count != 0)
|
||||
einfo ("%B%X: section %s has relocs; cannot use --embedded-relocs\n",
|
||||
abfd, bfd_get_section_name (abfd, sec));
|
||||
|
@ -134,7 +128,7 @@ mips_elf${ELFSIZE}_check_sections (abfd, sec, sdatasec)
|
|||
BFD backend routine to do the work. */
|
||||
|
||||
static void
|
||||
mips_elf${ELFSIZE}_after_allocation ()
|
||||
mips_elf${ELFSIZE}_after_allocation (void)
|
||||
{
|
||||
/* Call the standard elf routine. */
|
||||
after_allocation_default ();
|
||||
|
|
|
@ -24,13 +24,10 @@
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
#include "elf/mmix.h"
|
||||
|
||||
static void mmix_before_allocation PARAMS ((void));
|
||||
static void mmix_after_allocation PARAMS ((void));
|
||||
|
||||
/* Set up handling of linker-allocated global registers. */
|
||||
|
||||
static void
|
||||
mmix_before_allocation ()
|
||||
mmix_before_allocation (void)
|
||||
{
|
||||
/* Call the default first. */
|
||||
gld${EMULATION_NAME}_before_allocation ();
|
||||
|
@ -55,7 +52,7 @@ mmix_before_allocation ()
|
|||
GREGs. */
|
||||
|
||||
static void
|
||||
mmix_after_allocation ()
|
||||
mmix_after_allocation (void)
|
||||
{
|
||||
asection *sec
|
||||
= bfd_get_section_by_name (output_bfd, MMIX_REG_CONTENTS_SECTION_NAME);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# This shell script emits a C file. -*- C -*-
|
||||
# Copyright 2001, 2002 Free Software Foundation, Inc.
|
||||
# Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GLD, the Gnu Linker.
|
||||
#
|
||||
|
@ -26,10 +26,8 @@
|
|||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
#line 29 "${srcdir}/emultempl/elfmmix.em"
|
||||
|
||||
static void elfmmix_before_parse PARAMS ((void));
|
||||
|
||||
static void
|
||||
elfmmix_before_parse ()
|
||||
elfmmix_before_parse (void)
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse ();
|
||||
|
||||
|
|
|
@ -32,22 +32,13 @@ EOF
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static bfd_boolean mmo_place_orphan
|
||||
PARAMS ((lang_input_statement_type *, asection *));
|
||||
static asection *output_prev_sec_find
|
||||
PARAMS ((lang_output_section_statement_type *));
|
||||
static void mmo_finish PARAMS ((void));
|
||||
static void mmo_wipe_sec_reloc_flag PARAMS ((bfd *, asection *, PTR));
|
||||
static void mmo_after_open PARAMS ((void));
|
||||
|
||||
/* Find the last output section before given output statement.
|
||||
Used by place_orphan. */
|
||||
|
||||
static asection *
|
||||
output_prev_sec_find (os)
|
||||
lang_output_section_statement_type *os;
|
||||
output_prev_sec_find (lang_output_section_statement_type *os)
|
||||
{
|
||||
asection *s = (asection *) NULL;
|
||||
asection *s = NULL;
|
||||
lang_statement_union_type *u;
|
||||
lang_output_section_statement_type *lookup;
|
||||
|
||||
|
@ -85,9 +76,7 @@ struct orphan_save {
|
|||
from elf32.em. */
|
||||
|
||||
static bfd_boolean
|
||||
mmo_place_orphan (file, s)
|
||||
lang_input_statement_type *file;
|
||||
asection *s;
|
||||
mmo_place_orphan (lang_input_statement_type *file, asection *s)
|
||||
{
|
||||
static struct orphan_save hold_text;
|
||||
struct orphan_save *place;
|
||||
|
@ -227,10 +216,7 @@ mmo_place_orphan (file, s)
|
|||
paper over the bug similarly. */
|
||||
|
||||
static void
|
||||
mmo_wipe_sec_reloc_flag (abfd, sec, ptr)
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
PTR ptr ATTRIBUTE_UNUSED;
|
||||
mmo_wipe_sec_reloc_flag (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
bfd_set_section_flags (abfd, sec,
|
||||
bfd_get_section_flags (abfd, sec) & ~SEC_RELOC);
|
||||
|
@ -239,7 +225,7 @@ mmo_wipe_sec_reloc_flag (abfd, sec, ptr)
|
|||
/* Iterate with bfd_map_over_sections over mmo_wipe_sec_reloc_flag... */
|
||||
|
||||
static void
|
||||
mmo_finish ()
|
||||
mmo_finish (void)
|
||||
{
|
||||
bfd_map_over_sections (output_bfd, mmo_wipe_sec_reloc_flag, NULL);
|
||||
}
|
||||
|
@ -251,7 +237,7 @@ mmo_finish ()
|
|||
when all input files are seen, which is equivalent. */
|
||||
|
||||
static void
|
||||
mmo_after_open ()
|
||||
mmo_after_open (void)
|
||||
{
|
||||
/* When there's a mismatch between the output format and the emulation
|
||||
(using weird combinations like "-m mmo --oformat elf64-mmix" for
|
||||
|
|
|
@ -25,10 +25,8 @@ LDEMUL_BEFORE_ALLOCATION=need_relax_${EMULATION_NAME}_before_allocation
|
|||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
|
||||
static void need_relax_${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
|
||||
static void
|
||||
need_relax_${EMULATION_NAME}_before_allocation ()
|
||||
need_relax_${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
/* Call main function; we're just extending it. */
|
||||
gld${EMULATION_NAME}_before_allocation ();
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
LDEMUL_BEFORE_PARSE=gldnetbsd_before_parse
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
static void gldnetbsd_before_parse PARAMS ((void));
|
||||
|
||||
cat >>e${EMULATION_NAME}.c <<EOF
|
||||
static void
|
||||
gldnetbsd_before_parse ()
|
||||
gldnetbsd_before_parse (void)
|
||||
{
|
||||
gld${EMULATION_NAME}_before_parse ();
|
||||
link_info.common_skip_ar_aymbols = bfd_link_common_skip_text;
|
||||
|
|
|
@ -103,44 +103,6 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
#define PE_DEF_FILE_ALIGNMENT 0x00000200
|
||||
#endif
|
||||
|
||||
static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_after_parse PARAMS ((void));
|
||||
static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
static asection *output_prev_sec_find
|
||||
PARAMS ((lang_output_section_statement_type *));
|
||||
static bfd_boolean gld_${EMULATION_NAME}_place_orphan
|
||||
PARAMS ((lang_input_statement_type *, asection *));
|
||||
static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
|
||||
static void gld_${EMULATION_NAME}_finish PARAMS ((void));
|
||||
static bfd_boolean gld_${EMULATION_NAME}_open_dynamic_archive
|
||||
PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
|
||||
static void gld${EMULATION_NAME}_add_options
|
||||
PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
static bfd_boolean gld${EMULATION_NAME}_handle_option PARAMS ((int));
|
||||
static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
|
||||
static void set_pe_name PARAMS ((char *, long));
|
||||
static void set_pe_subsystem PARAMS ((void));
|
||||
static void set_pe_value PARAMS ((char *));
|
||||
static void set_pe_stack_heap PARAMS ((char *, char *));
|
||||
|
||||
#ifdef DLL_SUPPORT
|
||||
static bfd_boolean pe_undef_cdecl_match
|
||||
PARAMS ((struct bfd_link_hash_entry *, PTR));
|
||||
static void pe_fixup_stdcalls PARAMS ((void));
|
||||
static int make_import_fixup PARAMS ((arelent *, asection *));
|
||||
static void pe_find_data_imports PARAMS ((void));
|
||||
#endif
|
||||
|
||||
static bfd_boolean pr_sym PARAMS ((struct bfd_hash_entry *, PTR));
|
||||
static bfd_boolean gld_${EMULATION_NAME}_unrecognized_file
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static bfd_boolean gld_${EMULATION_NAME}_recognized_file
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static int gld_${EMULATION_NAME}_find_potential_libraries
|
||||
PARAMS ((char *, lang_input_statement_type *));
|
||||
|
||||
|
||||
static struct internal_extra_pe_aouthdr pe;
|
||||
static int dll;
|
||||
|
@ -159,7 +121,7 @@ static char *pe_dll_search_prefix = NULL;
|
|||
extern const char *output_filename;
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_before_parse()
|
||||
gld_${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
if (arch)
|
||||
|
@ -201,8 +163,8 @@ gld_${EMULATION_NAME}_before_parse()
|
|||
#define OPTION_MINOR_OS_VERSION (OPTION_MINOR_IMAGE_VERSION + 1)
|
||||
#define OPTION_MINOR_SUBSYSTEM_VERSION (OPTION_MINOR_OS_VERSION + 1)
|
||||
#define OPTION_SECTION_ALIGNMENT (OPTION_MINOR_SUBSYSTEM_VERSION + 1)
|
||||
#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1)
|
||||
#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
|
||||
#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1)
|
||||
#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
|
||||
#define OPTION_HEAP (OPTION_SUBSYSTEM + 1)
|
||||
#define OPTION_SUPPORT_OLD_CODE (OPTION_HEAP + 1)
|
||||
#define OPTION_OUT_DEF (OPTION_SUPPORT_OLD_CODE + 1)
|
||||
|
@ -230,13 +192,10 @@ gld_${EMULATION_NAME}_before_parse()
|
|||
(OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1)
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns ATTRIBUTE_UNUSED;
|
||||
char **shortopts ATTRIBUTE_UNUSED;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
gld${EMULATION_NAME}_add_options
|
||||
(int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
|
||||
struct option **longopts, int nrl ATTRIBUTE_UNUSED,
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static const struct option xtra_long[] = {
|
||||
/* PE options */
|
||||
|
@ -336,8 +295,7 @@ static definfo init[] =
|
|||
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_list_options (file)
|
||||
FILE * file;
|
||||
gld_${EMULATION_NAME}_list_options (FILE *file)
|
||||
{
|
||||
fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
|
||||
fprintf (file, _(" --dll Set image base to the default for DLLs\n"));
|
||||
|
@ -389,9 +347,7 @@ gld_${EMULATION_NAME}_list_options (file)
|
|||
|
||||
|
||||
static void
|
||||
set_pe_name (name, val)
|
||||
char *name;
|
||||
long val;
|
||||
set_pe_name (char *name, long val)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -410,7 +366,7 @@ set_pe_name (name, val)
|
|||
|
||||
|
||||
static void
|
||||
set_pe_subsystem ()
|
||||
set_pe_subsystem (void)
|
||||
{
|
||||
const char *sver;
|
||||
int len;
|
||||
|
@ -494,9 +450,7 @@ set_pe_subsystem ()
|
|||
|
||||
|
||||
static void
|
||||
set_pe_value (name)
|
||||
char *name;
|
||||
|
||||
set_pe_value (char *name)
|
||||
{
|
||||
char *end;
|
||||
|
||||
|
@ -510,9 +464,7 @@ set_pe_value (name)
|
|||
|
||||
|
||||
static void
|
||||
set_pe_stack_heap (resname, comname)
|
||||
char *resname;
|
||||
char *comname;
|
||||
set_pe_stack_heap (char *resname, char *comname)
|
||||
{
|
||||
set_pe_value (resname);
|
||||
|
||||
|
@ -527,8 +479,7 @@ set_pe_stack_heap (resname, comname)
|
|||
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_handle_option (optc)
|
||||
int optc;
|
||||
gld${EMULATION_NAME}_handle_option (int optc)
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
|
@ -536,7 +487,7 @@ gld${EMULATION_NAME}_handle_option (optc)
|
|||
return FALSE;
|
||||
|
||||
case OPTION_BASE_FILE:
|
||||
link_info.base_file = (PTR) fopen (optarg, FOPEN_WB);
|
||||
link_info.base_file = fopen (optarg, FOPEN_WB);
|
||||
if (link_info.base_file == NULL)
|
||||
{
|
||||
/* xgettext:c-format */
|
||||
|
@ -697,7 +648,7 @@ compute_dll_image_base (const char *ofile)
|
|||
read. */
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_set_symbols ()
|
||||
gld_${EMULATION_NAME}_set_symbols (void)
|
||||
{
|
||||
/* Run through and invent symbols for all the
|
||||
names and insert the defaults. */
|
||||
|
@ -761,7 +712,7 @@ gld_${EMULATION_NAME}_set_symbols ()
|
|||
have been read. */
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_after_parse ()
|
||||
gld_${EMULATION_NAME}_after_parse (void)
|
||||
{
|
||||
/* The Windows libraries are designed for the linker to treat the
|
||||
entry point as an undefined symbol. Otherwise, the .obj that
|
||||
|
@ -791,13 +742,12 @@ char * pe_data_import_dll;
|
|||
static struct bfd_link_hash_entry *pe_undef_found_sym;
|
||||
|
||||
static bfd_boolean
|
||||
pe_undef_cdecl_match (h, string)
|
||||
struct bfd_link_hash_entry *h;
|
||||
PTR string;
|
||||
pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf)
|
||||
{
|
||||
int sl;
|
||||
char *string = inf;
|
||||
|
||||
sl = strlen (string); /* Silence compiler warning. */
|
||||
sl = strlen (string);
|
||||
if (h->type == bfd_link_hash_defined
|
||||
&& strncmp (h->root.string, string, sl) == 0
|
||||
&& h->root.string[sl] == '@')
|
||||
|
@ -809,7 +759,7 @@ pe_undef_cdecl_match (h, string)
|
|||
}
|
||||
|
||||
static void
|
||||
pe_fixup_stdcalls ()
|
||||
pe_fixup_stdcalls (void)
|
||||
{
|
||||
static int gave_warning_message = 0;
|
||||
struct bfd_link_hash_entry *undef, *sym;
|
||||
|
@ -858,7 +808,7 @@ pe_fixup_stdcalls ()
|
|||
symbols - which means scanning the whole symbol table. */
|
||||
pe_undef_found_sym = 0;
|
||||
bfd_link_hash_traverse (link_info.hash, pe_undef_cdecl_match,
|
||||
(PTR) undef->root.string);
|
||||
(char *) undef->root.string);
|
||||
sym = pe_undef_found_sym;
|
||||
if (sym)
|
||||
{
|
||||
|
@ -883,9 +833,7 @@ pe_fixup_stdcalls ()
|
|||
}
|
||||
|
||||
static int
|
||||
make_import_fixup (rel, s)
|
||||
arelent *rel;
|
||||
asection *s;
|
||||
make_import_fixup (arelent *rel, asection *s)
|
||||
{
|
||||
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
|
||||
int addend = 0;
|
||||
|
@ -904,7 +852,7 @@ make_import_fixup (rel, s)
|
|||
}
|
||||
|
||||
static void
|
||||
pe_find_data_imports ()
|
||||
pe_find_data_imports (void)
|
||||
{
|
||||
struct bfd_link_hash_entry *undef, *sym;
|
||||
|
||||
|
@ -971,19 +919,17 @@ pe_find_data_imports ()
|
|||
#endif /* DLL_SUPPORT */
|
||||
|
||||
static bfd_boolean
|
||||
pr_sym (h, string)
|
||||
struct bfd_hash_entry *h;
|
||||
PTR string ATTRIBUTE_UNUSED;
|
||||
pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (pe_dll_extra_pe_debug)
|
||||
printf ("+%s\n",h->string);
|
||||
printf ("+%s\n", h->string);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_after_open ()
|
||||
gld_${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
if (pe_dll_extra_pe_debug)
|
||||
{
|
||||
|
@ -994,7 +940,7 @@ gld_${EMULATION_NAME}_after_open ()
|
|||
|
||||
for (sym = link_info.hash->undefs; sym; sym=sym->next)
|
||||
printf ("-%s\n", sym->root.string);
|
||||
bfd_hash_traverse (&link_info.hash->table, pr_sym,NULL);
|
||||
bfd_hash_traverse (&link_info.hash->table, pr_sym, NULL);
|
||||
|
||||
for (a = link_info.input_bfds; a; a = a->link_next)
|
||||
printf ("*%s\n",a->filename);
|
||||
|
@ -1229,7 +1175,7 @@ gld_${EMULATION_NAME}_after_open ()
|
|||
}
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_before_allocation ()
|
||||
gld_${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
#ifdef TARGET_IS_ppcpe
|
||||
/* Here we rummage through the found bfds to collect toc information. */
|
||||
|
@ -1278,7 +1224,7 @@ gld_${EMULATION_NAME}_before_allocation ()
|
|||
check here for .DEF files and pull them in automatically. */
|
||||
|
||||
static int
|
||||
saw_option (char * option)
|
||||
saw_option (char *option)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1290,8 +1236,7 @@ saw_option (char * option)
|
|||
#endif /* DLL_SUPPORT */
|
||||
|
||||
static bfd_boolean
|
||||
gld_${EMULATION_NAME}_unrecognized_file (entry)
|
||||
lang_input_statement_type *entry ATTRIBUTE_UNUSED;
|
||||
gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef DLL_SUPPORT
|
||||
const char *ext = entry->filename + strlen (entry->filename) - 4;
|
||||
|
@ -1380,8 +1325,7 @@ gld_${EMULATION_NAME}_unrecognized_file (entry)
|
|||
}
|
||||
|
||||
static bfd_boolean
|
||||
gld_${EMULATION_NAME}_recognized_file (entry)
|
||||
lang_input_statement_type *entry ATTRIBUTE_UNUSED;
|
||||
gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef DLL_SUPPORT
|
||||
#ifdef TARGET_IS_i386pe
|
||||
|
@ -1414,7 +1358,7 @@ gld_${EMULATION_NAME}_recognized_file (entry)
|
|||
}
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_finish ()
|
||||
gld_${EMULATION_NAME}_finish (void)
|
||||
{
|
||||
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
|
||||
struct bfd_link_hash_entry * h;
|
||||
|
@ -1498,8 +1442,7 @@ gld_${EMULATION_NAME}_finish ()
|
|||
Used by place_orphan. */
|
||||
|
||||
static asection *
|
||||
output_prev_sec_find (os)
|
||||
lang_output_section_statement_type *os;
|
||||
output_prev_sec_find (lang_output_section_statement_type *os)
|
||||
{
|
||||
asection *s = (asection *) NULL;
|
||||
lang_statement_union_type *u;
|
||||
|
@ -1541,9 +1484,7 @@ struct orphan_save
|
|||
};
|
||||
|
||||
static bfd_boolean
|
||||
gld_${EMULATION_NAME}_place_orphan (file, s)
|
||||
lang_input_statement_type *file;
|
||||
asection *s;
|
||||
gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
|
||||
{
|
||||
const char *secname;
|
||||
char *hold_section_name;
|
||||
|
@ -1824,10 +1765,9 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
|
|||
}
|
||||
|
||||
static bfd_boolean
|
||||
gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
|
||||
const char * arch ATTRIBUTE_UNUSED;
|
||||
search_dirs_type * search;
|
||||
lang_input_statement_type * entry;
|
||||
gld_${EMULATION_NAME}_open_dynamic_archive
|
||||
(const char *arch ATTRIBUTE_UNUSED, search_dirs_type *search,
|
||||
lang_input_statement_type *entry)
|
||||
{
|
||||
const char * filename;
|
||||
char * string;
|
||||
|
@ -1915,16 +1855,14 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
|
|||
}
|
||||
|
||||
static int
|
||||
gld_${EMULATION_NAME}_find_potential_libraries (name, entry)
|
||||
char * name;
|
||||
lang_input_statement_type * entry;
|
||||
gld_${EMULATION_NAME}_find_potential_libraries
|
||||
(char *name, lang_input_statement_type *entry)
|
||||
{
|
||||
return ldfile_open_file_search (name, entry, "", ".lib");
|
||||
}
|
||||
|
||||
static char *
|
||||
gld_${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
gld_${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
# Scripts compiled in.
|
||||
# sed commands to quote an ld script as a C string.
|
||||
|
|
|
@ -33,9 +33,6 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
#include "elf/sh.h"
|
||||
#include "elf32-sh64.h"
|
||||
|
||||
static void sh64_elf_${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
static void sh64_elf_${EMULATION_NAME}_after_allocation PARAMS ((void));
|
||||
|
||||
/* Check if we need a .cranges section and create it if it's not in any
|
||||
input file. It might seem better to always create it and if unneeded,
|
||||
discard it, but I don't find a simple way to discard it totally from
|
||||
|
@ -47,7 +44,7 @@ static void sh64_elf_${EMULATION_NAME}_after_allocation PARAMS ((void));
|
|||
they will be linked. */
|
||||
|
||||
static void
|
||||
sh64_elf_${EMULATION_NAME}_before_allocation ()
|
||||
sh64_elf_${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
asection *cranges;
|
||||
asection *osec;
|
||||
|
@ -240,7 +237,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation ()
|
|||
/* Size up and extend the .cranges section, merging generated entries. */
|
||||
|
||||
static void
|
||||
sh64_elf_${EMULATION_NAME}_after_allocation ()
|
||||
sh64_elf_${EMULATION_NAME}_after_allocation (void)
|
||||
{
|
||||
bfd_vma new_cranges = 0;
|
||||
bfd_vma cranges_growth = 0;
|
||||
|
@ -384,8 +381,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
|
|||
/* Make sure we have .cranges in memory even if there were only
|
||||
assembler-generated .cranges. */
|
||||
cranges_growth = new_cranges * SH64_CRANGE_SIZE;
|
||||
cranges->contents
|
||||
= (bfd_byte *) xcalloc (cranges->_raw_size + cranges_growth, 1);
|
||||
cranges->contents = xcalloc (cranges->_raw_size + cranges_growth, 1);
|
||||
bfd_set_section_flags (cranges->owner, cranges,
|
||||
bfd_get_section_flags (cranges->owner, cranges)
|
||||
| SEC_IN_MEMORY);
|
||||
|
@ -507,8 +503,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
|
|||
- cranges->contents);
|
||||
cr_addr_order->size = 4;
|
||||
cr_addr_order->u.reloc.p
|
||||
= ((struct bfd_link_order_reloc *)
|
||||
xmalloc (sizeof (struct bfd_link_order_reloc)));
|
||||
= xmalloc (sizeof (struct bfd_link_order_reloc));
|
||||
|
||||
cr_addr_order->u.reloc.p->reloc = BFD_RELOC_32;
|
||||
cr_addr_order->u.reloc.p->u.section = osec;
|
||||
|
@ -540,7 +535,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
|
|||
bfd_put_32 (output_bfd, cr_size,
|
||||
crangesp + SH64_CRANGE_CR_SIZE_OFFSET);
|
||||
|
||||
bfd_put_16 (output_bfd, (bfd_vma) cr_type,
|
||||
bfd_put_16 (output_bfd, cr_type,
|
||||
crangesp + SH64_CRANGE_CR_TYPE_OFFSET);
|
||||
|
||||
last_cr_type = cr_type;
|
||||
|
|
|
@ -61,33 +61,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
# endif
|
||||
#endif
|
||||
|
||||
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_set_symbols PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_create_output_section_statements
|
||||
PARAMS ((void));
|
||||
static void gld${EMULATION_NAME}_find_so
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
(lang_input_statement_type *);
|
||||
static char *gld${EMULATION_NAME}_search_dir
|
||||
PARAMS ((const char *, const char *, bfd_boolean *));
|
||||
static void gld${EMULATION_NAME}_after_open PARAMS ((void));
|
||||
(const char *, const char *, bfd_boolean *);
|
||||
static void gld${EMULATION_NAME}_check_needed
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
(lang_input_statement_type *);
|
||||
static bfd_boolean gld${EMULATION_NAME}_search_needed
|
||||
PARAMS ((const char *, const char *));
|
||||
(const char *, const char *);
|
||||
static bfd_boolean gld${EMULATION_NAME}_try_needed
|
||||
PARAMS ((const char *, const char *));
|
||||
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
|
||||
(const char *, const char *);
|
||||
static void gld${EMULATION_NAME}_find_assignment
|
||||
PARAMS ((lang_statement_union_type *));
|
||||
static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *));
|
||||
(lang_statement_union_type *);
|
||||
static void gld${EMULATION_NAME}_find_exp_assignment
|
||||
(etree_type *);
|
||||
static void gld${EMULATION_NAME}_count_need
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
(lang_input_statement_type *);
|
||||
static void gld${EMULATION_NAME}_set_need
|
||||
PARAMS ((lang_input_statement_type *));
|
||||
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
|
||||
(lang_input_statement_type *);
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_parse()
|
||||
gld${EMULATION_NAME}_before_parse (void)
|
||||
{
|
||||
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
|
||||
if (arch)
|
||||
|
@ -108,7 +102,7 @@ gld${EMULATION_NAME}_before_parse()
|
|||
list. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_set_symbols ()
|
||||
gld${EMULATION_NAME}_set_symbols (void)
|
||||
{
|
||||
EOF
|
||||
if [ "x${host}" = "x${target}" ] ; then
|
||||
|
@ -154,7 +148,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
search it after including the .so file. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_create_output_section_statements ()
|
||||
gld${EMULATION_NAME}_create_output_section_statements (void)
|
||||
{
|
||||
lang_for_each_input_file (gld${EMULATION_NAME}_find_so);
|
||||
}
|
||||
|
@ -162,8 +156,7 @@ gld${EMULATION_NAME}_create_output_section_statements ()
|
|||
/* Search the directory for a .so file for each library search. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_so (inp)
|
||||
lang_input_statement_type *inp;
|
||||
gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp)
|
||||
{
|
||||
search_dirs_type *search;
|
||||
char *found = NULL;
|
||||
|
@ -234,10 +227,8 @@ gld${EMULATION_NAME}_find_so (inp)
|
|||
/* Search a directory for a .so file. */
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
|
||||
const char *dirname;
|
||||
const char *filename;
|
||||
bfd_boolean *found_static;
|
||||
gld${EMULATION_NAME}_search_dir
|
||||
(const char *dirname, const char *filename, bfd_boolean *found_static)
|
||||
{
|
||||
int force_maj, force_min;
|
||||
const char *dot;
|
||||
|
@ -302,9 +293,9 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
|
|||
}
|
||||
|
||||
/* We accept libfoo.so without a version number, even though the
|
||||
native linker does not. This is more convenient for packages
|
||||
which just generate .so files for shared libraries, as on ELF
|
||||
systems. */
|
||||
native linker does not. This is more convenient for packages
|
||||
which just generate .so files for shared libraries, as on ELF
|
||||
systems. */
|
||||
if (strncmp (entry->d_name + 3 + len, ".so", 3) != 0)
|
||||
continue;
|
||||
if (entry->d_name[6 + len] == '\0')
|
||||
|
@ -378,7 +369,7 @@ static bfd_boolean global_found;
|
|||
/* This is called after all the input files have been opened. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_after_open ()
|
||||
gld${EMULATION_NAME}_after_open (void)
|
||||
{
|
||||
struct bfd_link_needed_list *needed, *l;
|
||||
|
||||
|
@ -514,9 +505,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
|
|||
/* Search for a needed file in a path. */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_search_needed (path, name)
|
||||
const char *path;
|
||||
const char *name;
|
||||
gld${EMULATION_NAME}_search_needed (const char *path, const char *name)
|
||||
{
|
||||
const char *s;
|
||||
|
||||
|
@ -559,9 +548,7 @@ gld${EMULATION_NAME}_search_needed (path, name)
|
|||
dynamic object. */
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_try_needed (dir, name)
|
||||
const char *dir;
|
||||
const char *name;
|
||||
gld${EMULATION_NAME}_try_needed (const char *dir, const char *name)
|
||||
{
|
||||
char *file;
|
||||
char *alc;
|
||||
|
@ -603,8 +590,7 @@ gld${EMULATION_NAME}_try_needed (dir, name)
|
|||
dynamic object more than once. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_check_needed (s)
|
||||
lang_input_statement_type *s;
|
||||
gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
|
||||
{
|
||||
if (s->filename == NULL)
|
||||
return;
|
||||
|
@ -679,7 +665,7 @@ static bfd_byte *need_pnames;
|
|||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation ()
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
struct bfd_link_hash_entry *hdyn = NULL;
|
||||
asection *sneed;
|
||||
|
@ -718,7 +704,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
lang_output_section_statement_type *os;
|
||||
|
||||
/* Set the .text section to start at 0x20, not 0x2020. FIXME:
|
||||
This is too magical. */
|
||||
This is too magical. */
|
||||
os = lang_output_section_statement_lookup (".text");
|
||||
if (os->addr_tree == NULL)
|
||||
os->addr_tree = exp_intop (0x20);
|
||||
|
@ -842,8 +828,7 @@ gld${EMULATION_NAME}_before_allocation ()
|
|||
symbols which are referred to by dynamic objects. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_assignment (s)
|
||||
lang_statement_union_type *s;
|
||||
gld${EMULATION_NAME}_find_assignment (lang_statement_union_type *s)
|
||||
{
|
||||
if (s->header.type == lang_assignment_statement_enum
|
||||
&& (find_assign == NULL || ! found_assign))
|
||||
|
@ -853,8 +838,7 @@ gld${EMULATION_NAME}_find_assignment (s)
|
|||
/* Look through an expression for an assignment statement. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_find_exp_assignment (exp)
|
||||
etree_type *exp;
|
||||
gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
|
||||
{
|
||||
switch (exp->type.node_class)
|
||||
{
|
||||
|
@ -902,8 +886,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
|
|||
for more information. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_count_need (inp)
|
||||
lang_input_statement_type *inp;
|
||||
gld${EMULATION_NAME}_count_need (lang_input_statement_type *inp)
|
||||
{
|
||||
if (inp->the_bfd != NULL
|
||||
&& (inp->the_bfd->flags & DYNAMIC) != 0)
|
||||
|
@ -924,8 +907,7 @@ gld${EMULATION_NAME}_count_need (inp)
|
|||
/* Fill in the contents of the .need section. */
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_set_need (inp)
|
||||
lang_input_statement_type *inp;
|
||||
gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
|
||||
{
|
||||
if (inp->the_bfd != NULL
|
||||
&& (inp->the_bfd->flags & DYNAMIC) != 0)
|
||||
|
@ -974,8 +956,7 @@ gld${EMULATION_NAME}_set_need (inp)
|
|||
}
|
||||
|
||||
static char *
|
||||
gld${EMULATION_NAME}_get_script(isfile)
|
||||
int *isfile;
|
||||
gld${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
|
||||
if test -n "$COMPILE_IN"
|
||||
|
|
|
@ -39,24 +39,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
static int coff_version;
|
||||
|
||||
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
|
||||
static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
|
||||
static void gld${EMULATION_NAME}_add_options
|
||||
PARAMS ((int, char **, int, struct option **, int, struct option **));
|
||||
static bfd_boolean gld${EMULATION_NAME}_handle_option PARAMS ((int));
|
||||
static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
|
||||
|
||||
/* TI COFF extra command line options */
|
||||
#define OPTION_COFF_FORMAT (300 + 1)
|
||||
|
||||
static void
|
||||
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
|
||||
int ns ATTRIBUTE_UNUSED;
|
||||
char **shortopts ATTRIBUTE_UNUSED;
|
||||
int nl;
|
||||
struct option **longopts;
|
||||
int nrl ATTRIBUTE_UNUSED;
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED;
|
||||
gld${EMULATION_NAME}_add_options
|
||||
(int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
|
||||
struct option **longopts, int nrl ATTRIBUTE_UNUSED,
|
||||
struct option **really_longopts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static const struct option xtra_long[] = {
|
||||
/* TI COFF options */
|
||||
|
@ -70,15 +60,13 @@ gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longo
|
|||
}
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_list_options (file)
|
||||
FILE * file;
|
||||
gld_${EMULATION_NAME}_list_options (FILE * file)
|
||||
{
|
||||
fprintf (file, _(" --format 0|1|2 Specify which COFF version to use"));
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
gld${EMULATION_NAME}_handle_option (optc)
|
||||
int optc;
|
||||
gld${EMULATION_NAME}_handle_option (int optc)
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
|
@ -106,7 +94,7 @@ gld${EMULATION_NAME}_handle_option (optc)
|
|||
}
|
||||
|
||||
static void
|
||||
gld_${EMULATION_NAME}_before_parse()
|
||||
gld_${EMULATION_NAME}_before_parse(void)
|
||||
{
|
||||
#ifndef TARGET_ /* I.e., if not generic. */
|
||||
ldfile_set_output_arch ("`echo ${ARCH}`");
|
||||
|
@ -114,8 +102,7 @@ gld_${EMULATION_NAME}_before_parse()
|
|||
}
|
||||
|
||||
static char *
|
||||
gld_${EMULATION_NAME}_get_script (isfile)
|
||||
int *isfile;
|
||||
gld_${EMULATION_NAME}_get_script (int *isfile)
|
||||
EOF
|
||||
if test -n "$COMPILE_IN"
|
||||
then
|
||||
|
|
|
@ -35,17 +35,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "ldfile.h"
|
||||
#include "ldemul.h"
|
||||
|
||||
static void vanilla_before_parse PARAMS ((void));
|
||||
static void vanilla_set_output_arch PARAMS ((void));
|
||||
static char *vanilla_get_script PARAMS ((int *));
|
||||
|
||||
|
||||
static void vanilla_before_parse()
|
||||
static void vanilla_before_parse (void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vanilla_set_output_arch()
|
||||
vanilla_set_output_arch (void)
|
||||
{
|
||||
/* Set the output architecture and machine if possible */
|
||||
unsigned long machine = 0;
|
||||
|
@ -53,14 +48,13 @@ vanilla_set_output_arch()
|
|||
}
|
||||
|
||||
static char *
|
||||
vanilla_get_script(isfile)
|
||||
int *isfile;
|
||||
vanilla_get_script (int *isfile)
|
||||
{
|
||||
*isfile = 0;
|
||||
return "";
|
||||
}
|
||||
|
||||
struct ld_emulation_xfer_struct ld_vanilla_emulation =
|
||||
struct ld_emulation_xfer_struct ld_vanilla_emulation =
|
||||
{
|
||||
vanilla_before_parse,
|
||||
syslib_default,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue