aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-03-05 22:43:40 +0000
committerAlan Modra <amodra@gmail.com>2012-03-05 22:43:40 +0000
commit66be105571d3494a28c0062f8bc663822121d838 (patch)
tree34de3a757605fafdb8ebeb907f4af86ceeb29490 /ld/emultempl
parentd8df103b509c3750e9702b17b8af193cb93437c7 (diff)
downloadgdb-66be105571d3494a28c0062f8bc663822121d838.zip
gdb-66be105571d3494a28c0062f8bc663822121d838.tar.gz
gdb-66be105571d3494a28c0062f8bc663822121d838.tar.bz2
* ldlang.h (struct lang_input_statement_flags): New, extract from..
(lang_input_statement_type): ..here. New field "flags". (input_flags): Declare. (missing_file): Delete. * ldmain.h (whole_archive): Delete. (add_DT_NEEDED_for_regular, add_DT_NEEDED_for_dynamic): Delete. * ld.h (ld_config_type <dynamic_link>): Delete. * ldmain.c (whole_archive): Delete. (add_DT_NEEDED_for_regular, add_DT_NEEDED_for_dynamic): Delete. * ldlang.c (missing_file, ldlang_sysrooted_script): Delete. (input_flags): New variable. Replace all uses of config.dynamic_link, missing_file, ldlang_sysrooted_script, whole_archive, add_DT_NEEDED_for_regular and add_DT_NEEDED_for_dynamic with fields from here. * ldfile.c: Likewise. * ldgram.y: Likewise. * ldmain.c: Likewise. * ldwrite.c: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/vms.em: Likewise. * ldlang.c (new_afile): Use memset to init zero fields. (load_symbols): Simplify save and restore of flags around command file processing. * ldfile.c (is_sysrooted_pathname): Tidy.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/aix.em8
-rw-r--r--ld/emultempl/armelf.em6
-rw-r--r--ld/emultempl/elf32.em18
-rw-r--r--ld/emultempl/hppaelf.em4
-rw-r--r--ld/emultempl/linux.em6
-rw-r--r--ld/emultempl/pe.em7
-rw-r--r--ld/emultempl/pep.em6
-rw-r--r--ld/emultempl/ppc64elf.em4
-rw-r--r--ld/emultempl/scoreelf.em4
-rw-r--r--ld/emultempl/spuelf.em4
-rw-r--r--ld/emultempl/sunos.em17
-rw-r--r--ld/emultempl/vms.em6
12 files changed, 46 insertions, 44 deletions
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index f4660ec..3f6a097 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -10,7 +10,7 @@ fragment <<EOF
/* AIX emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com>
@@ -145,7 +145,7 @@ gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- config.dynamic_link = TRUE;
+ input_flags.dynamic = TRUE;
config.has_shared = TRUE;
/* The link_info.[init|fini]_functions are initialized in ld/lexsup.c.
@@ -669,7 +669,7 @@ gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry)
*flpp = n;
ret = TRUE;
- entry->loaded = TRUE;
+ entry->flags.loaded = TRUE;
}
fclose (e);
@@ -1505,7 +1505,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch,
{
char *path;
- if (!entry->maybe_archive)
+ if (!entry->flags.maybe_archive)
return FALSE;
path = concat (search->name, "/lib", entry->filename, arch, ".a", NULL);
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index 21d4f59..03ee98b 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -1,6 +1,6 @@
# This shell script emits a C file. -*- C -*-
# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+# 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
@@ -50,7 +50,7 @@ gld${EMULATION_NAME}_before_parse (void)
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
- config.dynamic_link = ${DYNAMIC_LINK-TRUE};
+ input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
@@ -240,7 +240,7 @@ build_section_lists (lang_statement_union_type *statement)
{
asection *i = statement->input_section.section;
- if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ if (!((lang_input_statement_type *) i->owner->usrdata)->flags.just_syms
&& (i->flags & SEC_EXCLUDE) == 0
&& i->output_section != NULL
&& i->output_section->owner == link_info.output_bfd)
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 78a708b..7d31864 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -13,7 +13,7 @@ fragment <<EOF
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@@ -102,7 +102,7 @@ static void
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- config.dynamic_link = ${DYNAMIC_LINK-TRUE};
+ input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
@@ -121,16 +121,16 @@ gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *entry)
/* Tell the ELF linker that we don't want the output file to have a
DT_NEEDED entry for this file, unless it is used to resolve
references in a regular object. */
- if (entry->add_DT_NEEDED_for_regular)
+ if (entry->flags.add_DT_NEEDED_for_regular)
link_class = DYN_AS_NEEDED;
/* Tell the ELF linker that we don't want the output file to have a
DT_NEEDED entry for any dynamic library in DT_NEEDED tags from
this file at all. */
- if (!entry->add_DT_NEEDED_for_dynamic)
+ if (!entry->flags.add_DT_NEEDED_for_dynamic)
link_class |= DYN_NO_ADD_NEEDED;
- if (entry->just_syms_flag
+ if (entry->flags.just_syms
&& (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) != 0)
einfo (_("%P%F: --just-symbols may not be used on DSO: %B\n"),
entry->the_bfd);
@@ -862,7 +862,7 @@ gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
return;
}
- if (s->search_dirs_flag)
+ if (s->flags.search_dirs)
{
const char *f = strrchr (s->filename, '/');
if (f != NULL
@@ -1560,7 +1560,7 @@ ${ELF_INTERPRETER_SET_DEFAULT}
char *msg;
bfd_boolean ret;
- if (is->just_syms_flag)
+ if (is->flags.just_syms)
continue;
s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning");
@@ -1621,7 +1621,7 @@ gld${EMULATION_NAME}_open_dynamic_archive
const char *filename;
char *string;
- if (! entry->maybe_archive)
+ if (! entry->flags.maybe_archive)
return FALSE;
filename = entry->filename;
@@ -1675,7 +1675,7 @@ gld${EMULATION_NAME}_open_dynamic_archive
if (bfd_check_format (entry->the_bfd, bfd_object)
&& (entry->the_bfd->flags & DYNAMIC) != 0)
{
- ASSERT (entry->maybe_archive && entry->search_dirs_flag);
+ ASSERT (entry->flags.maybe_archive && entry->flags.search_dirs);
/* Rather than duplicating the logic above. Just use the
filename we recorded earlier. */
diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em
index 1137ba2..ec81624 100644
--- a/ld/emultempl/hppaelf.em
+++ b/ld/emultempl/hppaelf.em
@@ -1,6 +1,6 @@
# This shell script emits a C file. -*- C -*-
# Copyright 1991, 1993, 1994, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
@@ -229,7 +229,7 @@ build_section_lists (lang_statement_union_type *statement)
{
asection *i = statement->input_section.section;
- if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ if (!((lang_input_statement_type *) i->owner->usrdata)->flags.just_syms
&& (i->flags & SEC_EXCLUDE) == 0
&& i->output_section != NULL
&& i->output_section->owner == link_info.output_bfd)
diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em
index db62830..61c7df4 100644
--- a/ld/emultempl/linux.em
+++ b/ld/emultempl/linux.em
@@ -10,7 +10,7 @@ fragment <<EOF
/* Linux a.out emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com>
@@ -49,7 +49,7 @@ static void
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- config.dynamic_link = TRUE;
+ input_flags.dynamic = TRUE;
config.has_shared = TRUE;
}
@@ -62,7 +62,7 @@ gld${EMULATION_NAME}_open_dynamic_archive
{
char *string;
- if (! entry->maybe_archive)
+ if (! entry->flags.maybe_archive)
return FALSE;
string = (char *) xmalloc (strlen (search->name)
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 5737fc0..fe188f7 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -9,7 +9,8 @@ rm -f e${EMULATION_NAME}.c
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
fragment <<EOF
/* Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Free Software Foundation, Inc.
This file is part of the GNU Binutils.
@@ -164,7 +165,7 @@ gld_${EMULATION_NAME}_before_parse (void)
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "${EXECUTABLE_NAME:-a.exe}";
#ifdef DLL_SUPPORT
- config.dynamic_link = TRUE;
+ input_flags.dynamic = TRUE;
config.has_shared = 1;
EOF
@@ -2093,7 +2094,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive
unsigned int i;
- if (! entry->maybe_archive)
+ if (! entry->flags.maybe_archive)
return FALSE;
filename = entry->filename;
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index e02ddcf..a24c30a 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -8,7 +8,7 @@ fi
rm -f e${EMULATION_NAME}.c
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
fragment <<EOF
-/* Copyright 2006, 2007, 2008, 2009, 2010, 2011
+/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Kai Tietz, OneVision Software GmbH&CoKg.
@@ -139,7 +139,7 @@ gld_${EMULATION_NAME}_before_parse (void)
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "${EXECUTABLE_NAME:-a.exe}";
#ifdef DLL_SUPPORT
- config.dynamic_link = TRUE;
+ input_flags.dynamic = TRUE;
config.has_shared = 1;
link_info.pei386_auto_import = 1;
link_info.pei386_runtime_pseudo_reloc = 2; /* Use by default version 2. */
@@ -1830,7 +1830,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive
unsigned int i;
- if (! entry->maybe_archive)
+ if (! entry->flags.maybe_archive)
return FALSE;
filename = entry->filename;
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index 5b637e1..668b468 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -435,7 +435,7 @@ build_toc_list (lang_statement_union_type *statement)
{
asection *i = statement->input_section.section;
- if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ if (!((lang_input_statement_type *) i->owner->usrdata)->flags.just_syms
&& (i->flags & SEC_EXCLUDE) == 0
&& i->output_section == toc_section)
{
@@ -453,7 +453,7 @@ build_section_lists (lang_statement_union_type *statement)
{
asection *i = statement->input_section.section;
- if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ if (!((lang_input_statement_type *) i->owner->usrdata)->flags.just_syms
&& (i->flags & SEC_EXCLUDE) == 0
&& i->output_section != NULL
&& i->output_section->owner == link_info.output_bfd)
diff --git a/ld/emultempl/scoreelf.em b/ld/emultempl/scoreelf.em
index 897147e..94aa5af 100644
--- a/ld/emultempl/scoreelf.em
+++ b/ld/emultempl/scoreelf.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
# Contributed by:
# Brain.lin (brain.lin@sunplusct.com)
# Mei Ligang (ligang@sunnorth.com.cn)
@@ -36,7 +36,7 @@ gld${EMULATION_NAME}_before_parse ()
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
- config.dynamic_link = ${DYNAMIC_LINK-TRUE};
+ input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
index 714d33d..d3e3c70 100644
--- a/ld/emultempl/spuelf.em
+++ b/ld/emultempl/spuelf.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2006, 2007, 2008, 2009, 2010, 2011
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
@@ -579,7 +579,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
/* Ensure bfd sections are excluded from the output. */
bfd_section_list_clear (entry->the_bfd);
- entry->loaded = TRUE;
+ entry->flags.loaded = TRUE;
return TRUE;
}
diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em
index 567b8e2..d7cd3e8 100644
--- a/ld/emultempl/sunos.em
+++ b/ld/emultempl/sunos.em
@@ -10,7 +10,8 @@ fragment <<EOF
/* SunOS emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012
+ Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
@@ -85,7 +86,7 @@ static void
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- config.dynamic_link = TRUE;
+ input_flags.dynamic = TRUE;
config.has_shared = TRUE;
}
@@ -156,9 +157,9 @@ gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp)
char *alc;
struct stat st;
- if (! inp->search_dirs_flag
- || ! inp->maybe_archive
- || ! inp->dynamic)
+ if (! inp->flags.search_dirs
+ || ! inp->flags.maybe_archive
+ || ! inp->flags.dynamic)
return;
ASSERT (CONST_STRNEQ (inp->local_sym_name, "-l"));
@@ -188,7 +189,7 @@ gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp)
/* Turn off the search_dirs_flag to prevent ldfile_open_file from
searching for this file again. */
- inp->search_dirs_flag = FALSE;
+ inp->flags.search_dirs = FALSE;
free (found);
@@ -891,7 +892,7 @@ gld${EMULATION_NAME}_count_need (lang_input_statement_type *inp)
{
++need_entries;
need_size += NEED_ENTRY_SIZE;
- if (! inp->maybe_archive)
+ if (! inp->flags.maybe_archive)
need_size += strlen (inp->filename) + 1;
else
{
@@ -919,7 +920,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
referential locality. */
bfd_put_32 (link_info.output_bfd, need_pnames - need_contents,
need_pinfo);
- if (! inp->maybe_archive)
+ if (! inp->flags.maybe_archive)
{
bfd_put_32 (link_info.output_bfd, (bfd_vma) 0, need_pinfo + 4);
bfd_put_16 (link_info.output_bfd, (bfd_vma) 0, need_pinfo + 8);
diff --git a/ld/emultempl/vms.em b/ld/emultempl/vms.em
index 6107c56..164f2e1 100644
--- a/ld/emultempl/vms.em
+++ b/ld/emultempl/vms.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2010
+# Copyright 2010, 2012
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
@@ -29,7 +29,7 @@ static void
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- config.dynamic_link = TRUE;
+ input_flags.dynamic = TRUE;
config.has_shared = FALSE; /* Not yet. */
}
@@ -54,7 +54,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED,
{
char *string;
- if (! entry->maybe_archive)
+ if (! entry->flags.maybe_archive)
return FALSE;
string = (char *) xmalloc (strlen (search->name)