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]

weak alias in gas on arm-elf


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.


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