How to make section take no space in output file?

DJ Delorie dj@redhat.com
Mon Jan 14 08:59:00 GMT 2008


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.



More information about the Binutils mailing list