This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
How to conditionally un-reference a symbol or un-keep a symbol?
- From: Grant Edwards <grante at visi dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 30 May 2008 18:36:31 +0000 (UTC)
- Subject: How to conditionally un-reference a symbol or un-keep a symbol?
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!!