X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-wasm32.c;h=400d754c6ac4711ec00e8b0c30a4af0b5dc14bbb;hb=301a9420d947da145884261ac31a7a52438c2894;hp=5205bef608a5ed67f3543dc6e521fa5d942f69ac;hpb=219d1afa89d0d53ca93a684cac341f16470f3ca0;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-wasm32.c b/bfd/elf32-wasm32.c index 5205bef608..400d754c6a 100644 --- a/bfd/elf32-wasm32.c +++ b/bfd/elf32-wasm32.c @@ -1,5 +1,5 @@ /* 32-bit ELF for the WebAssembly target - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -22,7 +22,6 @@ #include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" -#include "bfd_stdint.h" #include "libiberty.h" #include "elf/wasm32.h" @@ -103,26 +102,29 @@ elf32_wasm32_rtype_to_howto (bfd *abfd, unsigned r_type) if (i >= ARRAY_SIZE (elf32_wasm32_howto_table)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) r_type); - i = R_WASM32_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return NULL; } if (elf32_wasm32_howto_table[i].type != r_type) return NULL; - return &elf32_wasm32_howto_table[i]; + return elf32_wasm32_howto_table + i; } /* Translate the ELF-internal relocation RELA into CACHE_PTR. */ -static void -elf32_wasm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf32_wasm32_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = elf32_wasm32_rtype_to_howto (abfd, r_type); + return cache_ptr->howto != NULL; } #define ELF_ARCH bfd_arch_wasm32