aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd-in2.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r--bfd/bfd-in2.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 3f2d93b..5fffc46 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -263,7 +263,7 @@ struct orl /* Output ranlib. */
} u; /* bfd* or file position. */
int namidx; /* Index into string table. */
};
-
+
/* Linenumber stuff. */
typedef struct lineno_cache_entry
{
@@ -277,11 +277,19 @@ typedef struct lineno_cache_entry
alent;
/* Object and core file sections. */
+typedef struct bfd_section *sec_ptr;
#define align_power(addr, align) \
(((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
-typedef struct bfd_section *sec_ptr;
+/* Align an address upward to a boundary, expressed as a number of bytes.
+ E.g. align to an 8-byte boundary with argument of 8. Take care never
+ to wrap around if the address is within boundary-1 of the end of the
+ address space. */
+#define BFD_ALIGN(this, boundary) \
+ ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
+ ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
+ : ~ (bfd_vma) 0)
#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)