This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to make section take no space in output file?



On Jan 11, 2008, at 12:43 PM, DJ Delorie wrote:



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.

They are not memory-mapped devices; they're strictly allocated RAM. The only requirement is that they be of specific size and alignment, and I'd like for the linker to just assign addresses accordingly. However, in the output file, they don't need to exist at all; I just want references to the symbols to have the right values at run time.


--
Rick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]