This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
weak alias in gas on arm-elf
- From: Brian Sidebotham <micros at valvers dot com>
- To: binutils at sourceware dot org
- Date: Mon, 02 Jul 2007 13:36:34 +0100
- Subject: weak alias in gas on arm-elf
- Reply-to: micros at valvers dot com
Hi guys,
I want to make a weak alias in a startup file for target arm-elf.
I have read the docs with regards to .weak and .weakref, but I just
can't get them to do what I want.
.weak works as I expect, and the symbols it creates are branches to the
reset vector (pc=0). I have tried the .weak sym1 = sym2 alias assignment
but this is not supported on arm-elf-as.
I thought .weakref would work for me, but I can't get it too. Basically,
I want to create a list of weak symbols for handlers that may or may not
be present in the C code. If the handler isn't present, then the code
should infinitely loop at a dummy label.
At the moment I have:
.extern handler1
...
ldr pc, __handler1
...
__handler1:
bl handler1
.weak handler1
__dummy:
b .
which creates:
...
ldr pc, [pc, #20] ; 20 <__handler1>
...
__handler1:
bl 0 <startup>
Does anyone have any idea how I could effectively achieve .weak __dummy
= handler1 ? Thanks in advance.
Brian Sidebotham.