From: "Leif Ekblad" <leif@rdos.net>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "GCC Patches" <gcc-patches@gcc.gnu.org>,
"GCC Mailing List" <gcc@gcc.gnu.org>
Subject: Re: x86-64 medium memory model
Date: Wed, 12 Dec 2012 21:33:00 -0000 [thread overview]
Message-ID: <F5F2ED1B0CC94526BDCF7E667C66D40A@AMDP6> (raw)
In-Reply-To: <CAMe9rOo_cfY86Uo++uOw2iY4DvEgH4ajV=2_i8TeX331msnZMA@mail.gmail.com>
The small memory model will not do since I want to put data at other
distinct addresses above 4G. I also want to place the heap at yet another
address interval. This way it becomes easy to separate out code, data and
heap references, and making sure that pointers are valid. The primary reason
for not using below 2G or the last 2G, is because such numbers are formed
naturally when doing 32-bit arithmetics, and thus could be executed by
chance from corrupt data.
If I understand it correctly, the PIE option is very similar to the PIC
option, and will not make it possible to use any address for both code and
data.
Additionally, when I tried the small memory model with a start address of
text above 4G, the linker complains about 32-bit fixups overflowing.
Leif Ekblad
----- Original Message -----
From: "H.J. Lu" <hjl.tools@gmail.com>
To: "Leif Ekblad" <leif@rdos.net>
Cc: "GCC Patches" <gcc-patches@gcc.gnu.org>; "GCC Mailing List"
<gcc@gcc.gnu.org>
Sent: Wednesday, December 12, 2012 9:59 PM
Subject: Re: x86-64 medium memory model
> On Wed, Dec 12, 2012 at 12:56 PM, Leif Ekblad <leif@rdos.net> wrote:
>> I'm working on OS-adaptations for an OS that would use x86-64
>> applications
>> that are located above 4G, but not in the upper area. Binutils provide a
>> function to be able to set the start of text to above 4G, but there are
>> problems with GCC when using this memory model.
>>
>
> Have you tried PIE with small model? You can place your
> binaries above 4G with better performance.
>
> --
> H.J.
next prev parent reply other threads:[~2012-12-12 21:33 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-08 18:13 [PATCH i386]: Enable push/pop in pro/epilogue for modern CPUs Xinliang David Li
2012-12-12 16:37 ` Jan Hubicka
2012-12-12 17:25 ` Xinliang David Li
2012-12-12 17:34 ` Xinliang David Li
2012-12-12 18:30 ` Jan Hubicka
2012-12-12 18:37 ` Andi Kleen
2012-12-12 18:43 ` Jan Hubicka
2012-12-12 18:43 ` Andi Kleen
2012-12-12 20:56 ` x86-64 medium memory model Leif Ekblad
2012-12-12 20:59 ` H.J. Lu
2012-12-12 21:33 ` Leif Ekblad [this message]
2012-12-13 0:16 ` [PATCH i386]: Enable push/pop in pro/epilogue for modern CPUs Xinliang David Li
2012-12-13 0:16 ` Xinliang David Li
2012-12-13 1:19 ` Jan Hubicka
2012-12-13 6:09 ` Xinliang David Li
2012-12-13 6:21 ` Jakub Jelinek
2012-12-13 7:05 ` Xinliang David Li
2012-12-13 19:28 ` Jan Hubicka
2012-12-13 10:22 ` Richard Biener
2012-12-13 19:43 ` H.J. Lu
2012-12-13 20:26 ` Jan Hubicka
2012-12-13 20:28 ` H.J. Lu
2012-12-13 20:40 ` Jan Hubicka
2012-12-13 21:02 ` H.J. Lu
2012-12-13 21:35 ` Jan Hubicka
2012-12-20 12:13 ` Melik-adamyan, Areg
2012-12-20 14:08 ` H.J. Lu
2012-12-20 15:05 ` Jan Hubicka
2012-12-20 15:07 ` Jan Hubicka
2012-12-20 15:22 ` H.J. Lu
2012-12-21 8:28 ` Zamyatin, Igor
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=F5F2ED1B0CC94526BDCF7E667C66D40A@AMDP6 \
--to=leif@rdos.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
/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).