diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index f550d9e042f4962e0d7c23eae40978610141e77b..5c0a8067168c2f9e0330f8b5c8c2f80c560c058c 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -6689,21 +6689,6 @@ bad_adrdp: case pcreladdr: gas_assert (operands[i] == AARCH64_OPND_ADDR_PCREL21); inst.reloc.type = BFD_RELOC_AARCH64_ADR_LO21_PCREL; - if (inst.reloc.exp.X_op == O_symbol - && inst.reloc.exp.X_add_symbol != NULL) - { - symbolS *sym = inst.reloc.exp.X_add_symbol; - - /* We set LSB for C64 local functions. We do not do - this for local labels even in code section because - it could be embedded data. */ - if (S_IS_DEFINED (sym) && AARCH64_IS_C64 (sym) - && (symbol_get_bfdsym (sym)->flags & BSF_FUNCTION)) - { - inst.reloc.exp.X_add_number += 1; - } - } - break; default: gas_assert (0); diff --git a/gas/testsuite/gas/aarch64/morello-lsb-relocs.d b/gas/testsuite/gas/aarch64/morello-lsb-relocs.d index 226801b23a8a9061d466dbfcdc220b9eb279a25e..4fc9f8674175cd1c826053fcb20690e91914128f 100644 --- a/gas/testsuite/gas/aarch64/morello-lsb-relocs.d +++ b/gas/testsuite/gas/aarch64/morello-lsb-relocs.d @@ -20,27 +20,33 @@ Disassembly of section \.text: \.\.\. 000000000000000c : - c: 14000000 b 0 - c: R_MORELLO_JUMP26 x - 10: 14000000 b c - 10: R_MORELLO_JUMP26 f - 14: 17fffffe b c - 18: 17fffffd b c - 1c: 5400000d b\.le 0 - 1c: R_MORELLO_CONDBR19 x - 20: 5400000d b\.le c - 20: R_MORELLO_CONDBR19 f - 24: 54ffff4d b\.le c - 28: 54ffff2d b\.le c - 2c: 36080001 tbz w1, #1, 0 - 2c: R_MORELLO_TSTBR14 x - 30: 36080001 tbz w1, #1, c - 30: R_MORELLO_TSTBR14 f - 34: 360ffec1 tbz w1, #1, c - 38: 360ffea1 tbz w1, #1, c - 3c: 94000000 bl 0 - 3c: R_MORELLO_CALL26 x - 40: 94000000 bl c - 40: R_MORELLO_CALL26 f - 44: 97fffff2 bl c - 48: 97fffff1 bl c + c: 10000000 adr c0, 0 + c: R_AARCH64_ADR_PREL_LO21 x + 10: 10000000 adr c0, c + 10: R_AARCH64_ADR_PREL_LO21 f + 14: 30ffffc0 adr c0, d + 18: 10ffffa0 adr c0, c + 1c: 14000000 b 0 + 1c: R_MORELLO_JUMP26 x + 20: 14000000 b c + 20: R_MORELLO_JUMP26 f + 24: 17fffffa b c + 28: 17fffff9 b c + 2c: 5400000d b\.le 0 + 2c: R_MORELLO_CONDBR19 x + 30: 5400000d b\.le c + 30: R_MORELLO_CONDBR19 f + 34: 54fffecd b\.le c + 38: 54fffead b\.le c + 3c: 36080001 tbz w1, #1, 0 + 3c: R_MORELLO_TSTBR14 x + 40: 36080001 tbz w1, #1, c + 40: R_MORELLO_TSTBR14 f + 44: 360ffe41 tbz w1, #1, c + 48: 360ffe21 tbz w1, #1, c + 4c: 94000000 bl 0 + 4c: R_MORELLO_CALL26 x + 50: 94000000 bl c + 50: R_MORELLO_CALL26 f + 54: 97ffffee bl c + 58: 97ffffed bl c diff --git a/gas/testsuite/gas/aarch64/morello-lsb-relocs.s b/gas/testsuite/gas/aarch64/morello-lsb-relocs.s index 227b023e220386e4630e869ca4f62e7b4e7ff410..26e498f59d07978a9d26384bfa92db3738837cd8 100644 --- a/gas/testsuite/gas/aarch64/morello-lsb-relocs.s +++ b/gas/testsuite/gas/aarch64/morello-lsb-relocs.s @@ -14,6 +14,11 @@ a: // This function is local, so the relocation on the ADR // instruction will be relaxed to a value. altlabel: // This label does not have function type, so will not have the // LSB set. + adr c0, x + adr c0, f + adr c0, a // Local C64 function on instruction that does not + // ignore LSB so we the LSB included in the output. + adr c0, altlabel b x b f b a diff --git a/gas/testsuite/gas/aarch64/morello-lsb-relocs2.d b/gas/testsuite/gas/aarch64/morello-lsb-relocs2.d index aa99c58a70c4e1a104525fef1d8eb997a346ad06..2b9386954fde61eb595e20fef42b1be94b989610 100644 --- a/gas/testsuite/gas/aarch64/morello-lsb-relocs2.d +++ b/gas/testsuite/gas/aarch64/morello-lsb-relocs2.d @@ -3,16 +3,18 @@ #source: morello-lsb-relocs.s -Relocation section '\.rela\.text' at offset 0x198 contains 8 entries: +Relocation section '\.rela\.text' at offset 0x1a8 contains 10 entries: Offset Info Type Sym\. Value Sym\. Name \+ Addend -00000000000c 00090000e002 R_MORELLO_JUMP26 0000000000000000 x \+ 0 -000000000010 00080000e002 R_MORELLO_JUMP26 000000000000000d f \+ 0 -00000000001c 00090000e001 R_MORELLO_CONDBR1 0000000000000000 x \+ 0 -000000000020 00080000e001 R_MORELLO_CONDBR1 000000000000000d f \+ 0 -00000000002c 00090000e000 R_MORELLO_TSTBR14 0000000000000000 x \+ 0 -000000000030 00080000e000 R_MORELLO_TSTBR14 000000000000000d f \+ 0 -00000000003c 00090000e003 R_MORELLO_CALL26 0000000000000000 x \+ 0 -000000000040 00080000e003 R_MORELLO_CALL26 000000000000000d f \+ 0 +00000000000c 000900000112 R_AARCH64_ADR_PRE 0000000000000000 x \+ 0 +000000000010 000800000112 R_AARCH64_ADR_PRE 000000000000000d f \+ 0 +00000000001c 00090000e002 R_MORELLO_JUMP26 0000000000000000 x \+ 0 +000000000020 00080000e002 R_MORELLO_JUMP26 000000000000000d f \+ 0 +00000000002c 00090000e001 R_MORELLO_CONDBR1 0000000000000000 x \+ 0 +000000000030 00080000e001 R_MORELLO_CONDBR1 000000000000000d f \+ 0 +00000000003c 00090000e000 R_MORELLO_TSTBR14 0000000000000000 x \+ 0 +000000000040 00080000e000 R_MORELLO_TSTBR14 000000000000000d f \+ 0 +00000000004c 00090000e003 R_MORELLO_CALL26 0000000000000000 x \+ 0 +000000000050 00080000e003 R_MORELLO_CALL26 000000000000000d f \+ 0 Symbol table '\.symtab' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name