bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/24676] New: [RISCV] Redundant R_RISCV_DTPMOD* R_RISCV_DTPREL* re


From: maskray at google dot com
Subject: [Bug ld/24676] New: [RISCV] Redundant R_RISCV_DTPMOD* R_RISCV_DTPREL* resulted from Glocal Dynamic -> Local Exec relaxation
Date: Thu, 13 Jun 2019 07:02:16 +0000

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

            Bug ID: 24676
           Summary: [RISCV] Redundant R_RISCV_DTPMOD* R_RISCV_DTPREL*
                    resulted from Glocal Dynamic -> Local Exec relaxation
           Product: binutils
           Version: 2.33 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: maskray at google dot com
  Target Milestone: ---

RISC-V psABI doesn't specify TLS relaxation. Though the code sequences are not
relaxed, dynamic relocations should be omitted for GD->LE relaxation.

% cat a.s
la.tls.gd a0,a
call __tls_get_addr@plt

la.tls.gd a0,b
call __tls_get_addr@plt

.section .tbss
.globl a
a:
.zero 4

% cat b.s
.section .tbss
.globl b
b:
.zero 4


riscv-gcc -fuse-ld=bfd-nostdlib b.s -shared -o b.so
riscv-gcc -fuse-ld=bfd -nostdlib a.s b.so -o a -Wl,--defsym=__tls_get_addr=0
readelf -Wr a

## DTPMOD32/DTPREL32 of a are redundant because a is non-preemptable
0001122c  00000106 R_RISCV_TLS_DTPMOD32   00000000   b + 0
00011230  00000108 R_RISCV_TLS_DTPREL32   00000000   b + 0
00011234  00000206 R_RISCV_TLS_DTPMOD32   00000000   a + 0
00011238  00000208 R_RISCV_TLS_DTPREL32   00000000   a + 0

-- 
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]