aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorVladislav Belov <vladislav.belov@syntacore.com>2024-02-28 16:36:37 +0000
committerNick Clifton <nickc@redhat.com>2024-02-28 16:36:37 +0000
commit60856b5cdafc520538688258a8ce4ae8be2a8477 (patch)
tree559af95a9ef48629eccb09d03b803a0a95ccc48b /ld/ldlang.c
parent8bb8f8346729c35433c961f7f1ed3a801776a362 (diff)
downloadgdb-60856b5cdafc520538688258a8ce4ae8be2a8477.zip
gdb-60856b5cdafc520538688258a8ce4ae8be2a8477.tar.gz
gdb-60856b5cdafc520538688258a8ce4ae8be2a8477.tar.bz2
Fix implementation of SUBALIGN.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 229401c..54d1af6 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -5468,13 +5468,16 @@ size_input_section
/* Align this section first to the input sections requirement,
then to the output section's requirement. If this alignment
is greater than any seen before, then record it too. Perform
- the alignment by inserting a magic 'padding' statement. */
+ the alignment by inserting a magic 'padding' statement.
+ We can force input section alignment within an output section
+ by using SUBALIGN. The value specified overrides any alignment
+ given by input sections, whether larger or smaller. */
if (output_section_statement->subsection_alignment != NULL)
- i->alignment_power
- = exp_get_power (output_section_statement->subsection_alignment,
- output_section_statement,
- "subsection alignment");
+ o->alignment_power = i->alignment_power =
+ exp_get_power (output_section_statement->subsection_alignment,
+ output_section_statement,
+ "subsection alignment");
if (o->alignment_power < i->alignment_power)
o->alignment_power = i->alignment_power;