From: Richard Henderson <richard@atheist.tamu.edu>
Subject: Re: gdb
Date: Thu, 9 May 1996 10:43:52 -0500 (CDT) [thread overview]
Message-ID: <532965d3273d1c14309704f1e559999f.axp-list@archive.invalid> (raw)
In-Reply-To: <Pine.LNX.3.91.960509080842.11981C-100000@linux.cs.Helsinki.FI>
Linus wrote:
> So, now think of the problem without a fixed assembler.. What do we get? We
> get an assembler that isn't a "traditional" assembler any more: we just get a
> smart pre-processor. Essentially, the assembler shouldn't emit runnable code,
> it should emit runnable code _fragments_, and then the linker would be free
> to pad those as it sees fit.
I don't believe that ELF is compatible with the notion of subsections,
at least in the same way that it supports regular sections. However,
this has sparked an Idea.
We introduce a new relocation type (CALL) which marks a bsr insn.
We introduce a new assembler macro (call) that emits this relocation.
This obviates the need for the assembler to have any special intuition
about the code -- intutition that is often wrong when people are doing
odd hand assembly stuff.
The assembler is required to retain fixup information across CALLs.
We allow the assembler to elide branch relocs that do not cross calls
to help reduce the size of the object file and speed linking.
When the linker goes to put all this together, based on the specifics of
the situation, it expands the CALL reloc in one of three ways:
(1) intra-module, to a function with the same gp:
Fixes up the bsr with the function address. If exists a
GPDISP relocation at the function address, we add 8.
(2) intra-module, to a function with a different gp:
Expands to:
ldq $27,fn($gp)
bsr reg,fn
ldgp $gp,0(reg)
where reg is extracted from the original bsr insn.
This rather than hard-code $26 to support functions
such as __divq that use t9.
(3) inter-module:
Expands to:
ldq $27,fn($gp)
jsr reg,($27)
ldgp $gp,0(reg)
So the linker will have to expand the section to accomodate the added
code (worst case by a factor of four), but we already specified that
the assembler must retain relocation information across the call, so the
linker has everything it needs to fix things up after its changes.
Comments?
r~
next parent reply other threads:[~1996-05-09 15:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.91.960509080842.11981C-100000@linux.cs.Helsinki.FI>
1996-05-09 15:43 ` Richard Henderson [this message]
1999-08-29 0:09 gdb Larry Snyder
1999-08-30 12:07 ` gdb Max Weninger
1999-08-30 15:20 ` gdb Michal Jaegermann
1999-08-30 17:12 ` gdb Max Weninger
1999-08-30 18:19 ` gdb Wes Bauske
1999-08-30 20:15 ` gdb Michal Jaegermann
1999-08-31 8:56 ` gdb Max Weninger
[not found] <m0uM6E7-0001thC@atheist.tamu.edu>
1996-05-22 11:45 ` gdb Jim Nance
[not found] <Pine.SUN.3.91.960510085342.3960A-100000@edge.edge.net>
1996-05-17 15:56 ` gdb Harald Koenig
[not found] <richard@atheist.tamu.edu>
1996-05-09 14:55 ` gdb Eric Youngdale
[not found] <Pine.LNX.3.91.960508210447.27170G-100000@linux.cs.Helsinki.FI>
1996-05-09 8:16 ` gdb Harald Koenig
-- strict thread matches above, loose matches on Subject: below --
1996-05-09 4:34 gdb David Mosberger-Tang
1996-05-09 3:47 gdb Eric Youngdale
1996-05-09 5:29 ` gdb Linus Torvalds
1996-05-08 20:15 gdb Richard Henderson
1996-05-09 8:23 ` gdb Harald Koenig
1996-05-09 16:04 ` gdb Richard Henderson
1996-05-08 19:07 gdb Richard Gorton
1996-05-08 18:51 gdb Craig Burley
[not found] <torvalds@cs.Helsinki.FI>
1996-05-08 17:19 ` gdb Eric Youngdale
1996-05-08 18:24 ` gdb Eric Youngdale
1996-05-08 17:53 gdb David Mosberger
1996-05-08 18:16 ` gdb Linus Torvalds
1996-05-07 14:23 gdb David Mosberger-Tang
1996-05-07 15:48 ` gdb Richard Henderson
1996-05-07 6:32 gdb Harald Koenig
1996-05-08 17:06 ` gdb Linus Torvalds
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox