From: liuzhensong <liuzhensong@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, binutils@sourceware.org
Cc: WANG Xuerui <i.swmail@xen0n.name>, chenglulu@loongson.cn
Subject: Re: [PATCH] LoongArch: Use copy relocation for %pc_lo12 against external symbol
Date: Thu, 1 Sep 2022 10:09:16 +0800 [thread overview]
Message-ID: <5bafc296-022f-7b77-5ce4-00b09fee56f9@loongson.cn> (raw)
In-Reply-To: <d1089572e821cf1cdb6f7e69223bb32df2ec2a41.camel@xry111.site>
在 2022/9/1 上午9:41, Xi Ruoyao 写道:
> On Thu, 2022-09-01 at 09:27 +0800, liuzhensong wrote:
>
>> The R_LARCH_COPY is supported in older versions, we removed this
>> feature and are not going to support.
> Hmm, then for
>
> extern int x;
> int f() { return x; }
>
> it will produce a GOT access. If x is in another TU but not in a shared
> library, such a GOT access and the GOT entry is unneeded.
>
> This will be really a pain for situations like building an OS kernel, or
> with -static or -static-pie. Even for this simple example, there is no
> way to tell "x" is not in a shared library (maybe, expect LTO or linker
> relaxation, but IIRC LTO or relaxation do not *guarantee* to avoid the
> GOT, just "try to" avoid the GOT).
>
> So is there any serious reason forbidding us from using R_LARCH_COPY? Or
> any options for this "unneeded GOT" issue?
https://maskray.me/blog/2021-01-09-copy-relocations-canonical-plt-entries-and-protected
next prev parent reply other threads:[~2022-09-01 2:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 13:22 Xi Ruoyao
2022-08-31 13:41 ` Xi Ruoyao
2022-09-01 1:38 ` liuzhensong
2022-09-01 1:38 ` liuzhensong
2022-09-01 2:12 ` Xi Ruoyao
2022-09-01 2:31 ` liuzhensong
2022-09-01 2:31 ` liuzhensong
2022-09-01 1:27 ` liuzhensong
2022-09-01 1:27 ` liuzhensong
2022-09-01 1:41 ` Xi Ruoyao
2022-09-01 2:09 ` liuzhensong [this message]
2022-09-01 7:42 ` Fangrui Song
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=5bafc296-022f-7b77-5ce4-00b09fee56f9@loongson.cn \
--to=liuzhensong@loongson.cn \
--cc=binutils@sourceware.org \
--cc=chenglulu@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=xry111@xry111.site \
/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).