diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-11-12 17:17:47 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-11-12 17:17:58 -0800 |
commit | 0f99513f2a52b7d73b94a1f77b8c6de9159b50d7 (patch) | |
tree | 09f4858b812d81f4d02b85855b9e18794649001c /ld/ldexp.h | |
parent | f882209d9aa5b68d68c45c5849e129ffc228749c (diff) | |
download | gdb-0f99513f2a52b7d73b94a1f77b8c6de9159b50d7.zip gdb-0f99513f2a52b7d73b94a1f77b8c6de9159b50d7.tar.gz gdb-0f99513f2a52b7d73b94a1f77b8c6de9159b50d7.tar.bz2 |
ld: Update phase_enum/relro_enum and add seg_align_type
Update GNU_RELRO date type so that they can also be used for text-only
LOAD segment.
* ldexp.h (phase_enum): Rename exp_dataseg_none,
exp_dataseg_align_seen, exp_dataseg_relro_seen,
exp_dataseg_end_seen, exp_dataseg_relro_adjust,
exp_dataseg_adjust and exp_dataseg_done to exp_seg_none,
exp_seg_align_seen, exp_seg_relro_seen, exp_seg_end_seen,
exp_seg_relro_adjust, exp_seg_adjust and exp_seg_done.
(relro_enum): Rename exp_dataseg_relro_none,
exp_dataseg_relro_start and exp_dataseg_relro_end to
exp_seg_relro_none, exp_seg_relro_start and exp_seg_relro_end.
(seg_align_type): New struct type.
(ldexp_control): Use seg_align_type.
* ldexp.c (fold_unary): Updated.
(fold_binary): Likewise.
* ldlang.c (strip_excluded_output_sections): Likewise.
(lang_size_sections_1): Likewise.
(lang_size_sections): Likewise.
Diffstat (limited to 'ld/ldexp.h')
-rw-r--r-- | ld/ldexp.h | 44 |
1 files changed, 23 insertions, 21 deletions
@@ -115,23 +115,34 @@ union lang_statement_union; enum phase_enum { /* We step through the first four states here as we see the associated linker script tokens. */ - exp_dataseg_none, - exp_dataseg_align_seen, - exp_dataseg_relro_seen, - exp_dataseg_end_seen, + exp_seg_none, + exp_seg_align_seen, + exp_seg_relro_seen, + exp_seg_end_seen, /* The last three states are final, and affect the value returned - by DATA_SEGMENT_ALIGN. */ - exp_dataseg_relro_adjust, - exp_dataseg_adjust, - exp_dataseg_done + by XXX_SEGMENT_ALIGN. */ + exp_seg_relro_adjust, + exp_seg_adjust, + exp_seg_done }; enum relro_enum { - exp_dataseg_relro_none, - exp_dataseg_relro_start, - exp_dataseg_relro_end, + exp_seg_relro_none, + exp_seg_relro_start, + exp_seg_relro_end, }; +typedef struct { + enum phase_enum phase; + + bfd_vma base, relro_offset, relro_end, end, pagesize, maxpagesize; + + enum relro_enum relro; + + union lang_statement_union *relro_start_stat; + union lang_statement_union *relro_end_stat; +} seg_align_type; + struct ldexp_control { /* Modify expression evaluation depending on this. */ lang_phase_type phase; @@ -161,16 +172,7 @@ struct ldexp_control { asection *section; /* State machine and results for DATASEG. */ - struct { - enum phase_enum phase; - - bfd_vma base, relro_offset, relro_end, end, pagesize, maxpagesize; - - enum relro_enum relro; - - union lang_statement_union *relro_start_stat; - union lang_statement_union *relro_end_stat; - } dataseg; + seg_align_type dataseg; }; extern struct ldexp_control expld; |