* bfd.c (struct bfd): Rename "next" to "archive_next".
* archive.c: Rename uses throughout file.
* archive64.c: Likewise.
* coff-rs6000.c: Likewise.
* ecoff.c: Likewise.
* som.c: Likewise.
* bfd-in2.h: Regenerate.
binutils/
* ar.c: Rename uses of bfd.next to bfd.archive_next throughout.
* arsup.c: Likewise.
* binemul.c: Likewise.
* objcopy.c: Likewise.
* dlltool.c: Likewise.
ld/
* pe-dll.c: Rename uses of bfd.next to bfd.archive_next throughout.
2007-06-27 Alan Modra <amodra@bigpond.net.au>
+ * bfd.c (struct bfd): Rename "next" to "archive_next".
+ * archive.c: Rename uses throughout file.
+ * archive64.c: Likewise.
+ * coff-rs6000.c: Likewise.
+ * ecoff.c: Likewise.
+ * som.c: Likewise.
+ * bfd-in2.h: Regenerate.
+
* elf32-ppc.c (ppc_elf_select_plt_layout): Properly iterate over
input bfds.
* elf32-spu.c (spu_elf_create_sections): Likewise.
*tablen = 0;
/* Figure out how long the table should be. */
- for (current = abfd->archive_head; current != NULL; current = current->next)
+ for (current = abfd->archive_head;
+ current != NULL;
+ current = current->archive_next)
{
const char *normal;
unsigned int thislen;
*tablen = total_namelen;
strptr = *tabloc;
- for (current = abfd->archive_head; current != NULL; current =
- current->next)
+ for (current = abfd->archive_head;
+ current != NULL;
+ current = current->archive_next)
{
const char *normal;
unsigned int thislen;
/* Verify the viability of all entries; if any of them live in the
filesystem (as opposed to living in an archive open for input)
then construct a fresh ar_hdr for them. */
- for (current = arch->archive_head; current; current = current->next)
+ for (current = arch->archive_head;
+ current != NULL;
+ current = current->archive_next)
{
/* This check is checking the bfds for the objects we're reading
from (which are usually either an object file or archive on
}
}
- for (current = arch->archive_head; current; current = current->next)
+ for (current = arch->archive_head;
+ current != NULL;
+ current = current->archive_next)
{
char buffer[DEFAULT_BUFFERSIZE];
unsigned int remaining = arelt_size (current);
/* Drop all the files called __.SYMDEF, we're going to make our own. */
while (arch->archive_head &&
strcmp (arch->archive_head->filename, "__.SYMDEF") == 0)
- arch->archive_head = arch->archive_head->next;
+ arch->archive_head = arch->archive_head->archive_next;
/* Map over each element. */
for (current = arch->archive_head;
current != NULL;
- current = current->next, elt_no++)
+ current = current->archive_next, elt_no++)
{
if (bfd_check_format (current, bfd_object)
&& (bfd_get_file_flags (current) & HAS_SYMS) != 0)
{
firstreal += arelt_size (current) + sizeof (struct ar_hdr);
firstreal += firstreal % 2;
- current = current->next;
+ current = current->archive_next;
}
while (current != map[count].u.abfd);
}
archive_member_file_ptr += arelt_size (current) + sizeof (struct ar_hdr);
/* Remember aboout the even alignment. */
archive_member_file_ptr += archive_member_file_ptr % 2;
- current = current->next;
+ current = current->archive_next;
}
/* Now write the strings themselves. */
+ sizeof (struct ar_hdr));
/* remember about the even alignment */
archive_member_file_ptr += archive_member_file_ptr % 2;
- current = current->next;
+ current = current->archive_next;
}
/* now write the strings themselves */
/* Stuff only useful for archives. */
void *arelt_data;
struct bfd *my_archive; /* The containing archive BFD. */
- struct bfd *next; /* The next BFD in the archive. */
+ struct bfd *archive_next; /* The next BFD in the archive. */
struct bfd *archive_head; /* The first BFD in the archive. */
bfd_boolean has_armap;
. {* Stuff only useful for archives. *}
. void *arelt_data;
. struct bfd *my_archive; {* The containing archive BFD. *}
-. struct bfd *next; {* The next BFD in the archive. *}
+. struct bfd *archive_next; {* The next BFD in the archive. *}
. struct bfd *archive_head; {* The first BFD in the archive. *}
. bfd_boolean has_armap;
.
+ SXCOFFARFMAG
+ arelt_size (sub));
fileoff = (fileoff + 1) &~ 1;
- sub = sub->next;
+ sub = sub->archive_next;
}
for (i = 0; i < orl_count; i++)
}
i++;
}
- current_bfd = current_bfd->next;
+ current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
+ SXCOFFARFMAG
+ arelt_size (current_bfd));
fileoff += fileoff & 1;
- current_bfd = current_bfd->next;
+ current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
}
i++;
}
- current_bfd = current_bfd->next;
+ current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
+ SXCOFFARFMAG
+ arelt_size (current_bfd));
fileoff += fileoff & 1;
- current_bfd = current_bfd->next;
+ current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
}
i++;
}
- current_bfd = current_bfd->next;
+ current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
count = 0;
total_namlen = 0;
- for (sub = abfd->archive_head; sub != NULL; sub = sub->next)
+ for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next)
{
++count;
total_namlen += strlen (normalize_filename (sub)) + 1;
hasobjects = FALSE;
prevoff = 0;
nextoff = SIZEOF_AR_FILE_HDR;
- for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++)
+ for (sub = abfd->archive_head, i = 0;
+ sub != NULL;
+ sub = sub->archive_next, i++)
{
const char *name;
bfd_size_type namlen;
abfd) != XCOFFARMAG_ELEMENT_SIZE)
return FALSE;
}
- for (sub = abfd->archive_head; sub != NULL; sub = sub->next)
+ for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next)
{
const char *name;
bfd_size_type namlen;
hasobjects = FALSE;
for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0;
current_bfd != NULL;
- current_bfd = current_bfd->next, count++)
+ current_bfd = current_bfd->archive_next, count++)
{
total_namlen += strlen (normalize_filename (current_bfd)) + 1;
nextoff = SIZEOF_AR_FILE_HDR_BIG;
for (current_bfd = abfd->archive_head, i = 0;
current_bfd != NULL;
- current_bfd = current_bfd->next, i++)
+ current_bfd = current_bfd->archive_next, i++)
{
const char *name;
bfd_size_type namlen;
offsets = NULL;
}
- for (current_bfd = abfd->archive_head; current_bfd != NULL;
- current_bfd = current_bfd->next)
+ for (current_bfd = abfd->archive_head;
+ current_bfd != NULL;
+ current_bfd = current_bfd->archive_next)
{
const char *name;
size_t namlen;
{
firstreal += arelt_size (current) + sizeof (struct ar_hdr);
firstreal += firstreal % 2;
- current = current->next;
+ current = current->archive_next;
}
while (current != map[i].u.abfd);
}
if (curr_bfd->format != bfd_object
|| curr_bfd->xvec->flavour != bfd_target_som_flavour)
{
- curr_bfd = curr_bfd->next;
+ curr_bfd = curr_bfd->archive_next;
continue;
}
(*stringsize)++;
}
- curr_bfd = curr_bfd->next;
+ curr_bfd = curr_bfd->archive_next;
}
return TRUE;
}
if (curr_bfd->format != bfd_object
|| curr_bfd->xvec->flavour != bfd_target_som_flavour)
{
- curr_bfd = curr_bfd->next;
+ curr_bfd = curr_bfd->archive_next;
continue;
}
linker requires objects begin on an even boundary. So round
up the current offset as necessary. */
curr_som_offset = (curr_som_offset + 0x1) &~ (unsigned) 1;
- curr_bfd = curr_bfd->next;
+ curr_bfd = curr_bfd->archive_next;
som_index++;
}
if (curr_bfd->format == bfd_object
&& curr_bfd->xvec->flavour == bfd_target_som_flavour)
lst.module_count++;
- curr_bfd = curr_bfd->next;
+ curr_bfd = curr_bfd->archive_next;
}
lst.module_limit = lst.module_count;
lst.dir_loc = lst_size;
+2007-06-27 Alan Modra <amodra@bigpond.net.au>
+
+ * ar.c: Rename uses of bfd.next to bfd.archive_next throughout.
+ * arsup.c: Likewise.
+ * binemul.c: Likewise.
+ * objcopy.c: Likewise.
+ * dlltool.c: Likewise.
+
2007-06-26 Shantonu Sen <ssen@apple.com>
PR binutils/4693
if (count == 0)
{
- for (head = arch->next; head; head = head->next)
+ for (head = arch->archive_next; head; head = head->archive_next)
{
PROGRESS (1);
function (head);
bfd_boolean found = FALSE;
match_count = 0;
- for (head = arch->next; head; head = head->next)
+ for (head = arch->archive_next; head; head = head->archive_next)
{
PROGRESS (1);
if (head->filename == NULL)
xexit (1);
}
- last_one = &(arch->next);
+ last_one = &(arch->archive_next);
/* Read all the contents right away, regardless. */
for (next_one = bfd_openr_next_archived_file (arch, NULL);
next_one;
{
PROGRESS (1);
*last_one = next_one;
- last_one = &next_one->next;
+ last_one = &next_one->archive_next;
}
*last_one = (bfd *) NULL;
if (bfd_get_error () != bfd_error_no_more_archived_files)
{
bfd *obfd;
char *old_name, *new_name;
- bfd *contents_head = iarch->next;
+ bfd *contents_head = iarch->archive_next;
old_name = xmalloc (strlen (bfd_get_filename (iarch)) + 1);
strcpy (old_name, bfd_get_filename (iarch));
if (realpos == pos_end)
{
while (*after_bfd)
- after_bfd = &((*after_bfd)->next);
+ after_bfd = &((*after_bfd)->archive_next);
}
else
{
- for (; *after_bfd; after_bfd = &(*after_bfd)->next)
+ for (; *after_bfd; after_bfd = &(*after_bfd)->archive_next)
if (FILENAME_CMP ((*after_bfd)->filename, realposname) == 0)
{
if (realpos == pos_after)
- after_bfd = &(*after_bfd)->next;
+ after_bfd = &(*after_bfd)->archive_next;
break;
}
}
found = FALSE;
match_count = 0;
- current_ptr_ptr = &(arch->next);
+ current_ptr_ptr = &(arch->archive_next);
while (*current_ptr_ptr)
{
if (FILENAME_CMP (normalize (*files_to_delete, arch),
if (verbose)
printf ("d - %s\n",
*files_to_delete);
- *current_ptr_ptr = ((*current_ptr_ptr)->next);
+ *current_ptr_ptr = ((*current_ptr_ptr)->archive_next);
goto next_file;
}
}
- current_ptr_ptr = &((*current_ptr_ptr)->next);
+ current_ptr_ptr = &((*current_ptr_ptr)->archive_next);
}
if (verbose && !found)
for (; *files_to_move; ++files_to_move)
{
- current_ptr_ptr = &(arch->next);
+ current_ptr_ptr = &(arch->archive_next);
while (*current_ptr_ptr)
{
bfd *current_ptr = *current_ptr_ptr;
/* Move this file to the end of the list - first cut from
where it is. */
bfd *link;
- *current_ptr_ptr = current_ptr->next;
+ *current_ptr_ptr = current_ptr->archive_next;
/* Now glue to end */
- after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
+ after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL);
link = *after_bfd;
*after_bfd = current_ptr;
- current_ptr->next = link;
+ current_ptr->archive_next = link;
if (verbose)
printf ("m - %s\n", *files_to_move);
goto next_file;
}
- current_ptr_ptr = &((*current_ptr_ptr)->next);
+ current_ptr_ptr = &((*current_ptr_ptr)->archive_next);
}
/* xgettext:c-format */
fatal (_("no entry %s in archive %s!"), *files_to_move, arch->filename);
{
if (! quick)
{
- current_ptr = &arch->next;
+ current_ptr = &arch->archive_next;
while (*current_ptr)
{
current = *current_ptr;
goto next_file;
}
- after_bfd = get_pos_bfd (&arch->next, pos_after,
+ after_bfd = get_pos_bfd (&arch->archive_next, pos_after,
current->filename);
if (ar_emul_replace (after_bfd, *files_to_move,
verbose))
{
/* Snip out this entry from the chain. */
- *current_ptr = (*current_ptr)->next;
+ *current_ptr = (*current_ptr)->archive_next;
changed = TRUE;
}
goto next_file;
}
- current_ptr = &(current->next);
+ current_ptr = &(current->archive_next);
}
}
/* Add to the end of the archive. */
- after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
+ after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL);
if (ar_emul_append (after_bfd, *files_to_move, verbose))
changed = TRUE;
{
bfd *next;
- head = arch->next;
+ head = arch->archive_next;
while (head != NULL)
{
- next = head->next;
+ next = head->archive_next;
function (head, (bfd *) NULL);
head = next;
}
bfd_boolean found = FALSE;
bfd *prev = arch;
- for (head = arch->next; head; head = head->next)
+ for (head = arch->archive_next; head; head = head->archive_next)
{
if (head->filename != NULL
&& FILENAME_CMP (ptr->name, head->filename) == 0)
while (element)
{
*ptr = element;
- ptr = &element->next;
+ ptr = &element->archive_next;
element = bfd_openr_next_archived_file (ibfd, element);
}
}
{
/* Add this module to the output bfd. */
if (prev != NULL)
- prev->next = abfd->next;
+ prev->archive_next = abfd->archive_next;
- abfd->next = obfd->archive_head;
+ abfd->archive_next = obfd->archive_head;
obfd->archive_head = abfd;
}
}
else
{
- abfd->next = obfd->archive_head;
+ abfd->archive_next = obfd->archive_head;
obfd->archive_head = abfd;
}
list = list->next;
{
if (FILENAME_CMP(member->filename, list->name) == 0)
{
- *prev = member->next;
+ *prev = member->archive_next;
found = 1;
}
else
- prev = &(member->next);
+ prev = &(member->archive_next);
- member = member->next;
+ member = member->archive_next;
}
if (!found)
else
{
*prev = abfd;
- abfd->next = member->next;
+ abfd->archive_next = member->archive_next;
found = 1;
}
}
else
{
- prev = &(member->next);
+ prev = &(member->archive_next);
}
- member = member->next;
+ member = member->archive_next;
}
if (!found)
for (abfd = obfd->archive_head;
abfd != (bfd *)NULL;
- abfd = abfd->next)
+ abfd = abfd->archive_next)
ar_directory_doer (abfd, (bfd *) NULL);
}
}
found = 1;
}
- member = member->next;
+ member = member->archive_next;
}
if (!found)
AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name);
- (*after_bfd)->next = temp;
+ (*after_bfd)->archive_next = temp;
return TRUE;
}
AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name);
- (*after_bfd)->next = temp;
+ (*after_bfd)->archive_next = temp;
return TRUE;
}
if (exp->private)
continue;
n = make_one_lib_file (exp, i);
- n->next = head;
+ n->archive_next = head;
head = n;
if (ext_prefix_alias)
{
alias_exp.forward = exp->forward;
alias_exp.next = exp->next;
n = make_one_lib_file (&alias_exp, i + PREFIX_ALIAS_BASE);
- n->next = head;
+ n->archive_next = head;
head = n;
}
}
/* Now stick them all into the archive. */
- ar_head->next = head;
- ar_tail->next = ar_head;
+ ar_head->archive_next = head;
+ ar_tail->archive_next = ar_head;
head = ar_tail;
if (! bfd_set_archive_head (outarch, head))
while (head != NULL)
{
- bfd *n = head->next;
+ bfd *n = head->archive_next;
bfd_close (head);
head = n;
}
l->obfd = output_bfd;
*ptr = output_bfd;
- ptr = &output_bfd->next;
+ ptr = &output_bfd->archive_next;
last_element = this_element;
+2007-06-27 Alan Modra <amodra@bigpond.net.au>
+
+ * pe-dll.c: Rename uses of bfd.next to bfd.archive_next throughout.
+
2007-06-20 Alan Modra <amodra@bigpond.net.au>
* emulparams/elf32_spu.sh (OTHER_SECTIONS): KEEP .note.spu_name.
def->exports[i].internal_name = def->exports[i].name;
n = make_one (def->exports + i, outarch,
! (def->exports + i)->flag_data);
- n->next = head;
+ n->archive_next = head;
head = n;
def->exports[i].internal_name = internal;
}
return;
/* Now stick them all into the archive. */
- ar_head->next = head;
- ar_tail->next = ar_head;
+ ar_head->archive_next = head;
+ ar_tail->archive_next = ar_head;
head = ar_tail;
if (! bfd_set_archive_head (outarch, head))
while (head != NULL)
{
- bfd *n = head->next;
+ bfd *n = head->archive_next;
bfd_close (head);
head = n;
}