aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/hppa/Versions1
-rw-r--r--sysdeps/hppa/dl-lookupcfg.h13
-rw-r--r--sysdeps/hppa/dl-machine.h4
-rw-r--r--sysdeps/hppa/dl-symaddr.c2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/clone.S14
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/mmap64.c2
7 files changed, 27 insertions, 11 deletions
diff --git a/sysdeps/hppa/Versions b/sysdeps/hppa/Versions
index 0c447d9f28..c5f35d4971 100644
--- a/sysdeps/hppa/Versions
+++ b/sysdeps/hppa/Versions
@@ -2,5 +2,6 @@ ld {
GLIBC_2.2 {
# hppa specific functions in the dynamic linker, but used by libc.so.
_dl_symbol_address; _dl_unmap; _dl_lookup_address;
+ _dl_function_address;
}
}
diff --git a/sysdeps/hppa/dl-lookupcfg.h b/sysdeps/hppa/dl-lookupcfg.h
index 4f5f8998a7..118c4d0c58 100644
--- a/sysdeps/hppa/dl-lookupcfg.h
+++ b/sysdeps/hppa/dl-lookupcfg.h
@@ -34,3 +34,16 @@ Elf32_Addr _dl_lookup_address (const void *address);
void _dl_unmap (struct link_map *map);
#define DL_UNMAP(map) _dl_unmap (map)
+
+extern Elf32_Addr _dl_function_address (const struct link_map *map,
+ Elf32_Addr start);
+
+#define DL_FUNCTION_ADDRESS(map, addr) _dl_function_address (map, addr)
+
+/* The test for "addr & 2" below is to accomodate old binaries which
+ violated the ELF ABI by pointing DT_INIT and DT_FINI at a function
+ pointer. */
+#define DL_DT_INIT_ADDRESS(map, addr) \
+ ((Elf32_Addr)(addr) & 2 ? (addr) : DL_FUNCTION_ADDRESS (map, addr))
+#define DL_DT_FINI_ADDRESS(map, addr) \
+ ((Elf32_Addr)(addr) & 2 ? (addr) : DL_FUNCTION_ADDRESS (map, addr))
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index f8a8e7bcee..a3437b557a 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -448,6 +448,10 @@ __dl_fini_plabel:
/* We only use RELA. */
#define ELF_MACHINE_NO_REL 1
+/* Return the address of the entry point. */
+#define ELF_MACHINE_START_ADDRESS(map, start) \
+ DL_FUNCTION_ADDRESS (map, start)
+
#endif /* !dl_machine_h */
/* These are only actually used where RESOLVE_MAP is defined, anyway. */
diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
index 038404a48b..49c1216664 100644
--- a/sysdeps/hppa/dl-symaddr.c
+++ b/sysdeps/hppa/dl-symaddr.c
@@ -33,7 +33,7 @@ _dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref)
}
ElfW(Addr)
-_dl_start_address (const struct link_map *map, ElfW(Addr) start)
+_dl_function_address (const struct link_map *map, ElfW(Addr) start)
{
return __hppa_make_fptr (map, start, &__fptr_root, NULL);
}
diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S
index 510e0ff799..b902ff7669 100644
--- a/sysdeps/unix/sysv/linux/hppa/clone.S
+++ b/sysdeps/unix/sysv/linux/hppa/clone.S
@@ -33,18 +33,18 @@ ENTRY(__clone)
/* FIXME: I have no idea how profiling works on hppa. */
/* Sanity check arguments. */
- comib,<> 0,%arg0,.Lerror /* no NULL function pointers */
- ldi EINVAL,%ret0
- comib,<> 0,%arg1,.Lerror /* no NULL stack pointers */
+ comib,= 0,%arg0,.Lerror /* no NULL function pointers */
+ ldi -EINVAL,%ret0
+ comib,= 0,%arg1,.Lerror /* no NULL stack pointers */
nop
/* Save the fn ptr and arg on the new stack. */
- stwm %arg3,64(%arg1)
+ stwm %arg0,64(%arg1)
stw %arg3,-60(%arg1)
/* Do the system call */
copy %arg2,%arg0
- ble 0x100(%sr7,%r0)
+ ble 0x100(%sr2,%r0)
ldi __NR_clone,%r20
ldi -4096,%r1
@@ -60,12 +60,12 @@ ENTRY(__clone)
/* Something bad happened -- no child created */
.Lerror:
b __syscall_error
- nop
+ sub %r0,%ret0,%arg0
thread_start:
/* Load up the arguments. */
ldw -60(%sp),%arg0
- ldwm -64(%sp),%r22
+ ldw -64(%sp),%r22
/* Call the user's function */
bl $$dyncall,%r31
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index f0d6431abe..6d7cd6a23f 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -32,8 +32,6 @@ shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
-ptrace - ptrace 4 __ptrace ptrace
-
getresuid - getresuid i:ppp getresuid
getresgid - getresgid i:ppp getresgid
diff --git a/sysdeps/unix/sysv/linux/powerpc/mmap64.c b/sysdeps/unix/sysv/linux/powerpc/mmap64.c
index 4b3e60deaf..25b11a963f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/mmap64.c
+++ b/sysdeps/unix/sysv/linux/powerpc/mmap64.c
@@ -42,7 +42,7 @@ static int have_no_mmap2;
void *
__mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
{
- if (! (offset & ((1 << PAGE_SHIFT)-1)))
+ if (offset & ((1 << PAGE_SHIFT)-1))
{
__set_errno (EINVAL);
return MAP_FAILED;