提交 3fa2eb2a 编写于 作者: R Rich Felker

rename dynamic linker entry point from _start to _dlstart

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.
上级 acb7e049
......@@ -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)
......
.text
.global _start
_start:
.global _dlstart
_dlstart:
ldr r0,[sp]
add r1,sp,#4
bl __dynlink
......
.text
.global _start
_start:
.global _dlstart
_dlstart:
xor %ebp,%ebp
pop %edi
mov %esp,%esi
......
# FIXME: clearing argv entries
.global _start
_start:
.global _dlstart
_dlstart:
add r19, r0, r0
lw r5, r0, r1
......
......@@ -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
......
.global _start
.type _start,@function
_start:
.global _dlstart
.type _dlstart,@function
_dlstart:
bl 1f
2: .long _DYNAMIC-2b
1: mflr 5
......
.text
.global _start
.type _start, @function
_start:
.global _dlstart
.type _dlstart, @function
_dlstart:
mov.l @r15, r4
mov r15, r5
mov.l L1, r0
......
.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
......
.text
.global _start
_start:
.global _dlstart
_dlstart:
mov (%rsp),%rdi
lea 8(%rsp),%rsi
call __dynlink
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册