1 msggcc 4.2.3 : make: *** [bootstrap] Error 2
2 msgminor mistake in http://gcc.gnu.org/gcc-4.3/cha...
15 msglibtool for shared objects?
1 msganeurin chandras hammond griswold
1 msgAdding new section attribute
3 msgThe effects of closed loop SSA and Scalar Evolu...
2 msghowto run cross testings with help of translators
1 msggcc-4.1-20080310 is now available
6 msgGNAT on SVN Trunk
2 msgCRX and CR16 port maintainer
2 msgNew picoChip port and maintainers
11 msgvectorizer default in 4.3.0 changes document mi...
2 msgGCC 4.3.0-20080228 (powerpc-linux-gnuspe) ICE o...
10 msgRTL definition
7 msgPossible gcc-4.3 regression wrt bootstrapping t...
19 msg[tuples] gimple_assign_subcode for GIMPLE_SINGL...
3 msgCombine repeats matching on insn pairs and will...
1 msggcc-4.4-20080307 is now available
1 msgNeed link ln -s ../lib64/libgomp.spec libgomp.s...

RFC: Idea for code size reduction
\ Philipp Marek (7 Mar 2008)
. \ Richard Guenther (7 Mar 2008)
. . \ Philipp Marek (7 Mar 2008)
. . \ Jakub Jelinek (7 Mar 2008)
. . . \ Philipp Marek (7 Mar 2008)
. . . . \ Jakub Jelinek (7 Mar 2008)
. . . . . \ Philipp Marek (7 Mar 2008)
. . . \ Richard Guenther (7 Mar 2008)
. \ michael (7 Mar 2008)
. . \ Philipp Marek (7 Mar 2008)
. \ Dave Korn (7 Mar 2008)
. . \ Philipp Marek (7 Mar 2008)
. . . \ Ian Lance Taylor (7 Mar 2008)
. . . . \ Philipp Marek (7 Mar 2008)
. \ Philipp Marek (7 Mar 2008)

Subject:Re: Idea for code size reduction
Group:Gcc
From:Philipp Marek
Date:7 Mar 2008


On Friday 07 March 2008 Ian Lance Taylor wrote:
> "Philipp Marek" <philipp> writes:
> >> Shouldn't this be done in the linker instead?
> >
> > Well, can the linker change the instruction sequences? Ie. put a JMP
> > instead of other code?
>
> Sure. The linker can do whatever it likes. The usual problem is that
> by the time the linker sees the code, it no longer knows about PC
> relative references within the same section. So if you have
>
> call foo
> ...
> sequence to remove
> ...
> foo:
>
> and the call is PC-relative, then when the linker removes the sequence
> of instructions it will not know that it needs to adjust the call to
> foo.
Right.

> What you are describing is a type of linker relaxation, and the same
> issues arise there. The usual solution is to force the assembler to
> emit all PC-relative relocations, so that the linker knows about them
> and is able to adjust them.
But what we'd need above is to have the compiler make a reference to
[removed_sequence + offset] instead, and that could be done by the linker
again.

So when the compiler removes a piece of code by a "jump <symbol>", it can use
offsets in there as usual.

> Linker relaxation is used routinely in special sections, such as the
> .eh_frame section used to hold stack unwind information for throwing
> exceptions. It is also used for code sequences on some processors,
> but normally not on the i386/x86_64.
Thank you very much for this information!


Another idea: if we find out that such sequences are *very* common (eg. by
comparing many different binaries and libraries), libc (or a libcommon or
something like that) could have a set of these "abbreviations" - eg. indexed
by symbol, which is defined as MD5_hex(removed section).


--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!


© 2004-2008 readlist.com