提交 5e396fb9 编写于 作者: R Rich Felker

adjust mips crt_arch entry point asm to avoid assembler bugs

apparently the .gpword directive does not work reliably with local
text labels; values produced were offset by 64k from the correct
value, resulting in incorrect computation of the got pointer at
runtime. instead, use an external label so that the assembler does not
munge the relocation; the linker will then get it right.

commit 6fef8caf exposed this issue by
removing the old, non-PIE-compatible handwritten crt1.s, which was not
affected. presumably mips PIE executables (using Scrt1.o produced from
crt_arch.h) were already affected at the time.
上级 71991a80
...@@ -4,13 +4,16 @@ __asm__( ...@@ -4,13 +4,16 @@ __asm__(
".text \n" ".text \n"
".global _" START "\n" ".global _" START "\n"
".global " START "\n" ".global " START "\n"
".global " START "_data\n"
".type _" START ", @function\n" ".type _" START ", @function\n"
".type " START ", @function\n" ".type " START ", @function\n"
".type " START "_data, @function\n"
"_" START ":\n" "_" START ":\n"
"" START ":\n" "" START ":\n"
" bal 1f \n" " bal 1f \n"
" move $fp, $0 \n" " move $fp, $0 \n"
"2: .gpword 2b \n" "" START "_data: \n"
" .gpword " START "_data \n"
" .gpword " START "_c \n" " .gpword " START "_c \n"
".weak _DYNAMIC \n" ".weak _DYNAMIC \n"
".hidden _DYNAMIC \n" ".hidden _DYNAMIC \n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册