* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
@ 2015-01-20 19:18 ` vhaisman at gmail dot com
2020-03-26 22:03 ` wilson at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vhaisman at gmail dot com @ 2015-01-20 19:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #2 from Václav Zeman <vhaisman at gmail dot com> ---
Created attachment 34504
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34504&action=edit
def.cxx
>From gcc-bugs-return-474104-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jan 20 19:18:10 2015
Return-Path: <gcc-bugs-return-474104-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24361 invoked by alias); 20 Jan 2015 19:18:09 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24330 invoked by uid 48); 20 Jan 2015 19:18:05 -0000
From: "vhaisman at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
Date: Tue, 20 Jan 2015 19:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vhaisman at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-64697-4-diTCVTiUH8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64697-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64697-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-01/txt/msg02098.txt.bz2
Content-length: 232
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #1 from Václav Zeman <vhaisman at gmail dot com> ---
Created attachment 34503
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34503&action=edit
def.hxx
>From gcc-bugs-return-474106-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jan 20 19:19:11 2015
Return-Path: <gcc-bugs-return-474106-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25899 invoked by alias); 20 Jan 2015 19:19:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25841 invoked by uid 48); 20 Jan 2015 19:19:01 -0000
From: "vhaisman at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
Date: Tue, 20 Jan 2015 19:19:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vhaisman at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-64697-4-QP94a8ZHzv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64697-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64697-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-01/txt/msg02100.txt.bz2
Content-length: 232
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #3 from Václav Zeman <vhaisman at gmail dot com> ---
Created attachment 34505
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34505&action=edit
use.cxx
>From gcc-bugs-return-474107-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jan 20 19:21:25 2015
Return-Path: <gcc-bugs-return-474107-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27743 invoked by alias); 20 Jan 2015 19:21:23 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 27209 invoked by uid 48); 20 Jan 2015 19:21:16 -0000
From: "jiwang at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64669] [5 Regression] aarch64-linux profiledbootstrap failure
Date: Tue, 20 Jan 2015 19:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jiwang at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jiwang at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-64669-4-dWCY3usWQ8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64669-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64669-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-01/txt/msg02101.txt.bz2
Content-length: 746
https://gcc.gnu.org/bugzilla/show_bug.cgi?idd669
--- Comment #10 from Jiong Wang <jiwang at gcc dot gnu.org> ---
(In reply to Richard Henderson from comment #8)
> Indeed, if I force used_in_cond_stmt_p to return false, which forces
> the use of the emit_cstore path, which means we return a proper
> boolean value instead of a CCmode value, the test case doesn't ICE.
>
> Moreover, combine does in fact remove the redundant compare and we
> are left with
>
> cmp w0, 39
> ccmp w0, 10, 4, ne
> bne .L19
>
> I think I was wrong to approve the ccmp patch with the used_in_cond_stmt_p
> logic in the first place, and that it should all be removed.
Richard, will you send out the patch? I could help testing
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
2015-01-20 19:18 ` [Bug c++/64697] " vhaisman at gmail dot com
@ 2020-03-26 22:03 ` wilson at gcc dot gnu.org
2020-03-26 23:02 ` vhaisman at gmail dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: wilson at gcc dot gnu.org @ 2020-03-26 22:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
Jim Wilson <wilson at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wilson at gcc dot gnu.org
--- Comment #22 from Jim Wilson <wilson at gcc dot gnu.org> ---
This looks like a binutils bug to me. A call to an undefined weak function
should never be executed, so it is OK for the linker to convert that call
instruction into anything convenient. There is no need for a relocation that
can reach an address of zero. We can convert the call instruction to call
itself, or the next instruction, or change it to a nop, what ever is
convenient, it doesn't really matter.
A number of binutils ports already have code to handle related problems. ARM
and RISC-V for sure. Probably others. It looks like this support is missing
from the x86_64 port. I'd suggest refiling this as a binutils bug. See for
instance
https://sourceware.org/bugzilla/show_bug.cgi?id=23244
for a RISC-V example of the same problem. But we need a new bug for the x86_64
problem. RISC-V has a register hard wired to zero, so I rewrite the call
instruction to use x0 as the base address. The arm port turns the call into a
nop.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
2015-01-20 19:18 ` [Bug c++/64697] " vhaisman at gmail dot com
2020-03-26 22:03 ` wilson at gcc dot gnu.org
@ 2020-03-26 23:02 ` vhaisman at gmail dot com
2020-03-26 23:06 ` wilson at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vhaisman at gmail dot com @ 2020-03-26 23:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #23 from Václav Haisman <vhaisman at gmail dot com> ---
I am not sure what to report. I do not understand the background of linker and
relocations enough. Also, I don't have access to Windows and Cygwin any more.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
` (2 preceding siblings ...)
2020-03-26 23:02 ` vhaisman at gmail dot com
@ 2020-03-26 23:06 ` wilson at gcc dot gnu.org
2021-10-01 8:56 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: wilson at gcc dot gnu.org @ 2020-03-26 23:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #24 from Jim Wilson <wilson at gcc dot gnu.org> ---
Joel Sherrill offered to create a binutils bug report for this.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
` (3 preceding siblings ...)
2020-03-26 23:06 ` wilson at gcc dot gnu.org
@ 2021-10-01 8:56 ` cvs-commit at gcc dot gnu.org
2021-10-01 8:59 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-01 8:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #25 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:021ad8e5cf9ab66e1a0a41dce3a54586facb86e0
commit r12-4036-g021ad8e5cf9ab66e1a0a41dce3a54586facb86e0
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 1 10:49:34 2021 +0200
Fix PR c++/64697 at -O1 or above
The BFD fix eliminates the link failure and working code is generated at
-O0, but _not_ when optimization is enabled because the optimizer changes:
movq .refptr._ZTH1s(%rip), %rax
testq %rax, %rax
je .L2
call _ZTH1s
into:
leaq _ZTH1s(%rip), %rax
testq %rax, %rax
je .L2
call _ZTH1s
and the leaq now also gets the relocation overflow. So the fix is to
teach legitimate_pic_address_disp_p to reject the transformation when
the symbol is an external weak function, which yields:
cmpq $0, .refptr._ZTH1s(%rip)
je .L2
call _ZTH1s
and the cmpq keeps a relocation that does not overflow.
gcc/
PR c++/64697
* config/i386/i386.c (legitimate_pic_address_disp_p): For PE-COFF
do
not return true for external weak function symbols in medium model.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
` (4 preceding siblings ...)
2021-10-01 8:56 ` cvs-commit at gcc dot gnu.org
@ 2021-10-01 8:59 ` cvs-commit at gcc dot gnu.org
2021-10-01 9:02 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-01 8:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #26 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:618b7cb3b3fb4d2d92434d31ea8b6746ffef2572
commit r11-9049-g618b7cb3b3fb4d2d92434d31ea8b6746ffef2572
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 1 10:49:34 2021 +0200
Fix PR c++/64697 at -O1 or above
The BFD fix eliminates the link failure and working code is generated at
-O0, but _not_ when optimization is enabled because the optimizer changes:
movq .refptr._ZTH1s(%rip), %rax
testq %rax, %rax
je .L2
call _ZTH1s
into:
leaq _ZTH1s(%rip), %rax
testq %rax, %rax
je .L2
call _ZTH1s
and the leaq now also gets the relocation overflow. So the fix is to
teach legitimate_pic_address_disp_p to reject the transformation when
the symbol is an external weak function, which yields:
cmpq $0, .refptr._ZTH1s(%rip)
je .L2
call _ZTH1s
and the cmpq keeps a relocation that does not overflow.
gcc/
PR c++/64697
* config/i386/i386.c (legitimate_pic_address_disp_p): For PE-COFF
do
not return true for external weak function symbols in medium model.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
` (5 preceding siblings ...)
2021-10-01 8:59 ` cvs-commit at gcc dot gnu.org
@ 2021-10-01 9:02 ` cvs-commit at gcc dot gnu.org
2021-10-01 9:05 ` ebotcazou at gcc dot gnu.org
2022-10-14 10:31 ` ebotcazou at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-01 9:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
--- Comment #27 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:48e24ff39b16c072cd58bdad1a5668794453af5f
commit r10-10158-g48e24ff39b16c072cd58bdad1a5668794453af5f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Oct 1 10:49:34 2021 +0200
Fix PR c++/64697 at -O1 or above
The BFD fix eliminates the link failure and working code is generated at
-O0, but _not_ when optimization is enabled because the optimizer changes:
movq .refptr._ZTH1s(%rip), %rax
testq %rax, %rax
je .L2
call _ZTH1s
into:
leaq _ZTH1s(%rip), %rax
testq %rax, %rax
je .L2
call _ZTH1s
and the leaq now also gets the relocation overflow. So the fix is to
teach legitimate_pic_address_disp_p to reject the transformation when
the symbol is an external weak function, which yields:
cmpq $0, .refptr._ZTH1s(%rip)
je .L2
call _ZTH1s
and the cmpq keeps a relocation that does not overflow.
gcc/
PR c++/64697
* config/i386/i386.c (legitimate_pic_address_disp_p): For PE-COFF
do
not return true for external weak function symbols in medium model.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
` (6 preceding siblings ...)
2021-10-01 9:02 ` cvs-commit at gcc dot gnu.org
@ 2021-10-01 9:05 ` ebotcazou at gcc dot gnu.org
2022-10-14 10:31 ` ebotcazou at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-10-01 9:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
Target Milestone|--- |10.4
CC| |ebotcazou at gcc dot gnu.org
--- Comment #28 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The binutils bug has been fixed in 2.36 or later:
https://sourceware.org/bugzilla/show_bug.cgi?id=26659
The optimization bug will be fixed in upcoming 10.x, 11.x and 12.x releases.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'
2015-01-20 19:16 [Bug c++/64697] New: C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd' vhaisman at gmail dot com
` (7 preceding siblings ...)
2021-10-01 9:05 ` ebotcazou at gcc dot gnu.org
@ 2022-10-14 10:31 ` ebotcazou at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-10-14 10:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |alvinhochun at gmail dot com
--- Comment #29 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
*** Bug 104862 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 10+ messages in thread