aboutsummaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-01-25 12:03:37 +0000
committerAlan Modra <amodra@gmail.com>2008-01-25 12:03:37 +0000
commit53d25da64b00c1cf7f10d04785d66fa003f8bfc9 (patch)
treeb1bad03e3da788202674fed0b1233f865cbad54d /ld/ldgram.y
parent5ca3b13d654923e893cb2661700bc06e7af32a49 (diff)
downloadgdb-53d25da64b00c1cf7f10d04785d66fa003f8bfc9.zip
gdb-53d25da64b00c1cf7f10d04785d66fa003f8bfc9.tar.gz
gdb-53d25da64b00c1cf7f10d04785d66fa003f8bfc9.tar.bz2
ld/
* ld.texinfo (INSERT): Describe. * ldgram.y (ldgram_in_script, ldgram_had_equals): Delete. (INSERT_K, AFTER, BEFORE): Add as tokens. (ifile_p1): Handle INSERT statements. (saved_script_handle, force_make_executable): Move to.. * ldmain.c: ..here. (previous_script_handle): New global var. * ldmain.h (saved_script_handle, force_make_executable): Declare. (previous_script_handle): Likewise. * ldlex.l (INSERT_K, AFTER, BEFORE): Add tokens. * lexsup.c (parge_args <-T>): Set previous_script_handle. * ldlang.c (lang_for_each_statement_worker): Handle insert statement. (map_input_to_output_sections, print_statement): Likewise. (lang_size_sections_1, lang_do_assignments_1): Likewise. (insert_os_after): New function, extracted from.. (lang_insert_orphan): ..here. (process_insert_statements): New function. (lang_process): Call it. (lang_add_insert): New function. * ldlang.h (lang_insert_statement_enum): New. (lang_insert_statement_type): New. (lang_statement_union_type): Add insert_statement. (lang_add_insert): Declare. ld/testsuite/ * ld-spu/ovl.lnk: Delete overlay. * ld-spu/ovl1.lnk: New file. * ld-spu/ovl2.lnk: New file. * ld-spu/ovl.d: Update. * ld-spu/ovl2.d: Update.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y12
1 files changed, 6 insertions, 6 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 5b68b6b..f481f54 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -49,11 +49,6 @@
static enum section_type sectype;
static lang_memory_region_type *region;
-FILE *saved_script_handle = NULL;
-bfd_boolean force_make_executable = FALSE;
-
-bfd_boolean ldgram_in_script = FALSE;
-bfd_boolean ldgram_had_equals = FALSE;
bfd_boolean ldgram_had_keep = FALSE;
char *ldgram_vers_current_lang = NULL;
@@ -127,7 +122,8 @@ static int error_index;
%token END
%left <token> '('
%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE
-%token SECTIONS PHDRS DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END DATA_SEGMENT_END
+%token SECTIONS PHDRS INSERT_K AFTER BEFORE
+%token DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END DATA_SEGMENT_END
%token SORT_BY_NAME SORT_BY_ALIGNMENT
%token '{' '}'
%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
@@ -352,6 +348,10 @@ ifile_p1:
lang_add_nocrossref ($3);
}
| EXTERN '(' extern_name_list ')'
+ | INSERT_K AFTER NAME
+ { lang_add_insert ($3, 0); }
+ | INSERT_K BEFORE NAME
+ { lang_add_insert ($3, 1); }
;
input_list: