@@ -39,56 +39,59 @@
#include "libcoff.h"
-
-
-
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */
#define MINUS_ONE (~ (bfd_vma) 0)
-static reloc_howto_type arm64_reloc_howto_64 = HOWTO(IMAGE_REL_ARM64_ADDR64, 0, 8, 64, false, 0,
+static const reloc_howto_type arm64_reloc_howto_64 = HOWTO(IMAGE_REL_ARM64_ADDR64, 0, 8, 64, false, 0,
complain_overflow_bitfield,
NULL, "64",
false, MINUS_ONE, MINUS_ONE, false);
-static reloc_howto_type arm64_reloc_howto_32 = HOWTO (IMAGE_REL_ARM64_ADDR32, 0, 4, 32, false, 0,
+static const reloc_howto_type arm64_reloc_howto_32 = HOWTO (IMAGE_REL_ARM64_ADDR32, 0, 4, 32, false, 0,
complain_overflow_bitfield,
NULL, "32",
false, 0xffffffff, 0xffffffff, false);
-static reloc_howto_type arm64_reloc_howto_32_pcrel = HOWTO (IMAGE_REL_ARM64_REL32, 0, 4, 32, true, 0,
+static const reloc_howto_type arm64_reloc_howto_32_pcrel = HOWTO (IMAGE_REL_ARM64_REL32, 0, 4, 32, true, 0,
complain_overflow_bitfield,
NULL, "DISP32",
false, 0xffffffff, 0xffffffff, true);
-static reloc_howto_type arm64_reloc_howto_branch26 = HOWTO (IMAGE_REL_ARM64_BRANCH26, 0, 4, 26, true, 0,
+static const reloc_howto_type arm64_reloc_howto_branch26 = HOWTO (IMAGE_REL_ARM64_BRANCH26, 0, 4, 26, true, 0,
complain_overflow_bitfield,
NULL, "BRANCH26",
false, 0x03ffffff, 0x03ffffff, true);
-static reloc_howto_type arm64_reloc_howto_page21 = HOWTO (IMAGE_REL_ARM64_PAGEBASE_REL21, 12, 4, 21, true, 0,
+static const reloc_howto_type arm64_reloc_howto_page21 = HOWTO (IMAGE_REL_ARM64_PAGEBASE_REL21, 12, 4, 21, true, 0,
complain_overflow_signed,
NULL, "PAGE21",
false, 0x1fffff, 0x1fffff, false);
-static reloc_howto_type arm64_reloc_howto_lo21 = HOWTO (IMAGE_REL_ARM64_REL21, 0, 4, 21, true, 0,
+static const reloc_howto_type arm64_reloc_howto_lo21 = HOWTO (IMAGE_REL_ARM64_REL21, 0, 4, 21, true, 0,
complain_overflow_signed,
NULL, "LO21",
false, 0x1fffff, 0x1fffff, true);
-static reloc_howto_type arm64_reloc_howto_pgoff12 = HOWTO (IMAGE_REL_ARM64_PAGEOFFSET_12L, 1, 4, 12, true, 0,
+static const reloc_howto_type arm64_reloc_howto_pgoff12 = HOWTO (IMAGE_REL_ARM64_PAGEOFFSET_12L, 1, 4, 12, true, 0,
complain_overflow_signed,
NULL, "PGOFF12",
false, 0xffe, 0xffe, true);
+static const reloc_howto_type arm64_reloc_howto_branch19 = HOWTO (IMAGE_REL_ARM64_BRANCH19, 2, 4, 19, true, 0,
+ complain_overflow_signed,
+ NULL, "BRANCH19",
+ false, 0x7ffff, 0x7ffff, true);
+
-static reloc_howto_type* arm64_howto_table[] = {
+static const reloc_howto_type* const arm64_howto_table[] = {
&arm64_reloc_howto_64,
&arm64_reloc_howto_32,
&arm64_reloc_howto_32_pcrel,
&arm64_reloc_howto_branch26,
&arm64_reloc_howto_page21,
&arm64_reloc_howto_lo21,
- &arm64_reloc_howto_pgoff12
+ &arm64_reloc_howto_pgoff12,
+ &arm64_reloc_howto_branch19
};
#ifndef NUM_ELEM
@@ -100,8 +103,6 @@ static reloc_howto_type* arm64_howto_table[] = {
#define coff_bfd_reloc_type_lookup coff_aarch64_reloc_type_lookup
#define coff_bfd_reloc_name_lookup coff_aarch64_reloc_name_lookup
-
-
static reloc_howto_type *
coff_aarch64_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
{
@@ -122,6 +123,8 @@ coff_aarch64_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real
return &arm64_reloc_howto_lo21;
case BFD_RELOC_AARCH64_LDST16_LO12:
return &arm64_reloc_howto_pgoff12;
+ case BFD_RELOC_AARCH64_BRANCH19:
+ return &arm64_reloc_howto_branch19;
default:
BFD_FAIL ();
return NULL;
@@ -148,7 +151,7 @@ coff_aarch64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
#define COFF_PAGE_SIZE 0x1000
static reloc_howto_type *
-coff_aarch64_rtype_lookup (unsigned int code ATTRIBUTE_UNUSED)
+coff_aarch64_rtype_lookup (unsigned int code)
{
switch (code)
{
@@ -164,8 +167,10 @@ coff_aarch64_rtype_lookup (unsigned int code ATTRIBUTE_UNUSED)
return &arm64_reloc_howto_page21;
case IMAGE_REL_ARM64_REL21:
return &arm64_reloc_howto_lo21;
- case BFD_RELOC_AARCH64_LDST16_LO12:
+ case IMAGE_REL_ARM64_PAGEOFFSET_12L:
return &arm64_reloc_howto_pgoff12;
+ case IMAGE_REL_ARM64_BRANCH19:
+ return &arm64_reloc_howto_branch19;
default:
BFD_FAIL ();
return NULL;
@@ -10250,10 +10250,13 @@ struct aarch64_option_abi_value_table
enum aarch64_abi_type value;
};
-#ifdef OBJ_ELF
static const struct aarch64_option_abi_value_table aarch64_abis[] = {
+#ifdef OBJ_ELF
{"ilp32", AARCH64_ABI_ILP32},
{"lp64", AARCH64_ABI_LP64},
+#else
+ {"llp64", AARCH64_ABI_LLP64},
+#endif
};
static int
@@ -10277,13 +10280,10 @@ aarch64_parse_abi (const char *str)
as_bad (_("unknown abi `%s'\n"), str);
return 0;
}
-#endif
static struct aarch64_long_option_table aarch64_long_opts[] = {
-#ifdef OBJ_ELF
{"mabi=", N_("<abi name>\t specify for ABI <abi name>"),
aarch64_parse_abi, NULL},
-#endif /* OBJ_ELF */
{"mcpu=", N_("<cpu name>\t assemble for CPU <cpu name>"),
aarch64_parse_cpu, NULL},
{"march=", N_("<arch name>\t assemble for architecture <arch name>"),