/* ldctor.c -- constructor support routines
- Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>
-
+
This file is part of GLD, the Gnu Linker.
GLD is free software; you can redistribute it and/or modify
{
if (p->reloc != reloc)
{
- einfo (_("%P%X: Different relocs used in set %s\n"), h->root.string);
+ einfo (_("%P%X: Different relocs used in set %s\n"),
+ h->root.string);
return;
}
while (*name == '_')
++name;
- if (strncmp (name, "GLOBAL_", sizeof "GLOBAL_" - 1) != 0)
+ if (strncmp (name, "GLOBAL_", sizeof "GLOBAL_" - 1) != 0)
return -1;
name += sizeof "GLOBAL_" - 1;
const char *n2;
int prio1;
int prio2;
- int ret;
n1 = (*pe1)->name;
if (n1 == NULL)
/* If this is not a relocateable link, all we need is the
size, which we can get from the input BFD. */
- howto = bfd_reloc_type_lookup (p->elements->section->owner,
- p->reloc);
+ if (p->elements->section->owner != NULL)
+ howto = bfd_reloc_type_lookup (p->elements->section->owner,
+ p->reloc);
if (howto == NULL)
{
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
minfo ("%G\n", e->section->owner, e->section, e->value);
}
+ /* Need SEC_KEEP for --gc-sections. */
+ if (! bfd_is_abs_section (e->section))
+ e->section->flags |= SEC_KEEP;
+
if (link_info.relocateable)
lang_add_reloc (p->reloc, howto, e->section, e->name,
exp_intop (e->value));