diff options
author | Michael Meissner <gnu@the-meissners.org> | 1998-02-05 19:29:29 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1998-02-05 19:29:29 +0000 |
commit | 29b7118aec42737536c9e593208d7968c1220fe8 (patch) | |
tree | 388aa380fcfb98af57b7b30b255aeef8dd47fdc7 /bfd | |
parent | fa1a1b3235e5a1b93ac38c69dbefab953023b58e (diff) | |
download | gdb-29b7118aec42737536c9e593208d7968c1220fe8.zip gdb-29b7118aec42737536c9e593208d7968c1220fe8.tar.gz gdb-29b7118aec42737536c9e593208d7968c1220fe8.tar.bz2 |
Do not allow BFD_ALIGN to wrap
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/libbfd.h | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9165dac..d2dab48 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 5 14:21:34 1998 Michael Meissner <meissner@cygnus.com> + + * 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 <ian@cygnus.com> * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 11bfcee..6af5ca2 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 |