X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fbfd-in2.h;h=5fffc46c333aa1b9d6f4ed42254b2063644208e3;hb=76e7a75123dc36dbc4ddce8a23d2acb171c2bce2;hp=3f2d93b03cd477222914058b88dd49a23268fb87;hpb=235fa74903061daff9980668423860ecc760665a;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 3f2d93b03c..5fffc46c33 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)