/* This file is is generated by a shell script. DO NOT EDIT! */
/* SunOS emulation code for ${EMULATION_NAME}
- Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
# 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)
- {
- ldfile_output_architecture = arch->arch;
- ldfile_output_machine = arch->mach;
- ldfile_output_machine_name = arch->printable_name;
- }
- else
- ldfile_output_architecture = bfd_arch_${ARCH};
+ ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
config.dynamic_link = TRUE;
config.has_shared = TRUE;
}
list. */
static void
-gld${EMULATION_NAME}_set_symbols ()
+gld${EMULATION_NAME}_set_symbols (void)
{
EOF
if [ "x${host}" = "x${target}" ] ; then
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);
}
/* 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;
/* 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;
}
/* 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')
/* 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;
/* We only need to worry about this when doing a final link. */
- if (link_info.relocateable || link_info.shared)
+ if (link_info.relocatable || link_info.shared)
return;
/* Get the list of files which appear in ld_need entries in dynamic
/* 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;
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;
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;
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;
/* The SunOS native linker creates a shared library whenever there
are any undefined symbols in a link, unless -e is used. This is
pretty weird, but we are compatible. */
- if (! link_info.shared && ! link_info.relocateable && ! entry_from_cmdline)
+ if (! link_info.shared && ! link_info.relocatable && ! entry_from_cmdline)
{
struct bfd_link_hash_entry *h;
- for (h = link_info.hash->undefs; h != NULL; h = h->next)
+ for (h = link_info.hash->undefs; h != NULL; h = h->u.undef.next)
{
if (h->type == bfd_link_hash_undefined
&& h->u.undef.abfd != NULL
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);
one. We need to create the symbol before calling
size_dynamic_sections, although we can't set the value until
afterward. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", TRUE, FALSE,
FALSE);
dynamic object. */
ASSERT (need_entries != 0);
- sneed->_raw_size = need_size;
+ sneed->size = need_size;
sneed->contents = (bfd_byte *) xmalloc (need_size);
need_contents = sneed->contents;
option. */
if (command_line.rpath)
{
- srules->_raw_size = strlen (command_line.rpath);
+ srules->size = strlen (command_line.rpath);
srules->contents = (bfd_byte *) command_line.rpath;
}
else
for (search = search_head; search != NULL; search = search->next)
if (search->cmdline)
size += strlen (search->name) + 1;
- srules->_raw_size = size;
+ srules->size = size;
if (size > 0)
{
char *p;
/* We must assign a value to __DYNAMIC. It should be zero if we are
not doing a dynamic link, or the start of the .dynamic section if
we are doing one. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
hdyn->type = bfd_link_hash_defined;
hdyn->u.def.value = 0;
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))
/* 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)
{
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)
/* 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)
}
static char *
-gld${EMULATION_NAME}_get_script(isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";