aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-08-13 02:08:26 +0000
committerAlan Modra <amodra@gmail.com>2002-08-13 02:08:26 +0000
commitc553bb910d30224f6d5e1e10a67a839093e97fa0 (patch)
tree52c723c7b8b604e0ecff9ffe0ca914faf69e074f /ld/ldexp.c
parent8e7157081c0a1cee57d160591c2c50f9e0c145e3 (diff)
downloadgdb-c553bb910d30224f6d5e1e10a67a839093e97fa0.zip
gdb-c553bb910d30224f6d5e1e10a67a839093e97fa0.tar.gz
gdb-c553bb910d30224f6d5e1e10a67a839093e97fa0.tar.bz2
* emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1.
(MAXPAGESIZE): Set to 1. * ld.h (ALIGN_N): Delete. * ldexp.h (align_n): Declare. * ldexp.c (align_n): New function. (fold_binary): Use align_n instead of ALIGN_N. (exp_fold_tree): Likewise. * ldlang.c (lang_size_sections_1): Likewise. (lang_one_common): Likewise.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 3beb4cf..8e3ea63 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -350,7 +350,7 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
{
bfd_vma maxpage = result.value;
- result.value = ALIGN_N (dot, maxpage);
+ result.value = align_n (dot, maxpage);
if (exp_data_seg.phase != exp_dataseg_adjust)
{
result.value += dot & (maxpage - 1);
@@ -593,14 +593,14 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
{
case ALIGN_K:
if (allocation_done != lang_first_phase_enum)
- result = new_rel_from_section (ALIGN_N (dot, result.value),
+ result = new_rel_from_section (align_n (dot, result.value),
current_section);
else
result.valid_p = false;
break;
case ABSOLUTE:
- if (allocation_done != lang_first_phase_enum && result.valid_p)
+ if (allocation_done != lang_first_phase_enum)
{
result.value += result.section->bfd_section->vma;
result.section = abs_output_section;
@@ -629,7 +629,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
if (allocation_done == lang_allocating_phase_enum)
{
make_abs (&result);
- result.value = ALIGN_N (dot, result.value);
+ result.value = align_n (dot, result.value);
}
else
result.valid_p = false;
@@ -1127,3 +1127,14 @@ exp_get_abs_int (tree, def, name, allocation_done)
return res.value;
}
+
+bfd_vma align_n (value, align)
+ bfd_vma value;
+ bfd_vma align;
+{
+ if (align <= 1)
+ return value;
+
+ value = (value + align - 1) / align;
+ return value * align;
+}