diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-05-19 14:01:14 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-05-19 14:01:14 +0000 |
commit | 0841712ea90a7633d54bbc1f00fa82e068815b66 (patch) | |
tree | 2fa51ae9ff719886f69c1aa790ec08b9b2bb27d6 /ld/scripttempl | |
parent | f2c503287936db895a7ab693f3ddf618a46a89a3 (diff) | |
download | gdb-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/scripttempl')
-rw-r--r-- | ld/scripttempl/elf.sc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 14728ee..4d0279c 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -311,6 +311,8 @@ cat <<EOF ${CREATE_SHLIB-${SBSS2}} ${OTHER_READONLY_SECTIONS} .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } + .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ @@ -319,8 +321,8 @@ cat <<EOF ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} /* Exception handling */ - .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } - .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } + .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } + .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table) } /* Thread Local Storage sections */ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } |