Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #32259

Re: Agner's Proposal for an ideal extensible instruction set

From Terje Mathisen <terje.mathisen@tmsw.no>
Newsgroups comp.arch
Subject Re: Agner's Proposal for an ideal extensible instruction set
Date 2015-12-29 12:58 +0100
Organization Aioe.org NNTP Server
Message-ID <n5tsgi$r8d$1@speranza.aioe.org> (permalink)
References (4 earlier) <n5sirr$ip3$1@dont-email.me> <n5sn5q$f0$1@dont-email.me> <n5sv7s$j2n$1@dont-email.me> <n5tl5f$8o8$2@speranza.aioe.org> <n5tmn7$do1$1@dont-email.me>

Show all headers | View raw


Ivan Godard wrote:
> On 12/29/2015 1:52 AM, Terje Mathisen wrote:
>> Ivan Godard wrote:
>
>>> An immediate address must be known no later than link time in order to
>>> be put in the code, whereas with ASLR the address to use is not known
>>> until load time at the earliest, and two concurrent runs of the same
>>> code will be running at different addresses.
>>>
>>>
>> Is that always true Ivan?
>>
>> I thought the linker could insert placeholders for any such immediate
>> address data, and note them in some sort of fixup list for the loader.
>>
>> The loader would go through the fixup list and for each entry there, go
>> into the code and patch/adjust the entry to match the actual load
>> address.
>
> Yes, it can and that's the way you have to do it when the ISA has poor
> support for based addressing, as many early CPUs (and today's

My first introduction to PIC programming was when I started 
disassembling the very first PC viruses, they typically contained a CALL 
with relative offset zero, followed by a POP BX which would establish a 
pointer to the current code location.

They typically didn't worry about messing up the not yet invented return 
stack predictors. :-)

> microcontrollers) did. However the relocation is expensive because it
> touches all the code, and multiple copies must run at the same relocated
> address or suffer double the code space demand.

Agreed.

The ability to use the same library code from multiple programs at the 
same time, in order to save code space is nice.

However, the size ratio between code and data has been changing for a 
long time, in the direction of more and more data, right?

This means that many programs that used to use dynamic loading of 
library code have changed to static linking instead, mainly because that 
removes the worry about library updates that turns out to introduce 
incompatible changes.

OTOH it also makes it impossible to update an older program when a 
(security) bug turns up in a library function.
>
> A modern machine design would use self-relative (and hence position
> independent) addressing for code, and dedicated or genreg base address
> registers for data, also position independent. With PIC code the code
> file only has to be mapped into the address space, but doesn't have to
> be brought to memory or cache as is required for relocation.

I agree with you here as well, but I still believe large immediates are 
very nice to have, and that they are orthogonal to the PIC issue:

If you want to make a direct call to a function located far away, you 
need a large immediate value to encode that target address:

PIC or absolute address doesn't really matter.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Agner's Proposal for an ideal extensible instruction set Jean-Marc Bourguet <jm@bourguet.org> - 2015-12-28 15:50 +0100
  Re: Agner's Proposal for an ideal extensible instruction set Quadibloc <jsavard@ecn.ab.ca> - 2015-12-28 07:12 -0800
    Re: Agner's Proposal for an ideal extensible instruction set Piotr Wyderski <peter.pan@neverland.mil> - 2016-01-26 16:38 +0100
      Re: Agner's Proposal for an ideal extensible instruction set Quadibloc <jsavard@ecn.ab.ca> - 2016-01-29 12:10 -0800
  Re: Agner's Proposal for an ideal extensible instruction set "James Van Buskirk" <not_valid@comcast.net> - 2015-12-28 09:48 -0700
    Re: Agner's Proposal for an ideal extensible instruction set Quadibloc <jsavard@ecn.ab.ca> - 2015-12-28 10:29 -0800
    Re: Agner's Proposal for an ideal extensible instruction set Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-28 23:01 +0100
      Re: Agner's Proposal for an ideal extensible instruction set "James Van Buskirk" <not_valid@comcast.net> - 2015-12-28 16:25 -0700
        Re: Agner's Proposal for an ideal extensible instruction set Ivan Godard <ivan@millcomputing.com> - 2015-12-28 16:10 -0800
          Re: Agner's Proposal for an ideal extensible instruction set "James Van Buskirk" <not_valid@comcast.net> - 2015-12-28 18:23 -0700
            Re: Agner's Proposal for an ideal extensible instruction set Ivan Godard <ivan@millcomputing.com> - 2015-12-28 19:41 -0800
              Re: Agner's Proposal for an ideal extensible instruction set Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-29 10:52 +0100
                Re: Agner's Proposal for an ideal extensible instruction set Ivan Godard <ivan@millcomputing.com> - 2015-12-29 02:22 -0800
                Re: Agner's Proposal for an ideal extensible instruction set Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-29 12:58 +0100
                Re: Agner's Proposal for an ideal extensible instruction set Ivan Godard <ivan@millcomputing.com> - 2015-12-29 12:16 -0800
                Re: Agner's Proposal for an ideal extensible instruction set Quadibloc <jsavard@ecn.ab.ca> - 2015-12-29 07:25 -0800
                Re: Agner's Proposal for an ideal extensible instruction set Walter Banks <walter@bytecraft.com> - 2015-12-29 12:27 -0500
                Re: Agner's Proposal for an ideal extensible instruction set Robert Wessel <robertwessel2@yahoo.com> - 2015-12-29 11:46 -0600
                Re: Agner's Proposal for an ideal extensible instruction set paul wallich <pw@panix.com> - 2015-12-29 13:00 -0500
                Re: Agner's Proposal for an ideal extensible instruction set mrs@kithrup.com (Mike Stump) - 2015-12-29 22:21 +0000
            Re: Agner's Proposal for an ideal extensible instruction set anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-29 10:16 +0000
        Re: Agner's Proposal for an ideal extensible instruction set Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-29 10:49 +0100
          Re: Agner's Proposal for an ideal extensible instruction set Ivan Godard <ivan@millcomputing.com> - 2015-12-29 02:36 -0800
  Re: Agner's Proposal for an ideal extensible instruction set "Paul A. Clayton" <paaronclayton@gmail.com> - 2015-12-28 09:23 -0800
    Re: Agner's Proposal for an ideal extensible instruction set Quadibloc <jsavard@ecn.ab.ca> - 2015-12-28 10:31 -0800
      Re: Agner's Proposal for an ideal extensible instruction set Erik Trulsson <erikt@Update.UU.SE> - 2016-01-20 15:33 +0000
        Re: Agner's Proposal for an ideal extensible instruction set Casper H.S. Dik <Casper.Dik@OrSPaMcle.COM> - 2016-01-20 15:39 +0000
          Re: Agner's Proposal for an ideal extensible instruction set Terje Mathisen <terje.mathisen@tmsw.no> - 2016-01-20 18:31 +0100
        Re: Agner's Proposal for an ideal extensible instruction set Ivan Godard <ivan@millcomputing.com> - 2016-01-20 11:14 -0800
          Re: Agner's Proposal for an ideal extensible instruction set mrs@kithrup.com (Mike Stump) - 2016-01-26 03:36 +0000
      Re: Agner's Proposal for an ideal extensible instruction set Stefan Monnier <monnier@iro.umontreal.ca> - 2016-01-20 16:44 -0500
  Re: Agner's Proposal for an ideal extensible instruction set Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-28 19:56 +0100

csiph-web