aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/pep.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/pep.em')
-rw-r--r--ld/emultempl/pep.em9
1 files changed, 8 insertions, 1 deletions
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 2119367..0c1dfb9 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -1748,10 +1748,17 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
->output_section_statement);
}
- /* All sections in an executable must be aligned to a page boundary. */
+ /* All sections in an executable must be aligned to a page boundary.
+ In a relocatable link, just preserve the incoming alignment; the
+ address is discarded by lang_insert_orphan in that case, anyway. */
address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
os = lang_insert_orphan (s, secname, constraint, after, place, address,
&add_child);
+ if (link_info.relocatable)
+ {
+ os->section_alignment = s->alignment_power;
+ os->bfd_section->alignment_power = s->alignment_power;
+ }
}
/* If the section name has a '\$', sort it with the other '\$'