aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-05-19 14:01:14 +0000
committerJakub Jelinek <jakub@redhat.com>2004-05-19 14:01:14 +0000
commit0841712ea90a7633d54bbc1f00fa82e068815b66 (patch)
tree2fa51ae9ff719886f69c1aa790ec08b9b2bb27d6 /ld/emultempl
parentf2c503287936db895a7ab693f3ddf618a46a89a3 (diff)
downloadgdb-0841712ea90a7633d54bbc1f00fa82e068815b66.zip
gdb-0841712ea90a7633d54bbc1f00fa82e068815b66.tar.gz
gdb-0841712ea90a7633d54bbc1f00fa82e068815b66.tar.bz2
* ldgram.y (sect_constraint): New.
(ONLY_IF_RO, ONLY_IF_RW): New tokens. (section): Add sect_constraint. Pass additional argument to lang_enter_output_section_statement. * mri.c (mri_draw_tree): Pass additional argument to lang_enter_output_section_statement. * emultempl/pe.em (place_orphan): Likewise. (output_prev_sec_find): Disregard output section statements with constraint == -1. * emultempl/mmo.em (output_prev_sec_find): Likewise. (mmo_place_orphan): Pass additional argument to lang_enter_output_section_statement. * emultempl/elf32.em (output_prev_sec_find): Disregard output section statements with constraint == -1. (place_orphan): Pass additional argument to lang_enter_output_section_statement. * ldlang.c (lang_enter_overlay_section): Likewise. (lang_output_section_find_1): New. (lang_output_section_find): Use it. (lang_output_section_statement_lookup_1): New. (lang_output_section_statement_lookup): Use it. (check_section_callback, check_input_sections): New. (map_input_to_output_sections): Check if all input sections are readonly if ONLY_IF_RO or ONLY_IF_RW was seen. (strip_excluded_output_sections): Disregard output section statements with constraint == -1. (lang_record_phdrs): Likewise. (lang_enter_output_section_statement): Add constraint argument. Use lang_output_section_statement_lookup_1. * ldlang.h (lang_output_section_statement_type): Add constraint and all_input_readonly fields. (lang_enter_output_section_statement): Adjust prototype. * ldlex.l (ONLY_IF_RO, ONLY_IF_RW): New tokens. * scripttempl/elf.sc (.eh_frame, .gcc_except_table): Move into text segment if all input sections are readonly.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em5
-rw-r--r--ld/emultempl/mmo.em4
-rw-r--r--ld/emultempl/pe.em4
3 files changed, 9 insertions, 4 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 8e1c319..cf002e5 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1032,7 +1032,8 @@ output_rel_find (asection *sec, int isdyn)
for (u = lang_output_section_statement.head; u; u = lookup->next)
{
lookup = &u->output_section_statement;
- if (strncmp (".rel", lookup->name, 4) == 0)
+ if (lookup->constraint != -1
+ && strncmp (".rel", lookup->name, 4) == 0)
{
int lookrela = lookup->name[4] == 'a';
@@ -1279,7 +1280,7 @@ gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
os = lang_enter_output_section_statement (secname, address, 0,
(etree_type *) NULL,
(etree_type *) NULL,
- load_base);
+ load_base, 0);
lang_add_section (&os->children, s, os, file);
diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em
index 38f1dbf..d6d30e6 100644
--- a/ld/emultempl/mmo.em
+++ b/ld/emultempl/mmo.em
@@ -47,6 +47,8 @@ output_prev_sec_find (lang_output_section_statement_type *os)
u = lookup->next)
{
lookup = &u->output_section_statement;
+ if (lookup->constraint == -1)
+ continue;
if (lookup == os)
break;
if (lookup->bfd_section != NULL
@@ -129,7 +131,7 @@ mmo_place_orphan (lang_input_statement_type *file, asection *s)
NULL, 0,
(etree_type *) NULL,
(etree_type *) NULL,
- (etree_type *) NULL);
+ (etree_type *) NULL, 0);
lang_add_section (&os->children, s, os, file);
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index a3b50af..4438afd 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1501,6 +1501,8 @@ output_prev_sec_find (lang_output_section_statement_type *os)
u = lookup->next)
{
lookup = &u->output_section_statement;
+ if (lookup->constraint == -1)
+ continue;
if (lookup == os)
return s;
@@ -1664,7 +1666,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
os = lang_enter_output_section_statement (outsecname, address, 0,
(etree_type *) NULL,
(etree_type *) NULL,
- (etree_type *) NULL);
+ (etree_type *) NULL, 0);
lang_add_section (&add_child, s, os, file);