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: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Aug 2017 17:24:52 +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
--- Comment #24 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Andy Lutomirski from comment #20)
>
> Can someone elaborate on what the @GPREL suffix actually means?
"%seg:foo@GPREL" is used to address symbol, foo, relative to __gp. foo is
addressed by %seg + offset of foo relative to __gp. Linker sets __gp to
the middle of GP section which contains definitions of symbols with GPREL
relocations. Run-time should load address of __gp into segment register,
%seg before accessing foo via "%seg:foo@GPREL".