2003-05-31  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_plt_conflict):
	New function.
	(elf_machine_rela) <case R_PPC64_JMP_SLOT>: Avoid
	RESOLVE_CONFLICT_FIND_MAP.  If RESOLVE_CONFLICT_FIND_MAP is defined,
	call elf_machine_plt_conflict instead of elf_machine_fixup_plt.

	* sysdeps/i386/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE): Add
	CFI directives.

	* csu/Makefile: Fix Makefile warnings regarding Scrt1.o.
This commit is contained in:
Ulrich Drepper 2003-06-01 01:32:04 +00:00
parent b6da933bfb
commit 06e2e0a747
3 changed files with 58 additions and 3 deletions

View File

@ -1,6 +1,17 @@
2003-05-31 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_plt_conflict):
New function.
(elf_machine_rela) <case R_PPC64_JMP_SLOT>: Avoid
RESOLVE_CONFLICT_FIND_MAP. If RESOLVE_CONFLICT_FIND_MAP is defined,
call elf_machine_plt_conflict instead of elf_machine_fixup_plt.
2003-05-31 Ulrich Drepper <drepper@redhat.com>
* csu/Makefile: Fix Makefile warnings regarding Scrt1.
* sysdeps/i386/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE): Add
CFI directives.
* csu/Makefile: Fix Makefile warnings regarding Scrt1.o.
* libio/fileops.c (_IO_file_open): Don't mark as inline.

View File

@ -168,35 +168,51 @@ static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
.text\n\
.globl _dl_runtime_resolve\n\
.type _dl_runtime_resolve, @function\n\
" CFI_STARTPROC "\n\
.align 16\n\
_dl_runtime_resolve:\n\
" CFI_ADJUST_CFA_OFFSET (8) "\n\
pushl %eax # Preserve registers otherwise clobbered.\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %edx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
call fixup # Call resolver.\n\
popl %edx # Get register content back.\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
popl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
ret $8 # Jump to function address.\n\
" CFI_ENDPROC "\n\
.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
\n\
.globl _dl_runtime_profile\n\
.type _dl_runtime_profile, @function\n\
" CFI_STARTPROC "\n\
.align 16\n\
_dl_runtime_profile:\n\
" CFI_ADJUST_CFA_OFFSET (8) "\n\
pushl %eax # Preserve registers otherwise clobbered.\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %edx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
movl 20(%esp), %ecx # Load return address\n\
movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
call profile_fixup # Call resolver.\n\
popl %edx # Get register content back.\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
popl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
ret $8 # Jump to function address.\n\
" CFI_ENDPROC "\n\
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
.previous\n\
");
@ -207,23 +223,35 @@ _dl_runtime_profile:\n\
.globl _dl_runtime_profile\n\
.type _dl_runtime_resolve, @function\n\
.type _dl_runtime_profile, @function\n\
" CFI_STARTPROC "\n\
.align 16\n\
_dl_runtime_resolve:\n\
_dl_runtime_profile:\n\
" CFI_ADJUST_CFA_OFFSET (8) "\n\
pushl %eax # Preserve registers otherwise clobbered.\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %edx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
movl 16(%esp), %edx # Push the arguments for `fixup'\n\
movl 12(%esp), %eax\n\
pushl %edx\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
pushl %eax\n\
" CFI_ADJUST_CFA_OFFSET (4) "\n\
call fixup # Call resolver.\n\
popl %edx # Pop the parameters\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
popl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
popl %edx # Get register content back.\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
popl %ecx\n\
" CFI_ADJUST_CFA_OFFSET (-4) "\n\
xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
ret $8 # Jump to function address.\n\
" CFI_ENDPROC "\n\
.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
.previous\n\

View File

@ -506,6 +506,21 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
return finaladdr;
}
static inline void
elf_machine_plt_conflict (Elf64_Addr *reloc_addr, Elf64_Addr finaladdr)
{
Elf64_FuncDesc *plt = (Elf64_FuncDesc *) reloc_addr;
Elf64_FuncDesc *rel = (Elf64_FuncDesc *) finaladdr;
plt->fd_func = rel->fd_func;
plt->fd_aux = rel->fd_aux;
plt->fd_toc = rel->fd_toc;
PPC_DCBST (&plt->fd_func);
PPC_DCBST (&plt->fd_aux);
PPC_DCBST (&plt->fd_toc);
PPC_SYNC;
}
/* Return the final value of a plt relocation. */
static inline Elf64_Addr
elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
@ -603,9 +618,10 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_JMP_SLOT:
#ifdef RESOLVE_CONFLICT_FIND_MAP
RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
#endif
elf_machine_plt_conflict (reloc_addr, value);
#else
elf_machine_fixup_plt (map, sym_map, reloc, reloc_addr, value);
#endif
return;
#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)