Omit output section from executable

Alan Modra amodra@bigpond.net.au
Thu Aug 3 00:44:00 GMT 2006


On Wed, Aug 02, 2006 at 05:29:07PM -0400, Daniel Jacobowitz wrote:
> On Wed, Aug 02, 2006 at 11:20:18PM +0200, Udo A. Steinberg wrote:
> > But how can I achieve the same for C sources? When I write:
> > 
> >         unsigned foo __attribute__((section (".cpulocal")));
> > 
> > I get
> >         .cpulocal     00000004  00000000  00000000  00000034  2**2
> >                       CONTENTS, ALLOC, LOAD, DATA
> 
> I don't think you can do this from GCC.

Try this evil hack.

unsigned foo __attribute__((section (".cpulocal,\"aw\",@nobits#")));

The '#' might need to be different for targets that start gas comments
with another character.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list