aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-02-20 23:35:21 +1030
committerAlan Modra <amodra@gmail.com>2020-02-21 10:47:05 +1030
commit10a95fcc1f8fb621dfc82b1097336cc58a3574f5 (patch)
treefc077d6886c9c078aa8643a97a5bd45e26c16814
parentdda2980f54a0c9437de047f3020f520dd1e0de6a (diff)
downloadgdb-10a95fcc1f8fb621dfc82b1097336cc58a3574f5.zip
gdb-10a95fcc1f8fb621dfc82b1097336cc58a3574f5.tar.gz
gdb-10a95fcc1f8fb621dfc82b1097336cc58a3574f5.tar.bz2
pdp11 reloc processing
This allows pdp11 to handle 32-bit fixups that can be applied by gas, and improves the error message emitted when the required reloc isn't available. * config/tc-pdp11.c (md_apply_fix): Handle BFD_RELOC_32. (tc_gen_reloc): Only give a BAD_CASE assertion on pcrel relocs.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-pdp11.c30
2 files changed, 22 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4bc78e9..01cce9f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2020-02-21 Alan Modra <amodra@gmail.com>
+ * config/tc-pdp11.c (md_apply_fix): Handle BFD_RELOC_32.
+ (tc_gen_reloc): Only give a BAD_CASE assertion on pcrel relocs.
+
+2020-02-21 Alan Modra <amodra@gmail.com>
+
PR 25569
* config/obj-aout.c (obj_aout_frob_file_before_fix): Don't loop
on section size adjustment, instead perform another write if
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c
index 7b3f663..d38a3cd 100644
--- a/gas/config/tc-pdp11.c
+++ b/gas/config/tc-pdp11.c
@@ -257,6 +257,10 @@ md_apply_fix (fixS *fixP,
mask = 0xffff;
shift = 0;
break;
+ case BFD_RELOC_32:
+ mask = 0xffffffff;
+ shift = 0;
+ break;
case BFD_RELOC_PDP11_DISP_8_PCREL:
mask = 0x00ff;
shift = 1;
@@ -1419,22 +1423,22 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
/* This is taken account for in md_apply_fix(). */
reloc->addend = -symbol_get_bfdsym (fixp->fx_addsy)->section->vma;
- switch (fixp->fx_r_type)
+ code = fixp->fx_r_type;
+ if (fixp->fx_pcrel)
{
- case BFD_RELOC_16:
- if (fixp->fx_pcrel)
- code = BFD_RELOC_16_PCREL;
- else
- code = BFD_RELOC_16;
- break;
+ switch (code)
+ {
+ case BFD_RELOC_16:
+ code = BFD_RELOC_16_PCREL;
+ break;
- case BFD_RELOC_16_PCREL:
- code = BFD_RELOC_16_PCREL;
- break;
+ case BFD_RELOC_16_PCREL:
+ break;
- default:
- BAD_CASE (fixp->fx_r_type);
- return NULL;
+ default:
+ BAD_CASE (code);
+ return NULL;
+ }
}
reloc->howto = bfd_reloc_type_lookup (stdoutput, code);