projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add vmfunc
[deliverable/binutils-gdb.git]
/
ld
/
ldctor.c
diff --git
a/ld/ldctor.c
b/ld/ldctor.c
index 34d5e5295a7a0b4483752bd14e73b2c3aca96f09..1a86eb38e893412a1cd18097c058fc59254942a6 100644
(file)
--- a/
ld/ldctor.c
+++ b/
ld/ldctor.c
@@
-1,27
+1,28
@@
/* ldctor.c -- constructor support routines
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
/* ldctor.c -- constructor support routines
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>
By Steve Chamberlain <sac@cygnus.com>
-
This file is part of GLD, the Gnu Linker
.
+
This file is part of the GNU Binutils
.
-
GLD
is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+
This program
is free software; you can redistribute it and/or modify
+
it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+
(at your option)
any later version.
-
GLD
is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+
This program
is distributed in the hope that it will be useful,
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-
along with GLD; see the file COPYING. If not, write to the Fre
e
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-
02111-1307
, USA. */
+
You should have received a copy of the GNU General Public License
+
along with this program; if not, write to the Free Softwar
e
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+
MA 02110-1301
, USA. */
-#include "bfd.h"
#include "sysdep.h"
#include "sysdep.h"
+#include "bfd.h"
#include "bfdlink.h"
#include "safe-ctype.h"
#include "bfdlink.h"
#include "safe-ctype.h"
@@
-49,7
+50,7
@@
struct set_info *sets;
RELOC is the relocation to use for an entry in the set. SECTION
and VALUE are the value to add. This is called during the first
phase of the link, when we are still gathering symbols together.
RELOC is the relocation to use for an entry in the set. SECTION
and VALUE are the value to add. This is called during the first
phase of the link, when we are still gathering symbols together.
- We just record the information now. The ldctor_
find_constructor
s
+ We just record the information now. The ldctor_
build_set
s
function will construct the sets. */
void
function will construct the sets. */
void
@@
-69,7
+70,7
@@
ldctor_add_set_entry (struct bfd_link_hash_entry *h,
if (p == NULL)
{
if (p == NULL)
{
- p = xmalloc (sizeof (struct set_info));
+ p =
(struct set_info *)
xmalloc (sizeof (struct set_info));
p->next = sets;
sets = p;
p->h = h;
p->next = sets;
sets = p;
p->h = h;
@@
-105,7
+106,7
@@
ldctor_add_set_entry (struct bfd_link_hash_entry *h,
}
}
}
}
- e = xmalloc (sizeof (struct set_element));
+ e =
(struct set_element *)
xmalloc (sizeof (struct set_element));
e->next = NULL;
e->name = name;
e->section = section;
e->next = NULL;
e->name = name;
e->section = section;
@@
-131,7
+132,7
@@
ctor_prio (const char *name)
while (*name == '_')
++name;
while (*name == '_')
++name;
- if (
strncmp (name, "GLOBAL_", sizeof "GLOBAL_" - 1) != 0
)
+ if (
! CONST_STRNEQ (name, "GLOBAL_")
)
return -1;
name += sizeof "GLOBAL_" - 1;
return -1;
name += sizeof "GLOBAL_" - 1;
@@
-152,8
+153,10
@@
ctor_prio (const char *name)
static int
ctor_cmp (const void *p1, const void *p2)
{
static int
ctor_cmp (const void *p1, const void *p2)
{
- const struct set_element * const *pe1 = p1;
- const struct set_element * const *pe2 = p2;
+ const struct set_element * const *pe1 =
+ (const struct set_element * const *) p1;
+ const struct set_element * const *pe2 =
+ (const struct set_element * const *) p2;
const char *n1;
const char *n2;
int prio1;
const char *n1;
const char *n2;
int prio1;
@@
-198,7
+201,6
@@
void
ldctor_build_sets (void)
{
static bfd_boolean called;
ldctor_build_sets (void)
{
static bfd_boolean called;
- lang_statement_list_type *old;
bfd_boolean header_printed;
struct set_info *p;
bfd_boolean header_printed;
struct set_info *p;
@@
-223,7
+225,7
@@
ldctor_build_sets (void)
for (e = p->elements; e != NULL; e = e->next)
++c;
for (e = p->elements; e != NULL; e = e->next)
++c;
- array = xmalloc (c * sizeof *array);
+ array =
(struct set_element **)
xmalloc (c * sizeof *array);
i = 0;
for (e = p->elements; e != NULL; e = e->next)
i = 0;
for (e = p->elements; e != NULL; e = e->next)
@@
-244,10
+246,8
@@
ldctor_build_sets (void)
}
}
}
}
- old = stat_ptr;
- stat_ptr = &constructor_list;
-
- lang_list_init (stat_ptr);
+ lang_list_init (&constructor_list);
+ push_stat_ptr (&constructor_list);
header_printed = FALSE;
for (p = sets; p != NULL; p = p->next)
header_printed = FALSE;
for (p = sets; p != NULL; p = p->next)
@@
-273,13
+273,13
@@
ldctor_build_sets (void)
except that we use the right size instead of .long. When
generating relocatable output, we generate relocs instead of
addresses. */
except that we use the right size instead of .long. When
generating relocatable output, we generate relocs instead of
addresses. */
- howto = bfd_reloc_type_lookup (output_bfd, p->reloc);
+ howto = bfd_reloc_type_lookup (
link_info.
output_bfd, p->reloc);
if (howto == NULL)
{
if (link_info.relocatable)
{
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
if (howto == NULL)
{
if (link_info.relocatable)
{
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
- bfd_get_target (output_bfd),
+ bfd_get_target (
link_info.
output_bfd),
bfd_get_reloc_code_name (p->reloc),
p->h->root.string);
continue;
bfd_get_reloc_code_name (p->reloc),
p->h->root.string);
continue;
@@
-319,11
+319,11
@@
ldctor_build_sets (void)
break;
}
break;
}
- lang_add_assignment (exp_ass
op ('=',
".",
- exp_unop (ALIGN_K,
- exp_intop (reloc_size))));
- lang_add_assignment (exp_ass
op ('=',
p->h->root.string,
- exp_nameop (NAME, ".")));
+ lang_add_assignment (exp_ass
ign (
".",
+
exp_unop (ALIGN_K,
+
exp_intop (reloc_size))));
+ lang_add_assignment (exp_ass
ign (
p->h->root.string,
+
exp_nameop (NAME, ".")));
lang_add_data (size, exp_intop (p->count));
for (e = p->elements; e != NULL; e = e->next)
lang_add_data (size, exp_intop (p->count));
for (e = p->elements; e != NULL; e = e->next)
@@
-372,5
+372,5
@@
ldctor_build_sets (void)
lang_add_data (size, exp_intop (0));
}
lang_add_data (size, exp_intop (0));
}
-
stat_ptr = old
;
+
pop_stat_ptr ()
;
}
}
This page took
0.027051 seconds
and
4
git commands to generate.