From: Michael Meissner Date: Thu, 5 Feb 1998 19:29:29 +0000 (+0000) Subject: Do not allow BFD_ALIGN to wrap X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29b7118aec42737536c9e593208d7968c1220fe8;p=binutils-gdb.git Do not allow BFD_ALIGN to wrap --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9165dac3585..d2dab4897dd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 5 14:21:34 1998 Michael Meissner + + * libbfd.h (BFD_ALIGN): If rounding up would cause the address to + wrap, just return all 1's bits instead. + Thu Feb 5 11:51:05 1998 Ian Lance Taylor * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 11bfcee4a3d..6af5ca2dfa4 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -24,9 +24,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 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. */ -#define BFD_ALIGN(this, boundary) \ - ((( (this) + ((boundary) -1)) & (~((boundary)-1)))) + 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) \ + ((((this) + (boundary) - 1) >= (this)) \ + ? (((this) + ((boundary) - 1)) & (~((boundary)-1))) \ + : ~ (bfd_vma) 0) /* If you want to read and write large blocks, you might want to do it in quanta of this amount */ @@ -808,6 +812,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MN10300_32_PCREL", "BFD_RELOC_MN10300_16_PCREL", + "BFD_RELOC_TIC30_LDP", "@@overflow: BFD_RELOC_UNUSED@@", }; #endif