mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
(RTLD_START): Switch back to previous section to avoid confusing the
compiler.
This commit is contained in:
parent
02af0aee5e
commit
c0d5b73e05
@ -243,7 +243,8 @@ _dl_start_user:
|
|||||||
/* Jump to the user's entry point. */
|
/* Jump to the user's entry point. */
|
||||||
mov $9, $27
|
mov $9, $27
|
||||||
jmp ($9)
|
jmp ($9)
|
||||||
.end _dl_start_user");
|
.end _dl_start_user
|
||||||
|
.previous");
|
||||||
|
|
||||||
/* Nonzero iff TYPE describes relocation of a PLT entry, so
|
/* Nonzero iff TYPE describes relocation of a PLT entry, so
|
||||||
PLT entries should not be allowed to define the value. */
|
PLT entries should not be allowed to define the value. */
|
||||||
|
@ -56,21 +56,12 @@ static inline Elf32_Addr
|
|||||||
elf_machine_load_address (void)
|
elf_machine_load_address (void)
|
||||||
{
|
{
|
||||||
Elf32_Addr addr;
|
Elf32_Addr addr;
|
||||||
asm (".Lhere: lea .Lhere(%%pc), %0\n"
|
asm ("1: lea 1b(%%pc), %0\n"
|
||||||
" sub.l %#.Lhere, %0"
|
" sub.l 1b@GOTPC(%%pc), %0"
|
||||||
: "=a" (addr));
|
: "=a" (addr));
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The `subl' insn above will contain an R_68K_RELATIVE relocation
|
|
||||||
entry intended to insert the run-time address of the label `.Lhere'.
|
|
||||||
This will be the first relocation in the text of the dynamic
|
|
||||||
linker; we skip it to avoid trying to modify read-only text in this
|
|
||||||
early stage. */
|
|
||||||
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
|
|
||||||
((dynamic_info)[DT_RELA]->d_un.d_ptr += sizeof (Elf32_Rela), \
|
|
||||||
(dynamic_info)[DT_RELASZ]->d_un.d_val -= sizeof (Elf32_Rela))
|
|
||||||
|
|
||||||
|
|
||||||
/* Set up the loaded object described by L so its unrelocated PLT
|
/* Set up the loaded object described by L so its unrelocated PLT
|
||||||
entries will jump to the on-demand fixup code in dl-runtime.c. */
|
entries will jump to the on-demand fixup code in dl-runtime.c. */
|
||||||
@ -157,13 +148,16 @@ asm (TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup) \
|
|||||||
its return value is the user program's entry point. */
|
its return value is the user program's entry point. */
|
||||||
|
|
||||||
#define RTLD_START asm ("\
|
#define RTLD_START asm ("\
|
||||||
.text
|
.text
|
||||||
.globl _start
|
.globl _start
|
||||||
.globl _dl_start_user
|
.type _start,@function
|
||||||
_start:
|
_start:
|
||||||
move.l %sp, -(%sp)
|
move.l %sp, -(%sp)
|
||||||
jbsr _dl_start
|
jbsr _dl_start
|
||||||
addq.l #4, %sp
|
addq.l #4, %sp
|
||||||
|
|
||||||
|
.globl _dl_start_user
|
||||||
|
.type _dl_start_user,@function
|
||||||
_dl_start_user:
|
_dl_start_user:
|
||||||
| Save the user entry point address in %a4.
|
| Save the user entry point address in %a4.
|
||||||
move.l %d0, %a4
|
move.l %d0, %a4
|
||||||
@ -209,7 +203,9 @@ _dl_start_user:
|
|||||||
| Initialize %fp with the stack pointer.
|
| Initialize %fp with the stack pointer.
|
||||||
move.l %sp, %fp
|
move.l %sp, %fp
|
||||||
| Jump to the user's entry point.
|
| Jump to the user's entry point.
|
||||||
jmp (%a4)");
|
jmp (%a4)
|
||||||
|
.size _dl_start_user, . - _dl_start_user
|
||||||
|
.previous");
|
||||||
|
|
||||||
/* Nonzero iff TYPE describes a relocation that should
|
/* Nonzero iff TYPE describes a relocation that should
|
||||||
skip the executable when looking up the symbol value. */
|
skip the executable when looking up the symbol value. */
|
||||||
|
@ -423,6 +423,7 @@ _dl_runtime_resolve:\n \
|
|||||||
move $25, $2\n \
|
move $25, $2\n \
|
||||||
jr $25\n \
|
jr $25\n \
|
||||||
.end _dl_runtime_resolve\n \
|
.end _dl_runtime_resolve\n \
|
||||||
|
.previous\n \
|
||||||
");
|
");
|
||||||
|
|
||||||
/* Mask identifying addresses reserved for the user program,
|
/* Mask identifying addresses reserved for the user program,
|
||||||
@ -519,6 +520,7 @@ _dl_start_user:\n\
|
|||||||
lw $7, 12($29)\n\
|
lw $7, 12($29)\n\
|
||||||
jr $25\n"\
|
jr $25\n"\
|
||||||
_RTLD_EPILOGUE(ENTRY_POINT)\
|
_RTLD_EPILOGUE(ENTRY_POINT)\
|
||||||
|
"\n.previous"\
|
||||||
);
|
);
|
||||||
|
|
||||||
/* The MIPS never uses Elfxx_Rela relocations. */
|
/* The MIPS never uses Elfxx_Rela relocations. */
|
||||||
|
@ -423,6 +423,7 @@ _dl_runtime_resolve:\n \
|
|||||||
move $25, $2\n \
|
move $25, $2\n \
|
||||||
jr $25\n \
|
jr $25\n \
|
||||||
.end _dl_runtime_resolve\n \
|
.end _dl_runtime_resolve\n \
|
||||||
|
.previous\n \
|
||||||
");
|
");
|
||||||
|
|
||||||
/* Mask identifying addresses reserved for the user program,
|
/* Mask identifying addresses reserved for the user program,
|
||||||
@ -514,6 +515,7 @@ _dl_start_user:\n\
|
|||||||
ld $7, 3*8($29)\n\
|
ld $7, 3*8($29)\n\
|
||||||
jr $25\n"\
|
jr $25\n"\
|
||||||
_RTLD_EPILOGUE(ENTRY_POINT) \
|
_RTLD_EPILOGUE(ENTRY_POINT) \
|
||||||
|
"\n.previous"\
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user