diff options
author | Gunther Nikl <gnikl@justmail.de> | 2020-05-12 12:18:09 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-05-12 12:18:09 +0100 |
commit | 533f049e00492f00803c633fbd87a3f985000b22 (patch) | |
tree | e32999403bd7c1fc88f7fd79e090fa426d96566b /bfd/aoutx.h | |
parent | b4991d292edd84c16bd2050bd071198ceae764fe (diff) | |
download | gdb-533f049e00492f00803c633fbd87a3f985000b22.zip gdb-533f049e00492f00803c633fbd87a3f985000b22.tar.gz gdb-533f049e00492f00803c633fbd87a3f985000b22.tar.bz2 |
[PATCH] bfd: Fix 64-bit relocation handling for a.out
* aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
relocation size.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r-- | bfd/aoutx.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bfd/aoutx.h b/bfd/aoutx.h index d545746..9ffb3fe 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1946,10 +1946,22 @@ NAME (aout, swap_std_reloc_out) (bfd *abfd, BFD_ASSERT (g->howto != NULL); - if (bfd_get_reloc_size (g->howto) != 8) - r_length = g->howto->size; /* Size as a power of two. */ - else - r_length = 3; + switch (bfd_get_reloc_size (g->howto)) + { + default: + _bfd_error_handler (_("%pB: unsupported AOUT relocation size: %d"), + abfd, bfd_get_reloc_size (g->howto)); + bfd_set_error (bfd_error_bad_value); + return; + case 1: + case 2: + case 4: + r_length = g->howto->size; /* Size as a power of two. */ + break; + case 8: + r_length = 3; + break; + } r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ /* XXX This relies on relocs coming from a.out files. */ |