This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/3] Fix DW_CFA_advance_loc relocation.
- From: Palmer Dabbelt <palmer at dabbelt dot com>
- To: binutils at sourceware dot org
- Cc: Kuan-Lin Chen <rufus at andestech dot com>
- Date: Mon, 13 Mar 2017 14:47:52 -0700
- Subject: [PATCH 2/3] Fix DW_CFA_advance_loc relocation.
- Authentication-results: sourceware.org; auth=none
- References: <20170313214753.4477-1-palmer@dabbelt.com>
From: Kuan-Lin Chen <rufus@andestech.com>
gas/ChangeLog:
2017-03-02 Kuan-Lin Chen <rufus@andestech.com>
* config/tc-riscv.c (md_apply_fix): Set fx_frag and
fx_next->fx_frag for CFA_advance_loc relocations.
---
gas/ChangeLog | 5 +++++
gas/config/tc-riscv.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4d638b4..1478cdf 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2017-03-02 Kuan-Lin Chen <rufus@andestech.com>
+ * config/tc-riscv.c (md_apply_fix): Set fx_frag and
+ fx_next->fx_frag for CFA_advance_loc relocations.
+
+2017-03-02 Kuan-Lin Chen <rufus@andestech.com>
+
* config/tc-riscv.c (md_apply_fix): Compute the correct offsets
for CFA relocations.
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 3744e84..723ccba 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -1966,6 +1966,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
if (subtype < 0x80 && (subtype & 0x40))
{
/* DW_CFA_advance_loc */
+ fixP->fx_frag = (fragS *) fixP->fx_frag->fr_opcode;
+ fixP->fx_next->fx_frag = fixP->fx_frag;
fixP->fx_r_type = BFD_RELOC_RISCV_SET6;
fixP->fx_next->fx_r_type = BFD_RELOC_RISCV_SUB6;
}
--
2.10.2