+2019-12-26 Alan Modra <amodra@gmail.com>
+
+ * ldlang.c (lang_output_section_find_by_flags): Don't use &p->field
+ when p might be NULL.
+ * ldelf.c (output_rel_find, ldelf_place_orphan): Likewise.
+ (insert_os_after, lang_insert_orphan, lookup_name): Likewise.
+ (strip_excluded_output_sections, lang_clear_os_map): Likewise.
+ (lang_check, lang_for_each_input_file): Likewise.
+ (lang_reset_memory_regions, find_replacements_insert_point): Likewise.
+ (find_rescan_insertion, lang_propagate_lma_regions): Likewise.
+ (lang_record_phdrs): Likewise.
+ * emultempl/alphaelf.em (alpha_after_open): Likewise.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/ppc32elf.em (ppc_after_check_relocs): Likewise.
+ * emultempl/spuelf.em (spu_before_allocation): Likewise.
+ (embedded_spu_file): Likewise.
+
2019-12-19 Alan Modra <amodra@gmail.com>
* testsuite/lib/ld-lib.exp (uses_genelf): Remove moxie.
lang_output_section_statement_type *plt_os[2];
num_plt = 0;
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
/* We have to find the oss before this one, so we can use that as
"after". */
- for (lookup = &lang_os_list.head->output_section_statement;
+ for (lookup = (void *) lang_os_list.head;
lookup != NULL && lookup->next != before;
lookup = lookup->next)
;
NULL);
if (after == NULL)
/* *ABS* is always the first output section statement. */
- after = &lang_os_list.head->output_section_statement;
+ after = (void *) lang_os_list.head;
}
/* All sections in an executable must be aligned to a page boundary.
NULL);
if (after == NULL)
/* *ABS* is always the first output section statement. */
- after = &lang_os_list.head->output_section_statement;
+ after = (void *) lang_os_list.head;
}
/* All sections in an executable must be aligned to a page boundary.
num_got = 0;
num_plt = 0;
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
}
/* Ensure alignment of overlay sections is sufficient. */
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
if (os->bfd_section != NULL
return FALSE;
close (fd);
- for (search = &input_file_chain.head->input_statement;
+ for (search = (void *) input_file_chain.head;
search != NULL;
search = search->next_real_file)
if (search->filename != NULL)
lang_output_section_statement_type *last_rel = NULL;
lang_output_section_statement_type *last_rel_alloc = NULL;
- for (lookup = &lang_os_list.head->output_section_statement;
+ for (lookup = (void *) lang_os_list.head;
lookup != NULL;
lookup = lookup->next)
{
{
/* Find the output mbind section with the same type, attributes
and sh_info field. */
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
if (os->bfd_section != NULL
_bfd_elf_match_sections_by_type);
if (after == NULL)
/* *ABS* is always the first output section statement. */
- after = &lang_os_list.head->output_section_statement;
+ after = (void *) lang_os_list.head;
}
return lang_insert_orphan (s, secname, constraint, after, place, NULL, NULL);
/* We know the first statement on this list is *ABS*. May as well
skip it. */
- first = &lang_os_list.head->output_section_statement;
+ first = (void *) lang_os_list.head;
first = first->next;
/* First try for an exact match. */
lang_statement_union_type **assign = NULL;
bfd_boolean ignore_first;
- ignore_first = after == &lang_os_list.head->output_section_statement;
+ ignore_first = after == (void *) lang_os_list.head;
for (where = &after->header.next;
*where != NULL;
/* Shuffle the bfd section list to make the output file look
neater. This is really only cosmetic. */
if (place->section == NULL
- && after != &lang_os_list.head->output_section_statement)
+ && after != (void *) lang_os_list.head)
{
asection *bfd_section = after->bfd_section;
{
lang_input_statement_type *search;
- for (search = &input_file_chain.head->input_statement;
+ for (search = (void *) input_file_chain.head;
search != NULL;
search = search->next_real_file)
{
lang_reset_memory_regions ();
}
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
if (map_head_is_link_order)
return;
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
bfd *input_bfd;
const bfd_arch_info_type *compatible;
- for (file = &file_chain.head->input_statement;
+ for (file = (void *) file_chain.head;
file != NULL;
file = file->next)
{
{
lang_input_statement_type *f;
- for (f = &input_file_chain.head->input_statement;
+ for (f = (void *) input_file_chain.head;
f != NULL;
f = f->next_real_file)
if (f->flags.real)
p->last_os = NULL;
}
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
find_replacements_insert_point (bfd_boolean *before)
{
lang_input_statement_type *claim1, *lastobject;
- lastobject = &input_file_chain.head->input_statement;
- for (claim1 = &file_chain.head->input_statement;
+ lastobject = (void *) input_file_chain.head;
+ for (claim1 = (void *) file_chain.head;
claim1 != NULL;
claim1 = claim1->next)
{
file chain if it is full of archive elements. Archives don't
appear on the file chain, but if an element has been extracted
then their input_statement->next points at it. */
- for (f = &input_file_chain.head->input_statement;
+ for (f = (void *) input_file_chain.head;
f != NULL;
f = f->next_real_file)
{
{
lang_output_section_statement_type *os;
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
bfd_vma at;
c = 0;
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{
free (secs);
/* Make sure all the phdr assignments succeeded. */
- for (os = &lang_os_list.head->output_section_statement;
+ for (os = (void *) lang_os_list.head;
os != NULL;
os = os->next)
{