bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24992] RISC-V: partial relaxing against global pointer with sdat


From: yitingwang16 at outlook dot com
Subject: [Bug ld/24992] RISC-V: partial relaxing against global pointer with sdata section alignment
Date: Mon, 16 Sep 2019 09:41:50 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24992

--- Comment #5 from Yiting Wang <yitingwang16 at outlook dot com> ---
But if I remove the first line of test.c and change the default linker scripts
to

  .sdata ALIGN(0x1000)   :
  {
    __global_pointer$ = . + 0x800;
    *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2)
*(.srodata .srodata.*)
    *(.sdata .sdata.* .gnu.linkonce.s.*)
  }

The sdata section is aligned at 0x1000 and this time gp relaxation works. 

Disassembly of section .text:

00000000000100e8 <main>:
   100e8:     1141                    addi    sp,sp,-16
   100ea:     e422                    sd      s0,8(sp)
   100ec:     0800                    addi    s0,sp,16
   100ee:     67c5                    lui     a5,0x11
   100f0:     0007a703                lw      a4,0(a5) # 11000 <a>
   100f4:     67c5                    lui     a5,0x11
   100f6:     0047a783                lw      a5,4(a5) # 11004 <b>
   100fa:     9fb9                    addw    a5,a5,a4
   100fc:     0007871b                sext.w  a4,a5
   10100:     8081a783                lw      a5,-2040(gp) # 11008 <c>
   10104:     9fb9                    addw    a5,a5,a4
   10106:     0007871b                sext.w  a4,a5
   1010a:     80c1a783                lw      a5,-2036(gp) # 1100c <d>
   1010e:     9fb9                    addw    a5,a5,a4
   10110:     0007871b                sext.w  a4,a5
   10114:     8101a783                lw      a5,-2032(gp) # 11010 <e>
   10118:     9fb9                    addw    a5,a5,a4
   1011a:     2781                    sext.w  a5,a5
   1011c:     853e                    mv      a0,a5
   1011e:     6422                    ld      s0,8(sp)
   10120:     0141                    addi    sp,sp,16
   10122:     8082                    ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]