This patch enables disassembler_needs_relocs for PRU. It is needed to print correct...
authorDimitar Dimitrov <dimitar@dinux.eu>
Wed, 13 Dec 2017 13:08:50 +0000 (13:08 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 13 Dec 2017 13:09:59 +0000 (13:09 +0000)
opcodes * disassemble.c: Enable disassembler_needs_relocs for PRU.

gas * testsuite/gas/pru/extern.s: New test for print of U16_PMEMM
relocation.
* testsuite/gas/pru/extern.d: New test driver.

gas/ChangeLog
gas/testsuite/gas/pru/extern.d [new file with mode: 0644]
gas/testsuite/gas/pru/extern.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/disassemble.c

index 99cd42582ebcb7a72d7245f2920f26cdd8e88392..dcc4cb8ea976a4dee36409e147e6dee57218752b 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-13  Dimitar Dimitrov  <dimitar@dinux.eu>
+
+       * testsuite/gas/pru/extern.s: New test for print of U16_PMEMM
+       relocation.
+       * testsuite/gas/pru/extern.d: New test driver.
+
 2017-12-12  Alan Modra  <amodra@gmail.com>
 
        PR 21118
diff --git a/gas/testsuite/gas/pru/extern.d b/gas/testsuite/gas/pru/extern.d
new file mode 100644 (file)
index 0000000..e06f758
--- /dev/null
@@ -0,0 +1,10 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: PRU extern function call dump
+
+# Test dumping of U16_PMEMIMM relocation
+
+.*: +file format elf32-pru
+
+Disassembly of section .text:
+0+0000 <[^>]*> 230000c3        call    00000000 <myextfunc>
+[\t ]*0: R_PRU_U16_PMEMIMM[\t ]*myextfunc
diff --git a/gas/testsuite/gas/pru/extern.s b/gas/testsuite/gas/pru/extern.s
new file mode 100644 (file)
index 0000000..87380df
--- /dev/null
@@ -0,0 +1,5 @@
+# Source file used to test text dump of U16_PMEMIMM relocation
+
+       .extern myextfunc
+foo:
+       call    myextfunc
index 7751ef27b1440a8a7bec466cdafcc36238a44a27..5e8ad9f7237a294df2252aa5e2ec9f2c95f83b23 100644 (file)
@@ -1,3 +1,7 @@
+2017-12-13  Dimitar Dimitrov  <dimitar@dinux.eu>
+
+       * disassemble.c: Enable disassembler_needs_relocs for PRU.
+
 2017-12-11  Petr Pavlu  <petr.pavlu@arm.com>
            Renlin Li  <renlin.li@arm.com>
 
index 11206c67a5f2ce843e2cbcd558d045ca0d17fd63..fa9a7653541b8aef81fcbc75b453297b41a51712 100644 (file)
@@ -654,6 +654,11 @@ disassemble_init_for_target (struct disassemble_info * info)
 #ifdef ARCH_powerpc
     case bfd_arch_powerpc:
 #endif
+#ifdef ARCH_pru
+    case bfd_arch_pru:
+      info->disassembler_needs_relocs = TRUE;
+      break;
+#endif
 #ifdef ARCH_rs6000
     case bfd_arch_rs6000:
 #endif