delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/05/07:11:41

Message-ID: <37F9C5E4.39C8DA1A@maths.unine.ch>
Date: Tue, 05 Oct 1999 10:33:24 +0100
From: Gautier <gautier DOT demontmollin AT maths DOT unine DOT ch>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX64 6.5 IP30)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Linker trimming unused code/data
References: <E1FF8239A075D311AF7200A0C9D60AE308025D AT probe-2 DOT acclaim-euro DOT net>
NNTP-Posting-Host: hilbert.unine.ch
Lines: 23
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> > If you think GNU ld should support this feature, I suggest posting to
> > gnu.utils.bug

> I'm fairly sure that this cannot be done using only the information output
> by gcc. To leave out unused functions, you'd need to know the origin and
> size for every symbol, and also be sure that there were no relative offsets
> from one symbol to another, wheras standard object formats only give you
> a block of code with the origin of each symbol, but no size information.
> It might be possible to deduce the other data for gcc output (I don't know
> enough about the compiler to judge that), but certainly isn't possible
> for manually written asm sources, so this wouldn't be a safe optimisation
> to apply.

For that a `helper' file could tell what is safe to trim:
`ld blabla -trim=can_trim.lst' 
This file would be produced by the compiler. Or could this information
be appended/inserted into the .o file without breaking its format ?

-- 
Gautier

_____\\________________\_______\
http://members.xoom.com/gdemont/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019