* emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1.
authorAlan Modra <amodra@gmail.com>
Tue, 13 Aug 2002 02:08:26 +0000 (02:08 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 13 Aug 2002 02:08:26 +0000 (02:08 +0000)
(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.

ld/ChangeLog
ld/emulparams/elf32_dlx.sh
ld/ld.h
ld/ldexp.c
ld/ldexp.h
ld/ldlang.c

index 5c6c8cc8e9049ae2309c0bc1803790cbe6be22b6..2801a99db1190bc5ff3917696955f2477130dd8f 100644 (file)
@@ -1,3 +1,16 @@
+2002-08-13  Alan Modra  <amodra@bigpond.net.au>
+
+       * 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.
+
 2002-07-31  Graeme Peterson  <gp@qnx.com>
 
        * configure.tgt: Add support for powerpc{le}-*-nto* targets.
index a3e2f46bf4dd0500c7947b415efed1a092facf8a..d3ff81c341450ce178d7814354566818c8794d43 100644 (file)
@@ -4,6 +4,6 @@ OUTPUT_FORMAT="elf32-dlx"
 ARCH=dlx
 MACHINE=
 TEXT_START_ADDR=0
-TARGET_PAGE_SIZE=0
+TARGET_PAGE_SIZE=1
 EMBEDDED=yes
-MAXPAGESIZE=0
+MAXPAGESIZE=1
diff --git a/ld/ld.h b/ld/ld.h
index 12f3f69db548049119993c62bb89c290452685b8..438e00df9aa0a2ad16f91d625677bb0a4bf8c991 100644 (file)
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -91,14 +91,6 @@ typedef struct user_section_struct {
 #define LONG_SIZE      (4)
 #define QUAD_SIZE      (8)
 
-/* ALIGN macro changed to ALIGN_N to avoid     */
-/* conflict in /usr/include/machine/machparam.h */
-/* WARNING: If THIS is a 64 bit address and BOUNDARY is a 32 bit int,
-   you must coerce boundary to the same type as THIS.
-   ??? Is there a portable way to avoid this.  */
-#define ALIGN_N(this, boundary) \
-  ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
-
 typedef struct {
   /* 1 => assign space to common symbols even if `relocatable_output'.  */
   boolean force_common_definition;
index 3beb4cf99d8c1d62f5307b906abbd3639ebca5b7..8e3ea6308e86ebb5ad8d221a4b738f65fcfef62c 100644 (file)
@@ -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;
+}
index edf335d763d074d47a05098fe40d969011823f61..3f3508edb6e102184027c7eb9f71d06470a51130 100644 (file)
@@ -122,5 +122,6 @@ int exp_get_value_int PARAMS ((etree_type *, int, char *, lang_phase_type));
 fill_type *exp_get_fill PARAMS ((etree_type *, fill_type *, char *,
                                 lang_phase_type));
 bfd_vma exp_get_abs_int PARAMS ((etree_type *, int, char *, lang_phase_type));
+bfd_vma align_n PARAMS ((bfd_vma, bfd_vma));
 
 #endif
index a777e5a435845b0dd9c2c63e281fba5831bbcc26..79de0987ff2f5fc919ac9aa2a1e77d9ab014482a 100644 (file)
@@ -3047,9 +3047,8 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
 
            /* Put the section within the requested block size, or
               align at the block boundary.  */
-           after = ALIGN_N (os->bfd_section->vma
+           after = align_n (os->bfd_section->vma
                             + os->bfd_section->_raw_size / opb,
-                            /* The coercion here is important, see ld.h.  */
                             (bfd_vma) os->block_value);
 
            if (bfd_is_abs_section (os->bfd_section))
@@ -3748,8 +3747,8 @@ lang_one_common (h, info)
   section = h->u.c.p->section;
 
   /* Increase the size of the section.  */
-  section->_cooked_size = ALIGN_N ((section->_cooked_size + opb - 1) / opb,
-                                  (bfd_size_type) (1 << power_of_two)) * opb;
+  section->_cooked_size = align_n ((section->_cooked_size + opb - 1) / opb,
+                                  (bfd_vma) 1 << power_of_two) * opb;
 
   /* Adjust the alignment if necessary.  */
   if (power_of_two > section->alignment_power)
This page took 0.032519 seconds and 4 git commands to generate.