(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-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.
ARCH=dlx
MACHINE=
TEXT_START_ADDR=0
-TARGET_PAGE_SIZE=0
+TARGET_PAGE_SIZE=1
EMBEDDED=yes
-MAXPAGESIZE=0
+MAXPAGESIZE=1
#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;
{
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);
{
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;
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;
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;
+}
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
/* 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))
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)