This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to make section take no space in output file?
- From: DJ Delorie <dj at redhat dot com>
- To: Rick Mann <rmann at latencyzero dot com>
- Cc: binutils at sourceware dot org
- Date: 11 Jan 2008 15:43:52 -0500
- Subject: Re: How to make section take no space in output file?
- References: <FF47DF3F-5F45-4847-88BC-3712A4DAA214@latencyzero.com>
If they're memory mapped devices, I think a better approach is to make
them "extern" in your C program, and assign them values in the linker
script or an auxiliary asm file, like this:
.global framebuffer
framebuffer = 0xc8000000
If your C sources create data, the linker has to put it somewhere.
The solution is to not create data.
You could also try the DISCARD section, but whether it's useful or not
depends on your specific situation.