rename dynamic linker entry point from _start to _dlstart
authorRich Felker <dalias@aerifal.cx>
Fri, 20 Jun 2014 04:25:12 +0000 (00:25 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 20 Jun 2014 04:25:12 +0000 (00:25 -0400)
the main motivation for this change is to aid in debugging. since the
main program's entry point is also named _start, it was difficult to
set breakpoints or quickly identify which _start execution stopped in.

Makefile
src/ldso/arm/start.s
src/ldso/i386/start.s
src/ldso/microblaze/start.s
src/ldso/mips/start.s
src/ldso/powerpc/start.s
src/ldso/sh/start.s
src/ldso/x32/start.s
src/ldso/x86_64/start.s

index 0ab0bfddb2364b594949eeba8705d9ed0c98b34f..d5a64fce221370497d61b86c5645702d8a50317a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,7 @@ $(foreach s,$(wildcard src/*/$(ARCH)*/*.s),$(eval $(call mkasmdep,$(s))))
 
 lib/libc.so: $(LOBJS)
        $(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS) -nostdlib -shared \
-       -Wl,-e,_start -Wl,-Bsymbolic-functions \
+       -Wl,-e,_dlstart -Wl,-Bsymbolic-functions \
        -o $@ $(LOBJS) $(LIBCC)
 
 lib/libc.a: $(OBJS)
index dfa36578583ccd393514df71a8b304338633f71f..5dd93b55606ec6a0f00816ea536dcf11e8934e09 100644 (file)
@@ -1,6 +1,6 @@
 .text
-.global _start
-_start:
+.global _dlstart
+_dlstart:
        ldr r0,[sp]
        add r1,sp,#4
        bl __dynlink
index b16f8af578f12670907fdc4938ff61de5973ab44..c37a1faa03fbe69e95b6277ec239289618de116e 100644 (file)
@@ -1,6 +1,6 @@
 .text
-.global _start
-_start:
+.global _dlstart
+_dlstart:
        xor %ebp,%ebp
        pop %edi
        mov %esp,%esi
index 4e0a0e501ff8fd2578f0d3ac4789ae3aac9532ce..067e86133d9a5fd66f89df65576d0fdbe2f47ff3 100644 (file)
@@ -1,6 +1,6 @@
 # FIXME: clearing argv entries
-.global _start
-_start:
+.global _dlstart
+_dlstart:
        add     r19, r0, r0
 
        lw      r5, r0, r1
index 2e985294ceac60c4a65b4e2f7bb4b539e900c3b1..0cadbf8ac96a87f717f46277193496cd6036634d 100644 (file)
@@ -2,9 +2,9 @@
 .hidden __reloc_self
 .set noreorder
 .set nomacro
-.global _start
-.type _start,@function
-_start:
+.global _dlstart
+.type _dlstart,@function
+_dlstart:
        move $fp, $0
 
        bgezal $0, 1f
index 6c499e8e414c73c6691b5eda24d6e230cb2d16d6..6548d58f41f9db265247d8db5cbb8395f9b51c59 100644 (file)
@@ -1,6 +1,6 @@
-       .global _start
-       .type   _start,@function
-_start:
+       .global _dlstart
+       .type   _dlstart,@function
+_dlstart:
        bl      1f
 2:     .long   _DYNAMIC-2b
 1:     mflr    5
index ca6b7fc9b293503d2777dda79b9ca8f90189a000..0d2d9136e28974140402cfc2c67a4052a01cecc6 100644 (file)
@@ -1,7 +1,7 @@
 .text
-.global _start
-.type   _start, @function
-_start:
+.global _dlstart
+.type   _dlstart, @function
+_dlstart:
        mov.l  @r15, r4
        mov    r15, r5
        mov.l  L1, r0
index 0fcf46dcd86e813afa31e8432d5c7b47a544d056..3c3800aaa2318c275815eebbe644003a1a1d54ce 100644 (file)
@@ -1,6 +1,6 @@
 .text
-.global _start
-_start:
+.global _dlstart
+_dlstart:
        mov (%rsp),%rdi  /* move argc into 1st argument slot */
        lea 4(%rsp),%rsi /* move argv into 2nd argument slot */
        call __dynlink
index 80c1d08d9963f574bc0bca52514d54f9e2d887a8..1c5598aa42900c4cecf57018668acede415eb5fd 100644 (file)
@@ -1,6 +1,6 @@
 .text
-.global _start
-_start:
+.global _dlstart
+_dlstart:
        mov (%rsp),%rdi
        lea 8(%rsp),%rsi
        call __dynlink