aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-08-10 10:30:19 +0930
committerAlan Modra <amodra@gmail.com>2019-08-10 17:16:16 +0930
commit36983a93bb338b7cdd6f7d6f9f91dc9ce9815b4e (patch)
tree226f938cd59f78af1aa427f65c1e5678bd9ea141 /ld/emultempl
parent8be90e963138c88d7648c1eb2146e45f048d616e (diff)
downloadgdb-36983a93bb338b7cdd6f7d6f9f91dc9ce9815b4e.zip
gdb-36983a93bb338b7cdd6f7d6f9f91dc9ce9815b4e.tar.gz
gdb-36983a93bb338b7cdd6f7d6f9f91dc9ce9815b4e.tar.bz2
lang_input_statement_type next pointers
"next" and "next_real_file" in lang_input_statement_type always point to another lang_input_statement_type, so it makes sense for these to not be the generic lang_statement_union_type. This patch also updates a number of variables in ldlang.c for the same reason, and modifies lang_statement_append to reduce the need for casts. * ldlang.h (lang_input_statement_type): Make next and next_real_file a lang_input_statement_type pointer. (lang_statement_append): Delete prototype. (LANG_FOR_EACH_INPUT_STATEMENT): Update for lang_input_statement_type change. * ldmain.c (add_archive_element): Likewise. * ldlang.c: Likewise throughout. (lang_statement_append): Make static. Make element and field void pointers. Remove casts in calls. (lang_check): Use a lang_input_statement_type pointer for "file". (find_rescan_insertion): Similarly for "iter" and return value. (lang_process): Similarly for "insert", "iter" and "temp". * emultempl/spuelf.em (embedded_spu_file): Likewise. * emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Expand lang_statment_append call.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/aix.em5
-rw-r--r--ld/emultempl/spuelf.em6
2 files changed, 5 insertions, 6 deletions
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index bcf959d..8151a9d 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -945,9 +945,8 @@ gld${EMULATION_NAME}_before_allocation (void)
else
{
is->header.next = NULL;
- lang_statement_append (&os->children,
- (lang_statement_union_type *) is,
- &is->header.next);
+ *os->children.tail = (lang_statement_union_type *) is;
+ os->children.tail = &is->header.next;
}
}
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
index f630975..5ddf41c 100644
--- a/ld/emultempl/spuelf.em
+++ b/ld/emultempl/spuelf.em
@@ -512,9 +512,9 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
return FALSE;
close (fd);
- for (search = (lang_input_statement_type *) input_file_chain.head;
+ for (search = &input_file_chain.head->input_statement;
search != NULL;
- search = (lang_input_statement_type *) search->next_real_file)
+ search = search->next_real_file)
if (search->filename != NULL)
{
const char *infile = base_name (search->filename);
@@ -575,7 +575,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
new_ent->header.next = entry->header.next;
entry->header.next = new_ent;
new_ent->input_statement.next_real_file = entry->next_real_file;
- entry->next_real_file = new_ent;
+ entry->next_real_file = &new_ent->input_statement;
/* Ensure bfd sections are excluded from the output. */
bfd_section_list_clear (entry->the_bfd);