public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "yshuiv7 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/94391] New: gcc refers to absolute symbols with R_X86_64_PC32 relocation
Date: Sun, 29 Mar 2020 21:05:13 +0000 [thread overview]
Message-ID: <bug-94391-4@http.gcc.gnu.org/bugzilla/> (raw)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94391
Bug ID: 94391
Summary: gcc refers to absolute symbols with R_X86_64_PC32
relocation
Product: gcc
Version: 9.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: yshuiv7 at gmail dot com
Target Milestone: ---
Test case:
Source file (a.c):
extern char _binary_a_c_size[];
unsigned long foo() { return (unsigned long)_binary_a_c_size; }
Run:
objcopy -B i386:x86-64 -I binary -O elf64-x86-64 a.c b.o
gcc -fuse-ld=lld -fpie -pie a.c b.o
lld complains about:
ld.lld: error: relocation R_X86_64_PC32 cannot refer to absolute symbol:
_binary_a_c_size
>>> defined in b.o
>>> referenced by a.c
>>> /tmp/cc3iReeC.o:(foo)
Also, this seems to be more than just a problem in gcc. Doing the same test
with clang+lld yields the expected results. However, with clang+gold/bfd, the
absolute symbol is relocated.
next reply other threads:[~2020-03-29 21:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-29 21:05 yshuiv7 at gmail dot com [this message]
2020-03-29 21:17 ` [Bug target/94391] " pinskia at gcc dot gnu.org
2020-03-29 23:34 ` yshuiv7 at gmail dot com
2020-03-29 23:37 ` pinskia at gcc dot gnu.org
2020-03-29 23:51 ` hjl.tools at gmail dot com
2020-03-30 2:40 ` i at maskray dot me
2020-03-30 2:42 ` i at maskray dot me
2020-03-30 2:45 ` pinskia at gcc dot gnu.org
2020-03-30 2:46 ` pinskia at gcc dot gnu.org
2020-03-30 3:48 ` hjl.tools at gmail dot com
2020-03-30 4:14 ` i at maskray dot me
2020-03-30 9:29 ` yshuiv7 at gmail dot com
2020-03-30 11:01 ` hjl.tools at gmail dot com
2020-03-30 12:22 ` hjl.tools at gmail dot com
2020-03-30 12:42 ` hjl.tools at gmail dot com
2020-03-30 16:14 ` yshuiv7 at gmail dot com
2020-03-30 20:15 ` hjl.tools at gmail dot com
2020-03-30 23:27 ` yshuiv7 at gmail dot com
2020-03-30 23:31 ` pinskia at gcc dot gnu.org
2020-03-30 23:33 ` yshuiv7 at gmail dot com
2020-03-30 23:34 ` yshuiv7 at gmail dot com
2020-03-30 23:36 ` pinskia at gcc dot gnu.org
2020-03-30 23:39 ` yshuiv7 at gmail dot com
2020-03-31 1:26 ` i at maskray dot me
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-94391-4@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).