/* POWER/PowerPC XCOFF linker support.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
- Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
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. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
ret = bfd_malloc (amt);
if (ret == NULL)
return NULL;
- if (! _bfd_link_hash_table_init (&ret->root, abfd, xcoff_link_hash_newfunc))
+ if (!_bfd_link_hash_table_init (&ret->root, abfd, xcoff_link_hash_newfunc,
+ sizeof (struct xcoff_link_hash_entry)))
{
free (ret);
return NULL;
{
o->reloc_count = 0;
o->lineno_count = 0;
- for (p = o->link_order_head; p != NULL; p = p->next)
+ for (p = o->map_head.link_order; p != NULL; p = p->next)
{
if (p->type == bfd_indirect_link_order)
{
{
bfd_boolean saw_contents;
int indx;
- asection **op;
file_ptr sofar;
/* Insert .pad sections before every section which has
contents and is loaded, if it is preceded by some other
section which has contents and is loaded. */
saw_contents = TRUE;
- for (op = &abfd->sections; *op != NULL; op = &(*op)->next)
+ for (o = abfd->sections; o != NULL; o = o->next)
{
- if (strcmp ((*op)->name, ".pad") == 0)
+ if (strcmp (o->name, ".pad") == 0)
saw_contents = FALSE;
- else if (((*op)->flags & SEC_HAS_CONTENTS) != 0
- && ((*op)->flags & SEC_LOAD) != 0)
+ else if ((o->flags & SEC_HAS_CONTENTS) != 0
+ && (o->flags & SEC_LOAD) != 0)
{
if (! saw_contents)
saw_contents = TRUE;
else
{
- asection *n, **st;
+ asection *n;
/* Create a pad section and place it before the section
that needs padding. This requires unlinking and
relinking the bfd's section list. */
- st = abfd->section_tail;
n = bfd_make_section_anyway (abfd, ".pad");
n->flags = SEC_HAS_CONTENTS;
n->alignment_power = 0;
- BFD_ASSERT (*st == n);
- bfd_section_list_remove (abfd, st);
- bfd_section_list_insert (abfd, op, n);
-
- op = &n->next;
+ bfd_section_list_remove (abfd, n);
+ bfd_section_list_insert_before (abfd, o, n);
saw_contents = FALSE;
}
}
for a single input file at once. */
for (o = abfd->sections; o != NULL; o = o->next)
{
- for (p = o->link_order_head; p != NULL; p = p->next)
+ for (p = o->map_head.link_order; p != NULL; p = p->next)
{
if (p->type == bfd_indirect_link_order
&& p->u.indirect.section->owner->xvec == abfd->xvec)