• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンaaaeb63d738f000d38c0b01eeabe30e1fa424fe4 (tree)
日時2015-12-17 00:02:37
作者Yoshinori Sato <ysato@user...>
コミッターYoshinori Sato

ログメッセージ

Merge branch 'master' of ssh://sourceware.org/git/binutils-gdb

変更サマリ

差分

--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -3516,6 +3516,12 @@ pc-relative or some form of GOT-indirect relocation. */
35163516 /* ARM support for STT_GNU_IFUNC. */
35173517 BFD_RELOC_ARM_IRELATIVE,
35183518
3519+/* Thumb1 relocations to support execute-only code. */
3520+ BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3521+ BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3522+ BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3523+ BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3524+
35193525 /* These relocs are only used within the ARM assembler. They are not
35203526 (at present) written to any object files. */
35213527 BFD_RELOC_ARM_IMMEDIATE,
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -1689,6 +1689,60 @@ static reloc_howto_type elf32_arm_howto_table_1[] =
16891689 0x00000000, /* src_mask */
16901690 0x00000000, /* dst_mask */
16911691 FALSE), /* pcrel_offset */
1692+ EMPTY_HOWTO (130),
1693+ EMPTY_HOWTO (131),
1694+ HOWTO (R_ARM_THM_ALU_ABS_G0_NC,/* type. */
1695+ 0, /* rightshift. */
1696+ 1, /* size (0 = byte, 1 = short, 2 = long). */
1697+ 16, /* bitsize. */
1698+ FALSE, /* pc_relative. */
1699+ 0, /* bitpos. */
1700+ complain_overflow_bitfield,/* complain_on_overflow. */
1701+ bfd_elf_generic_reloc, /* special_function. */
1702+ "R_ARM_THM_ALU_ABS_G0_NC",/* name. */
1703+ FALSE, /* partial_inplace. */
1704+ 0x00000000, /* src_mask. */
1705+ 0x00000000, /* dst_mask. */
1706+ FALSE), /* pcrel_offset. */
1707+ HOWTO (R_ARM_THM_ALU_ABS_G1_NC,/* type. */
1708+ 0, /* rightshift. */
1709+ 1, /* size (0 = byte, 1 = short, 2 = long). */
1710+ 16, /* bitsize. */
1711+ FALSE, /* pc_relative. */
1712+ 0, /* bitpos. */
1713+ complain_overflow_bitfield,/* complain_on_overflow. */
1714+ bfd_elf_generic_reloc, /* special_function. */
1715+ "R_ARM_THM_ALU_ABS_G1_NC",/* name. */
1716+ FALSE, /* partial_inplace. */
1717+ 0x00000000, /* src_mask. */
1718+ 0x00000000, /* dst_mask. */
1719+ FALSE), /* pcrel_offset. */
1720+ HOWTO (R_ARM_THM_ALU_ABS_G2_NC,/* type. */
1721+ 0, /* rightshift. */
1722+ 1, /* size (0 = byte, 1 = short, 2 = long). */
1723+ 16, /* bitsize. */
1724+ FALSE, /* pc_relative. */
1725+ 0, /* bitpos. */
1726+ complain_overflow_bitfield,/* complain_on_overflow. */
1727+ bfd_elf_generic_reloc, /* special_function. */
1728+ "R_ARM_THM_ALU_ABS_G2_NC",/* name. */
1729+ FALSE, /* partial_inplace. */
1730+ 0x00000000, /* src_mask. */
1731+ 0x00000000, /* dst_mask. */
1732+ FALSE), /* pcrel_offset. */
1733+ HOWTO (R_ARM_THM_ALU_ABS_G3_NC,/* type. */
1734+ 0, /* rightshift. */
1735+ 1, /* size (0 = byte, 1 = short, 2 = long). */
1736+ 16, /* bitsize. */
1737+ FALSE, /* pc_relative. */
1738+ 0, /* bitpos. */
1739+ complain_overflow_bitfield,/* complain_on_overflow. */
1740+ bfd_elf_generic_reloc, /* special_function. */
1741+ "R_ARM_THM_ALU_ABS_G3_NC",/* name. */
1742+ FALSE, /* partial_inplace. */
1743+ 0x00000000, /* src_mask. */
1744+ 0x00000000, /* dst_mask. */
1745+ FALSE), /* pcrel_offset. */
16921746 };
16931747
16941748 /* 160 onwards: */
@@ -1889,7 +1943,11 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
18891943 {BFD_RELOC_ARM_LDC_SB_G0, R_ARM_LDC_SB_G0},
18901944 {BFD_RELOC_ARM_LDC_SB_G1, R_ARM_LDC_SB_G1},
18911945 {BFD_RELOC_ARM_LDC_SB_G2, R_ARM_LDC_SB_G2},
1892- {BFD_RELOC_ARM_V4BX, R_ARM_V4BX}
1946+ {BFD_RELOC_ARM_V4BX, R_ARM_V4BX},
1947+ {BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, R_ARM_THM_ALU_ABS_G3_NC},
1948+ {BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, R_ARM_THM_ALU_ABS_G2_NC},
1949+ {BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, R_ARM_THM_ALU_ABS_G1_NC},
1950+ {BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, R_ARM_THM_ALU_ABS_G0_NC}
18931951 };
18941952
18951953 static reloc_howto_type *
@@ -11023,6 +11081,33 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
1102311081 }
1102411082 return bfd_reloc_ok;
1102511083
11084+ case R_ARM_THM_ALU_ABS_G0_NC:
11085+ case R_ARM_THM_ALU_ABS_G1_NC:
11086+ case R_ARM_THM_ALU_ABS_G2_NC:
11087+ case R_ARM_THM_ALU_ABS_G3_NC:
11088+ {
11089+ const int shift_array[4] = {0, 8, 16, 24};
11090+ bfd_vma insn = bfd_get_16 (input_bfd, hit_data);
11091+ bfd_vma addr = value;
11092+ int shift = shift_array[r_type - R_ARM_THM_ALU_ABS_G0_NC];
11093+
11094+ /* Compute address. */
11095+ if (globals->use_rel)
11096+ signed_addend = insn & 0xff;
11097+ addr += signed_addend;
11098+ if (branch_type == ST_BRANCH_TO_THUMB)
11099+ addr |= 1;
11100+ /* Clean imm8 insn. */
11101+ insn &= 0xff00;
11102+ /* And update with correct part of address. */
11103+ insn |= (addr >> shift) & 0xff;
11104+ /* Update insn. */
11105+ bfd_put_16 (input_bfd, insn, hit_data);
11106+ }
11107+
11108+ *unresolved_reloc_p = FALSE;
11109+ return bfd_reloc_ok;
11110+
1102611111 default:
1102711112 return bfd_reloc_notsupported;
1102811113 }
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1545,6 +1545,10 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
15451545 "BFD_RELOC_ARM_LDC_SB_G2",
15461546 "BFD_RELOC_ARM_V4BX",
15471547 "BFD_RELOC_ARM_IRELATIVE",
1548+ "BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC",
1549+ "BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC",
1550+ "BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC",
1551+ "BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC",
15481552 "BFD_RELOC_ARM_IMMEDIATE",
15491553 "BFD_RELOC_ARM_ADRL_IMMEDIATE",
15501554 "BFD_RELOC_ARM_T32_IMMEDIATE",
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -3272,6 +3272,17 @@ ENUMDOC
32723272 ARM support for STT_GNU_IFUNC.
32733273
32743274 ENUM
3275+ BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC
3276+ENUMX
3277+ BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC
3278+ENUMX
3279+ BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC
3280+ENUMX
3281+ BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC
3282+ENUMDOC
3283+ Thumb1 relocations to support execute-only code.
3284+
3285+ENUM
32753286 BFD_RELOC_ARM_IMMEDIATE
32763287 ENUMX
32773288 BFD_RELOC_ARM_ADRL_IMMEDIATE
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
1-#define BFD_VERSION_DATE 20151215
1+#define BFD_VERSION_DATE 20151216
22 #define BFD_VERSION @bfd_version@
33 #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
44 #define REPORT_BUGS_TO @report_bugs_to@
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
1+2015-12-15 Nick Clifton <nickc@redhat.com>
2+
3+ * doc/c-msp430.texi (MSP430 Options): Remove references to a
4+ non-existant silicon errata.
5+ * config/tc-msp430.c: Likewise.
6+
17 2015-12-14 Matthew Wahab <matthew.wahab@arm.com>
28
39 * config/tc-aarch64.c (parse_neon_type_for_operand): Adjust to
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -5273,7 +5273,28 @@ static struct group_reloc_table_entry group_reloc_table[] =
52735273 BFD_RELOC_ARM_ALU_SB_G2, /* ALU */
52745274 BFD_RELOC_ARM_LDR_SB_G2, /* LDR */
52755275 BFD_RELOC_ARM_LDRS_SB_G2, /* LDRS */
5276- BFD_RELOC_ARM_LDC_SB_G2 } }; /* LDC */
5276+ BFD_RELOC_ARM_LDC_SB_G2 }, /* LDC */
5277+ /* Absolute thumb alu relocations. */
5278+ { "lower0_7",
5279+ BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,/* ALU. */
5280+ 0, /* LDR. */
5281+ 0, /* LDRS. */
5282+ 0 }, /* LDC. */
5283+ { "lower8_15",
5284+ BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,/* ALU. */
5285+ 0, /* LDR. */
5286+ 0, /* LDRS. */
5287+ 0 }, /* LDC. */
5288+ { "upper0_7",
5289+ BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,/* ALU. */
5290+ 0, /* LDR. */
5291+ 0, /* LDRS. */
5292+ 0 }, /* LDC. */
5293+ { "upper8_15",
5294+ BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,/* ALU. */
5295+ 0, /* LDR. */
5296+ 0, /* LDRS. */
5297+ 0 } }; /* LDC. */
52775298
52785299 /* Given the address of a pointer pointing to the textual name of a group
52795300 relocation as may appear in assembler source, attempt to find its details
@@ -10394,7 +10415,9 @@ do_t_add_sub (void)
1039410415 {
1039510416 inst.instruction = THUMB_OP16(opcode);
1039610417 inst.instruction |= (Rd << 4) | Rs;
10397- inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD;
10418+ if (inst.reloc.type < BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC
10419+ || inst.reloc.type > BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC)
10420+ inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD;
1039810421 if (inst.size_req != 2)
1039910422 inst.relax = opcode;
1040010423 }
@@ -11745,9 +11768,13 @@ do_t_mov_cmp (void)
1174511768 inst.instruction = THUMB_OP16 (opcode);
1174611769 inst.instruction |= Rn << 8;
1174711770 if (inst.size_req == 2)
11748- inst.reloc.type = BFD_RELOC_ARM_THUMB_IMM;
11771+ {
11772+ if (inst.reloc.type < BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC
11773+ || inst.reloc.type > BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC)
11774+ inst.reloc.type = BFD_RELOC_ARM_THUMB_IMM;
11775+ }
1174911776 else
11750- inst.relax = opcode;
11777+ inst.relax = opcode;
1175111778 }
1175211779 else
1175311780 {
@@ -18608,7 +18635,7 @@ static const struct asm_opcode insns[] =
1860818635 CL("cmnp", 170f000, 2, (RR, SH), cmp),
1860918636
1861018637 tCE("mov", 1a00000, _mov, 2, (RR, SH), mov, t_mov_cmp),
18611- tC3("movs", 1b00000, _movs, 2, (RR, SH), mov, t_mov_cmp),
18638+ tC3("movs", 1b00000, _movs, 2, (RR, SHG), mov, t_mov_cmp),
1861218639 tCE("mvn", 1e00000, _mvn, 2, (RR, SH), mov, t_mvn_tst),
1861318640 tC3("mvns", 1f00000, _mvns, 2, (RR, SH), mov, t_mvn_tst),
1861418641
@@ -23242,6 +23269,68 @@ md_apply_fix (fixS * fixP,
2324223269 }
2324323270 return;
2324423271
23272+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC:
23273+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC:
23274+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC:
23275+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC:
23276+ gas_assert (!fixP->fx_done);
23277+ {
23278+ bfd_vma insn;
23279+ bfd_boolean is_mov;
23280+ bfd_vma encoded_addend = value;
23281+
23282+ /* Check that addend can be encoded in instruction. */
23283+ if (!seg->use_rela_p && (value < 0 || value > 255))
23284+ as_bad_where (fixP->fx_file, fixP->fx_line,
23285+ _("the offset 0x%08lX is not representable"),
23286+ (unsigned long) encoded_addend);
23287+
23288+ /* Extract the instruction. */
23289+ insn = md_chars_to_number (buf, THUMB_SIZE);
23290+ is_mov = (insn & 0xf800) == 0x2000;
23291+
23292+ /* Encode insn. */
23293+ if (is_mov)
23294+ {
23295+ if (!seg->use_rela_p)
23296+ insn |= encoded_addend;
23297+ }
23298+ else
23299+ {
23300+ int rd, rs;
23301+
23302+ /* Extract the instruction. */
23303+ /* Encoding is the following
23304+ 0x8000 SUB
23305+ 0x00F0 Rd
23306+ 0x000F Rs
23307+ */
23308+ /* The following conditions must be true :
23309+ - ADD
23310+ - Rd == Rs
23311+ - Rd <= 7
23312+ */
23313+ rd = (insn >> 4) & 0xf;
23314+ rs = insn & 0xf;
23315+ if ((insn & 0x8000) || (rd != rs) || rd > 7)
23316+ as_bad_where (fixP->fx_file, fixP->fx_line,
23317+ _("Unable to process relocation for thumb opcode: %lx"),
23318+ (unsigned long) insn);
23319+
23320+ /* Encode as ADD immediate8 thumb 1 code. */
23321+ insn = 0x3000 | (rd << 8);
23322+
23323+ /* Place the encoded addend into the first 8 bits of the
23324+ instruction. */
23325+ if (!seg->use_rela_p)
23326+ insn |= encoded_addend;
23327+ }
23328+
23329+ /* Update the instruction. */
23330+ md_number_to_chars (buf, insn, THUMB_SIZE);
23331+ }
23332+ break;
23333+
2324523334 case BFD_RELOC_ARM_ALU_PC_G0_NC:
2324623335 case BFD_RELOC_ARM_ALU_PC_G0:
2324723336 case BFD_RELOC_ARM_ALU_PC_G1_NC:
@@ -23579,6 +23668,10 @@ tc_gen_reloc (asection *section, fixS *fixp)
2357923668 case BFD_RELOC_ARM_LDC_SB_G1:
2358023669 case BFD_RELOC_ARM_LDC_SB_G2:
2358123670 case BFD_RELOC_ARM_V4BX:
23671+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC:
23672+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC:
23673+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC:
23674+ case BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC:
2358223675 code = fixp->fx_r_type;
2358323676 break;
2358423677
@@ -23881,6 +23974,12 @@ arm_fix_adjustable (fixS * fixP)
2388123974 || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT_PCREL)
2388223975 return FALSE;
2388323976
23977+ /* BFD_RELOC_ARM_THUMB_ALU_ABS_Gx_NC relocations have VERY limited
23978+ offsets, so keep these symbols. */
23979+ if (fixP->fx_r_type >= BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC
23980+ && fixP->fx_r_type <= BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC)
23981+ return FALSE;
23982+
2388423983 return TRUE;
2388523984 }
2388623985 #endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -694,8 +694,6 @@ static unsigned int silicon_errata_warn = 0;
694694 #define SILICON_ERRATA_CPU12 (1 << 3)
695695 #define SILICON_ERRATA_CPU13 (1 << 4)
696696 #define SILICON_ERRATA_CPU19 (1 << 5)
697-#define SILICON_ERRATA_CPU42 (1 << 6)
698-#define SILICON_ERRATA_CPU42_PLUS (1 << 7)
699697
700698 static void
701699 msp430_set_arch (int option)
@@ -1338,8 +1336,6 @@ md_parse_option (int c, char * arg)
13381336 { STRING_COMMA_LEN ("cpu12"), SILICON_ERRATA_CPU12 },
13391337 { STRING_COMMA_LEN ("cpu13"), SILICON_ERRATA_CPU13 },
13401338 { STRING_COMMA_LEN ("cpu19"), SILICON_ERRATA_CPU19 },
1341- { STRING_COMMA_LEN ("cpu42"), SILICON_ERRATA_CPU42 },
1342- { STRING_COMMA_LEN ("cpu42+"), SILICON_ERRATA_CPU42_PLUS },
13431339 };
13441340
13451341 do
@@ -1579,7 +1575,7 @@ md_show_usage (FILE * stream)
15791575 fprintf (stream,
15801576 _(" -msilicon-errata=<name>[,<name>...] - enable fixups for silicon errata\n"
15811577 " -msilicon-errata-warn=<name>[,<name>...] - warn when a fixup might be needed\n"
1582- " supported errata names: cpu4, cpu8, cpu11, cpu12, cpu13, cpu19, cpu42, cpu42+\n"));
1578+ " supported errata names: cpu4, cpu8, cpu11, cpu12, cpu13, cpu19\n"));
15831579 fprintf (stream,
15841580 _(" -mQ - enable relaxation at assembly time. DANGEROUS!\n"
15851581 " -mP - enable polymorph instructions\n"));
@@ -2605,9 +2601,7 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
26052601 switch (check_for_nop & - check_for_nop)
26062602 {
26072603 case NOP_CHECK_INTERRUPT:
2608- if (warn_interrupt_nops
2609- || silicon_errata_warn & SILICON_ERRATA_CPU42
2610- || silicon_errata_warn & SILICON_ERRATA_CPU42_PLUS)
2604+ if (warn_interrupt_nops)
26112605 {
26122606 if (gen_interrupt_nops)
26132607 as_warn (_("NOP inserted between two instructions that change interrupt state"));
@@ -2615,8 +2609,7 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
26152609 as_warn (_("a NOP might be needed here because of successive changes in interrupt state"));
26162610 }
26172611
2618- if (gen_interrupt_nops
2619- || silicon_errata_fix & SILICON_ERRATA_CPU42_PLUS)
2612+ if (gen_interrupt_nops)
26202613 /* Emit a NOP between interrupt enable/disable.
26212614 See 1.3.4.1 of the MSP430x5xx User Guide. */
26222615 doit = TRUE;
--- a/gas/doc/c-arm.texi
+++ b/gas/doc/c-arm.texi
@@ -537,6 +537,22 @@ respectively. For example to load the 32-bit address of foo into r0:
537537 MOVT r0, #:upper16:foo
538538 @end smallexample
539539
540+Relocations @samp{R_ARM_THM_ALU_ABS_G0_NC}, @samp{R_ARM_THM_ALU_ABS_G1_NC},
541+@samp{R_ARM_THM_ALU_ABS_G2_NC} and @samp{R_ARM_THM_ALU_ABS_G3_NC} can be
542+generated by prefixing the value with @samp{#:lower0_7:#},
543+@samp{#:lower8_15:#}, @samp{#:upper0_7:#} and @samp{#:upper8_15:#}
544+respectively. For example to load the 32-bit address of foo into r0:
545+
546+@smallexample
547+ MOVS r0, #:upper8_15:#foo
548+ LSLS r0, r0, #8
549+ ADDS r0, #:upper0_7:#foo
550+ LSLS r0, r0, #8
551+ ADDS r0, #:lower8_15:#foo
552+ LSLS r0, r0, #8
553+ ADDS r0, #:lower0_7:#foo
554+@end smallexample
555+
540556 @node ARM-Neon-Alignment
541557 @subsection NEON Alignment Specifiers
542558
--- a/gas/doc/c-msp430.texi
+++ b/gas/doc/c-msp430.texi
@@ -57,10 +57,6 @@ Do not use the @code{PC} in a @code{CMP} or @code{BIT} instruction.
5757 Do not use an arithmetic instruction to modify the @code{SR}.
5858 @item cpu19
5959 Insert @code{NOP} after @code{CPUOFF}.
60-@item cpu42
61-Warn where a @code{NOP} ought to be present after enabling interrupts.
62-@item cpu42+
63-Add @code{NOP} after enabling interrupts.
6460 @end table
6561
6662 @item -msilicon-errata-warn=@var{name}[,@var{name}@dots{}]
--- /dev/null
+++ b/gas/testsuite/gas/arm/adds-thumb1-reloc-local.d
@@ -0,0 +1,16 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
3+#name: ADDS relocations against local symbols for armv6s-m
4+
5+.*: +file format .*arm.*
6+
7+Disassembly of section .text:
8+0[0-9a-f]+ <[^>]+> 3000 adds r0, #0
9+ 0: R_ARM_THM_ALU_ABS_G3_NC bar
10+0[0-9a-f]+ <[^>]+> 3000 adds r0, #0
11+ 2: R_ARM_THM_ALU_ABS_G2_NC bar
12+0[0-9a-f]+ <[^>]+> 3000 adds r0, #0
13+ 4: R_ARM_THM_ALU_ABS_G1_NC bar
14+0[0-9a-f]+ <[^>]+> 3000 adds r0, #0
15+ 6: R_ARM_THM_ALU_ABS_G0_NC bar
16+#...
--- /dev/null
+++ b/gas/testsuite/gas/arm/adds-thumb1-reloc-local.s
@@ -0,0 +1,13 @@
1+.arch armv6s-m
2+.text
3+.syntax unified
4+.thumb
5+foo:
6+adds r0, #:upper8_15:#bar
7+adds r0, #:upper0_7:#bar
8+adds r0, #:lower8_15:#bar
9+adds r0, #:lower0_7:#bar
10+
11+.space 0x10000
12+
13+bar:
--- /dev/null
+++ b/gas/testsuite/gas/arm/movs-thumb1-reloc-local.d
@@ -0,0 +1,16 @@
1+#objdump: -dr --prefix-addresses --show-raw-insn
2+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
3+#name: MOVS relocations against local symbols for armv6s-m
4+
5+.*: +file format .*arm.*
6+
7+Disassembly of section .text:
8+0[0-9a-f]+ <[^>]+> 2000 movs r0, #0
9+ 0: R_ARM_THM_ALU_ABS_G3_NC bar
10+0[0-9a-f]+ <[^>]+> 2000 movs r0, #0
11+ 2: R_ARM_THM_ALU_ABS_G2_NC bar
12+0[0-9a-f]+ <[^>]+> 2000 movs r0, #0
13+ 4: R_ARM_THM_ALU_ABS_G1_NC bar
14+0[0-9a-f]+ <[^>]+> 2000 movs r0, #0
15+ 6: R_ARM_THM_ALU_ABS_G0_NC bar
16+#...
--- /dev/null
+++ b/gas/testsuite/gas/arm/movs-thumb1-reloc-local.s
@@ -0,0 +1,13 @@
1+.arch armv6s-m
2+.text
3+.syntax unified
4+.thumb
5+foo:
6+movs r0, #:upper8_15:#bar
7+movs r0, #:upper0_7:#bar
8+movs r0, #:lower8_15:#bar
9+movs r0, #:lower0_7:#bar
10+
11+.space 0x10000
12+
13+bar:
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
1+2015-12-15 Yao Qi <yao.qi@linaro.org>
2+
3+ * gdb.trace/ftrace.exp: Set arg0exp to "$x0" if target
4+ is aarch64*-*-*.
5+
16 2015-12-14 Sandra Loosemore <sandra@codesourcery.com>
27
38 * gdb.base/history-duplicates.exp: Skip if no readline support.
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -243,6 +243,8 @@ if [is_amd64_regs_target] {
243243 set arg0exp "\$rdi"
244244 } elseif [is_x86_like_target] {
245245 set arg0exp "*(int *) (\$ebp + 8)"
246+} elseif { [istarget "aarch64*-*-*"] } {
247+ set arg0exp "\$x0"
246248 } else {
247249 set arg0exp ""
248250 }
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -230,6 +230,11 @@ START_RELOC_NUMBERS (elf_arm_reloc_type)
230230 RELOC_NUMBER (R_ARM_ME_TOO, 128) /* obsolete */
231231 RELOC_NUMBER (R_ARM_THM_TLS_DESCSEQ ,129)
232232
233+ RELOC_NUMBER (R_ARM_THM_ALU_ABS_G0_NC,132)
234+ RELOC_NUMBER (R_ARM_THM_ALU_ABS_G1_NC,133)
235+ RELOC_NUMBER (R_ARM_THM_ALU_ABS_G2_NC,134)
236+ RELOC_NUMBER (R_ARM_THM_ALU_ABS_G3_NC,135)
237+
233238 RELOC_NUMBER (R_ARM_IRELATIVE, 160)
234239
235240 /* Extensions? R=read-only? */
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,9 @@
1+2015-12-15 Matthew Wahab <matthew.wahab@arm.com>
2+
3+ * arm.h (ARM_ARCH_V8_1A): Add the CRC_EXT_ARMV8 co-processor
4+ feature macro.
5+ (ARM_ARCH_V8_2A): Likewise.
6+
17 2015-12-14 Matthew Wahab <matthew.wahab@arm.com>
28
39 * aarch64.h (enum aarch64_opnd_qualifier): Add
--- a/include/opcode/arm.h
+++ b/include/opcode/arm.h
@@ -251,9 +251,11 @@
251251 #define ARM_ARCH_V7M ARM_FEATURE_CORE_LOW (ARM_AEXT_V7M)
252252 #define ARM_ARCH_V7EM ARM_FEATURE_CORE_LOW (ARM_AEXT_V7EM)
253253 #define ARM_ARCH_V8A ARM_FEATURE_CORE_LOW (ARM_AEXT_V8A)
254-#define ARM_ARCH_V8_1A ARM_FEATURE_CORE (ARM_AEXT_V8A, ARM_EXT2_PAN)
255-#define ARM_ARCH_V8_2A ARM_FEATURE_CORE (ARM_AEXT_V8A, \
256- ARM_EXT2_PAN | ARM_EXT2_V8_2A)
254+#define ARM_ARCH_V8_1A ARM_FEATURE (ARM_AEXT_V8A, ARM_EXT2_PAN, \
255+ CRC_EXT_ARMV8)
256+#define ARM_ARCH_V8_2A ARM_FEATURE (ARM_AEXT_V8A, \
257+ ARM_EXT2_PAN | ARM_EXT2_V8_2A, \
258+ CRC_EXT_ARMV8)
257259
258260 /* Some useful combinations: */
259261 #define ARM_ARCH_NONE ARM_FEATURE_LOW (0, 0)
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -223,6 +223,12 @@ set armelftests_common {
223223 "" {pcrel-shared.s}
224224 {{readelf -dr pcrel-shared.rd}}
225225 "pcrel-shared.so"}
226+ {"MOVS thumb1 relocations" "-static -T arm.ld" "" "" {thumb1-movs.s}
227+ {{objdump -dw thumb1-movs.d}}
228+ "thumb1-movs"}
229+ {"ADDS thumb1 relocations" "-static -T arm.ld" "" "" {thumb1-adds.s}
230+ {{objdump -dw thumb1-adds.d}}
231+ "thumb1-adds"}
226232 }
227233
228234 set armelftests_nonacl {
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb1-adds.d
@@ -0,0 +1,38 @@
1+
2+.*: file format.*
3+
4+Disassembly of section .text:
5+
6+00008000 <[^>]*>:
7+ 8000: 3012 adds r0, #18
8+ 8002: 3134 adds r1, #52 ; 0x34
9+ 8004: 3280 adds r2, #128 ; 0x80
10+ 8006: 3301 adds r3, #1
11+ 8008: 3401 adds r4, #1
12+ 800a: 3500 adds r5, #0
13+ 800c: 3600 adds r6, #0
14+ 800e: 3700 adds r7, #0
15+
16+00008010 <[^>]*>:
17+ 8010: 3012 adds r0, #18
18+ 8012: 3100 adds r1, #0
19+ 8014: 3200 adds r2, #0
20+ 8016: 33ca adds r3, #202 ; 0xca
21+ 8018: 3700 adds r7, #0
22+ 801a: 3634 adds r6, #52 ; 0x34
23+ 801c: 3581 adds r5, #129 ; 0x81
24+ 801e: 3423 adds r4, #35 ; 0x23
25+
26+00008020 <[^>]*>:
27+ 8020: 01 .byte 0x01
28+
29+00008021 <[^>]*>:
30+ 8021: 02 .byte 0x02
31+
32+Disassembly of section .far:
33+
34+12340000 <[^>]*>:
35+12340000: 3000 adds r0, #0
36+12340002: 3100 adds r1, #0
37+12340004: 3200 adds r2, #0
38+12340006: 3301 adds r3, #1
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb1-adds.s
@@ -0,0 +1,43 @@
1+ .text
2+ .arch armv6s-m
3+ .syntax unified
4+ .global _start
5+ .thumb_func
6+ .type _start, %function
7+_start:
8+ .thumb_func
9+ .type thumb1, %function
10+thumb1:
11+ adds r0, #:upper8_15:#thumb3
12+ adds r1, #:upper0_7:#thumb3
13+ adds r2, #:lower8_15:#thumb1
14+ adds r3, #:lower0_7:#thumb1
15+ adds r4, #:lower0_7:#thumb3
16+ adds r5, #:lower8_15:#thumb3
17+ adds r6, #:upper0_7:#thumb1
18+ adds r7, #:upper8_15:#thumb1
19+ .thumb_func
20+ .type thumb2, %function
21+thumb2:
22+ adds r0, #:upper8_15:#thumb3
23+ adds r1, #:upper0_7:#(var2 + 1)
24+ adds r2, #:lower8_15:#(thumb3 + 255)
25+ adds r3, #:lower0_7:#(var1 + 0xaa)
26+ adds r7, #:upper8_15:#var1 + 4
27+ adds r6, #:upper0_7:#thumb3
28+ adds r5, #:lower8_15:#var2 + 0xff
29+ adds r4, #:lower0_7:#var2 - (-2)
30+var1:
31+ .byte 1
32+var2:
33+ .byte 2
34+
35+ .section .far, "ax", %progbits
36+ .thumb_func
37+ .type thumb3, %function
38+thumb3:
39+ adds r0, #:upper8_15:#thumb1
40+ adds r1, #:upper0_7:#thumb2
41+ adds r2, #:lower8_15:#thumb3
42+ adds r3, #:lower0_7:#thumb1
43+
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb1-movs.d
@@ -0,0 +1,38 @@
1+
2+.*: file format.*
3+
4+Disassembly of section .text:
5+
6+00008000 <[^>]*>:
7+ 8000: 2012 movs r0, #18
8+ 8002: 2134 movs r1, #52 ; 0x34
9+ 8004: 2280 movs r2, #128 ; 0x80
10+ 8006: 2301 movs r3, #1
11+ 8008: 2401 movs r4, #1
12+ 800a: 2500 movs r5, #0
13+ 800c: 2600 movs r6, #0
14+ 800e: 2700 movs r7, #0
15+
16+00008010 <[^>]*>:
17+ 8010: 2012 movs r0, #18
18+ 8012: 2100 movs r1, #0
19+ 8014: 2281 movs r2, #129 ; 0x81
20+ 8016: 2320 movs r3, #32
21+ 8018: 2700 movs r7, #0
22+ 801a: 2600 movs r6, #0
23+ 801c: 2581 movs r5, #129 ; 0x81
24+ 801e: 2422 movs r4, #34 ; 0x22
25+
26+00008020 <[^>]*>:
27+ 8020: 01 .byte 0x01
28+
29+00008021 <[^>]*>:
30+ 8021: 02 .byte 0x02
31+
32+Disassembly of section .far:
33+
34+12340000 <[^>]*>:
35+12340000: 2000 movs r0, #0
36+12340002: 2100 movs r1, #0
37+12340004: 2200 movs r2, #0
38+12340006: 2301 movs r3, #1
--- /dev/null
+++ b/ld/testsuite/ld-arm/thumb1-movs.s
@@ -0,0 +1,43 @@
1+ .text
2+ .arch armv6s-m
3+ .syntax unified
4+ .global _start
5+ .thumb_func
6+ .type _start, %function
7+_start:
8+ .thumb_func
9+ .type thumb1, %function
10+thumb1:
11+ movs r0, #:upper8_15:#thumb3
12+ movs r1, #:upper0_7:#thumb3
13+ movs r2, #:lower8_15:#thumb1
14+ movs r3, #:lower0_7:#thumb1
15+ movs r4, #:lower0_7:#thumb3
16+ movs r5, #:lower8_15:#thumb3
17+ movs r6, #:upper0_7:#thumb1
18+ movs r7, #:upper8_15:#thumb1
19+ .thumb_func
20+ .type thumb2, %function
21+thumb2:
22+ movs r0, #:upper8_15:#(thumb3 + 0)
23+ movs r1, #:upper0_7:#(thumb2 + 1)
24+ movs r2, #:lower8_15:#(var1 + 255)
25+ movs r3, #:lower0_7:#var1
26+ movs r7, #:upper8_15:#var1 + 4
27+ movs r6, #:upper0_7:#var2
28+ movs r5, #:lower8_15:#var2 + 0xff
29+ movs r4, #:lower0_7:#var2 - (-1)
30+var1:
31+ .byte 1
32+var2:
33+ .byte 2
34+
35+ .section .far, "ax", %progbits
36+ .thumb_func
37+ .type thumb3, %function
38+thumb3:
39+ movs r0, #:upper8_15:#thumb1
40+ movs r1, #:upper0_7:#thumb2
41+ movs r2, #:lower8_15:#thumb3
42+ movs r3, #:lower0_7:#thumb1
43+