This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81490] x86: Handling of symbol ranges for __seg_fs/__seg_gs
- From: "luto at kernel dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Jul 2017 05:16:36 +0000
- Subject: [Bug target/81490] x86: Handling of symbol ranges for __seg_fs/__seg_gs
- Auto-submitted: auto-generated
- References: <bug-81490-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81490
Andy Lutomirski <luto at kernel dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |luto at kernel dot org
--- Comment #8 from Andy Lutomirski <luto at kernel dot org> ---
(In reply to H. Peter Anvin from comment #7)
> Thinking about this some more, this is really not an aspect of __seg_* but
> rather the section the symbol is placed in. An embedded system kernel, for
> example, could quite possibly want to access an absolute section while the
> kernel itself is position-independent; maybe it is even running XIP.
>
> As such perhaps a better solution would be to have attributes that control
> these specific parameters. A quick off-the-top-of-my-head proposal:
>
> __attribute__((absolute))
>
> ... this symbol should be accessed using absolute address references.
>
> __attribute__((range(from,to)))
>
> ... specifies the valid address range for this symbol.
I would like to see something along these lines but even stronger: a way to
instruct GCC to use a particular type of access and relocation. For example, I
think I should be able to ask GCC to reference symbol "foo" using a PC-relative
relocation or using an absolute relocation at my option.