This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_28-branch] RISC-V: Fix DW_CFA_advance_loc relocation.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4fc0b698948d38d317913bd9c9452648b304710d

commit 4fc0b698948d38d317913bd9c9452648b304710d
Author: Kuan-Lin Chen <rufus@andestech.com>
Date:   Fri Feb 10 14:58:52 2017 +0800

    RISC-V: Fix DW_CFA_advance_loc relocation.
    
    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.

Diff:
---
 gas/ChangeLog         | 5 +++++
 gas/config/tc-riscv.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 50a7303..465ad9f 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 c79f313..4d28042 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -1956,6 +1956,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;
 		    }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]