public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lulu Cheng <chenglulu@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, gcc-patches@gcc.gnu.org
Cc: Jinyang He <hejinyang@loongson.cn>,
	xuchenghua@loongson.cn, Huacai Chen <chenhuacai@kernel.org>,
	Youling Tang <tangyouling@loongson.cn>,
	Wang Xuerui <i@xen0n.name>
Subject: Re: [PATCH v3] LoongArch: add addr_global attribute
Date: Sat, 30 Jul 2022 11:13:10 +0800	[thread overview]
Message-ID: <285f23f7-55d6-e185-dbd9-f69ed09e4286@loongson.cn> (raw)
In-Reply-To: <9b6b0e68cfb7e87ae961ef8a7bb7987f534da19c.camel@xry111.site>


在 2022/7/30 上午1:17, Xi Ruoyao 写道:
> Change v2 to v3:
> - Disable section anchor for addr_global symbols.
> - Use -O2 in test to make sure section anchor is disabled.
>
> --
>
> Background:
> https://lore.kernel.org/loongarch/d7670b60-2782-4642-995b-7baa01779a66@loongson.cn/T/#e1d47e2fe185f2e2be8fdc0784f0db2f644119379
>
> Question:  Do you have a better name than "addr_global"?

I think the name can be changed to "get_through_got".What do you think of it?

>
> Alternatives:
>
> 1. Just use "-mno-explicit-relocs -mla-local-with-abs" for kernel
> modules.  It's stupid IMO.
> 2. Implement a "-maddress-local-with-got" option for GCC and use it for
> kernel modules.  It seems too overkill: we might create many unnecessary
> GOT entries.
> 3. For all variables with a section attribute, consider it global.  It
> may make sense, but I just checked x86_64 and riscv and they don't do
> this.
> 4. Implement -mcmodel=extreme and use it for kernel modules.  To me
> "extreme" seems really too extreme.
> 5. More hacks in kernel. (Convert relocations against .data..percpu with
> objtool?  But objtool is not even implemented for LoongArch yet.)
>
> Note: I'll be mostly AFK in the following week.  My attempt to finish
> the kernel support for new relocs before going AFK now failed miserably
> :(.
>
> -- >8 --
>
> A linker script and/or a section attribute may locate a local object in
> some way unexpected by the code model, leading to a link failure.  This
> happens when the Linux kernel loads a module with "local" per-CPU
> variables.
>
> Add an attribute to explicitly mark an variable with the address
> unlimited by the code model so we would be able to work around such
> problems.
>

Others I think are ok.


  reply	other threads:[~2022-07-30  3:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 14:22 [PATCH] " Xi Ruoyao
2022-07-29 15:31 ` [PATCH v2] " Xi Ruoyao
2022-07-29 17:17   ` [PATCH v3] " Xi Ruoyao
2022-07-30  3:13     ` Lulu Cheng [this message]
2022-07-30  6:03       ` Huacai Chen
2022-07-31  9:05     ` Chenghua Xu
2022-08-01 10:04       ` [PATCH v4] LoongArch: add movable attribute Xi Ruoyao
2022-08-01 10:07         ` [PATCH v5] " Xi Ruoyao
2022-08-03  1:36           ` Xi Ruoyao
2022-08-03  2:59             ` WANG Xuerui
2022-08-03  3:15               ` Xi Ruoyao
     [not found]             ` <-2muj1c-68saz6jhkcyw3jo1xp-1mgcvnkbqi2wjp6tue-qsso54-emxgu3-k85590-kpgox7-w67u6h3cai1l-5bi887dsgzsu-g4d7i7-wl316qxrucx4kv4on7-mnna36-iremg8-nwc5ot-9041t2-hu8nsl.1659495047941@email.android.com>
2022-08-03  3:10               ` 回复:[PATCH " Xi Ruoyao
2022-08-04  7:47                 ` Xi Ruoyao
2022-08-05  1:05                   ` Lulu Cheng
2022-08-05  1:28                     ` Xi Ruoyao
2022-08-05  2:38                       ` Lulu Cheng
2022-08-05  2:51                         ` Xi Ruoyao
2022-08-05  3:34                           ` Xi Ruoyao
2022-08-05  3:45                             ` Xi Ruoyao
2022-08-05  4:01                               ` Lulu Cheng
2022-08-05  6:03                                 ` Xi Ruoyao
2022-08-05  7:19                                   ` Lulu Cheng
2022-08-05  7:41                                     ` WANG Xuerui
2022-08-05  7:58                                       ` Lulu Cheng
2022-08-05  9:53                                         ` Xi Ruoyao
2022-08-08  4:53                                           ` Lulu Cheng
2022-08-09 11:30                                             ` Xi Ruoyao
2022-08-09 13:03                                               ` Lulu Cheng
2022-08-09 14:04                                                 ` Xi Ruoyao

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=285f23f7-55d6-e185-dbd9-f69ed09e4286@loongson.cn \
    --to=chenglulu@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hejinyang@loongson.cn \
    --cc=i@xen0n.name \
    --cc=tangyouling@loongson.cn \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /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).