This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ARM: calls to undefined weak symbols
- From: Christian Groessler <chris at groessler dot org>
- To: binutils at sourceware dot org
- Date: Wed, 2 Mar 2016 14:07:56 +0100
- Subject: ARM: calls to undefined weak symbols
- Authentication-results: sourceware.org; auth=none
Hi,
it just occurred to me: couldn't calls to undefined weak symbols
completely be removed
instead of being replaced by a 'nop' (when doing a 'relaxing' link)?
-----
$ cat weak.s
.text
.align 2
.weak fred
.global _start
_start:
sub r0,r1,r2
bl fred
add r0,r1,r2
$ arm-linux-gnueabi-as -o weak.o weak.s
$ arm-linux-gnueabi-ld --relax -o weak.elf weak.o
$ arm-linux-gnueabi-objdump -d weak.elf
weak.elf: file format elf32-littlearm
Disassembly of section .text:
00010054 <_start>:
10054: e0410002 sub r0, r1, r2
10058: e1a00000 nop ; (mov r0, r0)
1005c: e0810002 add r0, r1, r2
$
-----
Are there technical reasons for not doing this? Or is it just that
nobody implemented it?
regards,
chris