diff options
author | Alan Modra <amodra@gmail.com> | 2011-01-12 12:07:19 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-01-12 12:07:19 +0000 |
commit | ea7c2e6c9b3798ae7d73c370857761f130e95e00 (patch) | |
tree | a258cb40d9bd565acdc8376ef33bcfa0a2039c24 /ld/ldexp.h | |
parent | d5ae309f069331dbec7bfd3e5d8c597aa0619ba2 (diff) | |
download | binutils-ea7c2e6c9b3798ae7d73c370857761f130e95e00.zip binutils-ea7c2e6c9b3798ae7d73c370857761f130e95e00.tar.gz binutils-ea7c2e6c9b3798ae7d73c370857761f130e95e00.tar.bz2 |
PR ld/12380
* ldexp.h (enum phase_enum): Comment. Add exp_dataseg_done.
* ldexp.c (fold_unary <DATA_SEGMENT_END>): Rearrange code. Test
for exp_dataseg_done rather than expld.phase == lang_final_phase_enum
to detect when we've finished sizing sections.
(fold_binary <DATA_SEGMENT_ALIGN>): Likewise.
(fold_binary <DATA_SEGMENT_RELRO_END>): Likewise. Also test
that we are not inside an output section statement.
* ldlang.c (lang_size_sections): Set exp_dataseg_done on exit if
not exp_dataseg_relro_adjust or exp_dataseg_adjust. Don't set
lang_final_phase_enum here.
(lang_process): Set lang_final_phase_enum here.
Diffstat (limited to 'ld/ldexp.h')
-rw-r--r-- | ld/ldexp.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,6 +1,6 @@ /* ldexp.h - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -103,12 +103,17 @@ typedef enum { 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, + /* The last three states are final, and affect the value returned + by DATA_SEGMENT_ALIGN. */ exp_dataseg_relro_adjust, - exp_dataseg_adjust + exp_dataseg_adjust, + exp_dataseg_done }; enum relro_enum { |