How to conditionally un-reference a symbol or un-keep a symbol?

Grant Edwards grante@visi.com
Fri May 30 19:47:00 GMT 2008


Let's say that we've got some startup code that zeros out the
.bss section on startup.  That code is being pulled in at link
time due to a line in an assembly file like this:

 "  .global __do_blank_bss"

There are no other references to __do_blank_bss. 

What I'd like to be able to do is have the linker script not
pull in that chunk of startup codeif the size of the .bss
section is 0.

Or, conversely, I could premanently ditch the " .global
__do_blank_bss" if there was a way in the linker script to tell
it to include/keep that chunk of startup code only when the
size of the .bss section is not 0.

I've been studying ld's info pages and some ld script examples,
but I can't figure out how to do what I'm trying to do.

Is there a way to do what I want to do?

-- 
Grant Edwards                   grante             Yow! Remember, in 2039,
                                  at               MOUSSE & PASTA will
                               visi.com            be available ONLY by
                                                   prescription!!



More information about the Binutils mailing list