SH5 needs __HAVE_FUNCTION_DESCRIPTORS defined in order for ld.elf_so

to resolve SHmedia function pointers correctly.
This commit is contained in:
scw 2003-03-26 14:46:32 +00:00
parent eefd7219fd
commit e6b13790fa
2 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.1 2003/03/25 13:11:54 scw Exp $ */
/* $NetBSD: mdreloc.c,v 1.2 2003/03/26 14:46:32 scw Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@ -166,3 +166,27 @@ _rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
return (caddr_t)new_value;
}
Elf_Addr
_rtld_function_descriptor_alloc(const Obj_Entry *obj, const Elf_Sym *def,
Elf_Addr addend)
{
Elf_Addr pc;
pc = (Elf_Addr)(obj->relocbase + addend);
if (def) {
pc += def->st_value;
if (def->st_other & STO_SH5_ISA32)
pc |= 1;
}
return (pc);
}
const void *
_rtld_function_descriptor_function(const void *addr)
{
return (addr);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: types.h,v 1.5 2002/10/12 11:39:53 scw Exp $ */
/* $NetBSD: types.h,v 1.6 2003/03/26 14:46:33 scw Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -78,6 +78,7 @@ typedef struct label_t {
#define __HAVE_GENERIC_SOFT_INTERRUPTS
#define __HAVE_SYSCALL_INTERN
#define __HAVE_RAS
#define __HAVE_FUNCTION_DESCRIPTORS
#ifdef notyet
#define __HAVE_AST_PERPROC /* Not reqd. until we support SMP */