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]

ARM: calls to undefined weak symbols


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


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