aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index c18b828..d4d8706 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -864,9 +864,17 @@ fold_name (etree_type *tree)
bfd_vma val;
if (tree->type.node_code == SIZEOF)
- val = (os->bfd_section->size
- / bfd_octets_per_byte (link_info.output_bfd,
- os->bfd_section));
+ {
+ if (os->processed_vma)
+ val = os->bfd_section->size;
+ else
+ /* If we've just called lang_reset_memory_regions,
+ size will be zero and a previous estimate of
+ size will be in rawsize. */
+ val = os->bfd_section->rawsize;
+ val /= bfd_octets_per_byte (link_info.output_bfd,
+ os->bfd_section);
+ }
else
val = (bfd_vma)1 << os->bfd_section->alignment_power;