CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: skrll Date: Mon Jul 29 13:16:19 UTC 2024 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c Log Message: KNF and remove trailing whitespace in previous. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c diff -u src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.52 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.53 --- src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.52 Mon Jul 29 05:32:39 2024 +++ src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Mon Jul 29 13:16:19 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: hppa_reloc.c,v 1.52 2024/07/29 05:32:39 macallan Exp $ */ +/* $NetBSD: hppa_reloc.c,v 1.53 2024/07/29 13:16:19 skrll Exp $ */ /*- * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hppa_reloc.c,v 1.52 2024/07/29 05:32:39 macallan Exp $"); +__RCSID("$NetBSD: hppa_reloc.c,v 1.53 2024/07/29 13:16:19 skrll Exp $"); #endif /* not lint */ #include @@ -626,8 +626,9 @@ _rtld_relocate_plt_lazy(Obj_Entry *obj) Elf_Addr func_pc, func_sl; /* skip R_PARISC_NONE entries */ - if (ELF_R_TYPE(rela->r_info) == R_TYPE(NONE)) continue; - + if (ELF_R_TYPE(rela->r_info) == R_TYPE(NONE)) + continue; + assert(ELF_R_TYPE(rela->r_info) == R_TYPE(IPLT)); /*
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: skrll Date: Mon Jul 29 13:16:19 UTC 2024 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c Log Message: KNF and remove trailing whitespace in previous. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: macallan Date: Mon Jul 29 05:32:39 UTC 2024 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c Log Message: skip R_PARISC_NONE reloc entries instead of segfaulting on them now windowmaker runs on my C360 To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c diff -u src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.51 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.52 --- src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.51 Mon Jul 22 23:10:46 2024 +++ src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Mon Jul 29 05:32:39 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: hppa_reloc.c,v 1.51 2024/07/22 23:10:46 riastradh Exp $ */ +/* $NetBSD: hppa_reloc.c,v 1.52 2024/07/29 05:32:39 macallan Exp $ */ /*- * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hppa_reloc.c,v 1.51 2024/07/22 23:10:46 riastradh Exp $"); +__RCSID("$NetBSD: hppa_reloc.c,v 1.52 2024/07/29 05:32:39 macallan Exp $"); #endif /* not lint */ #include @@ -625,6 +625,9 @@ _rtld_relocate_plt_lazy(Obj_Entry *obj) Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); Elf_Addr func_pc, func_sl; + /* skip R_PARISC_NONE entries */ + if (ELF_R_TYPE(rela->r_info) == R_TYPE(NONE)) continue; + assert(ELF_R_TYPE(rela->r_info) == R_TYPE(IPLT)); /*
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: macallan Date: Mon Jul 29 05:32:39 UTC 2024 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c Log Message: skip R_PARISC_NONE reloc entries instead of segfaulting on them now windowmaker runs on my C360 To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: riastradh Date: Mon Jul 22 23:10:46 UTC 2024 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c Log Message: ld.elf_so: Cite reference for HP PA-RISC ELF relocations. PR lib/58455: Missing references for processor-specific ELF relocation semantics To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c diff -u src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.50 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.51 --- src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.50 Sun Jun 4 01:24:57 2023 +++ src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Mon Jul 22 23:10:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: hppa_reloc.c,v 1.50 2023/06/04 01:24:57 joerg Exp $ */ +/* $NetBSD: hppa_reloc.c,v 1.51 2024/07/22 23:10:46 riastradh Exp $ */ /*- * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc. @@ -29,9 +29,26 @@ * POSSIBILITY OF SUCH DAMAGE. */ +/* + * HP PA-RISC ELF relocations. + * + * References: + * + * [PAELF] Processor-Specific ELF Supplement for PA-RISC, Version + * 1.5, 1998-08-20. + * https://parisc.wiki.kernel.org/images-parisc/0/0e/Elf-pa-hp.pdf + * https://web.archive.org/web/20240712004045/https://parisc.wiki.kernel.org/images-parisc/0/0e/Elf-pa-hp.pdf + * + * [PATLS] Randolph Chung, Carlos O'Donell, and John David + * Anglin, `Implementing Thread Local Storage for HP PA-RISC + * Linux', 2013-11-11. + * http://www.parisc-linux.org/documentation/tls/hppa-tls-implementation.pdf + * https://web.archive.org/web/20240722131647/http://www.parisc-linux.org/documentation/tls/hppa-tls-implementation.pdf + */ + #include #ifndef lint -__RCSID("$NetBSD: hppa_reloc.c,v 1.50 2023/06/04 01:24:57 joerg Exp $"); +__RCSID("$NetBSD: hppa_reloc.c,v 1.51 2024/07/22 23:10:46 riastradh Exp $"); #endif /* not lint */ #include
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: riastradh Date: Mon Jul 22 23:10:46 UTC 2024 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c Log Message: ld.elf_so: Cite reference for HP PA-RISC ELF relocations. PR lib/58455: Missing references for processor-specific ELF relocation semantics To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: skrll Date: Mon May 30 17:06:34 UTC 2022 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c rtld_start.S Log Message: Set DP early so that any binary functions that override others get the right value if they're called before _start. This is true of bash where it provides its own getenv. Part of port-hppa/56118: sporadic app crashes in HPPA -current To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c cvs rdiff -u -r1.13 -r1.14 src/libexec/ld.elf_so/arch/hppa/rtld_start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c diff -u src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.48 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.49 --- src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.48 Sat Dec 4 14:39:08 2021 +++ src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c Mon May 30 17:06:34 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: hppa_reloc.c,v 1.48 2021/12/04 14:39:08 skrll Exp $ */ +/* $NetBSD: hppa_reloc.c,v 1.49 2022/05/30 17:06:34 skrll Exp $ */ /*- * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hppa_reloc.c,v 1.48 2021/12/04 14:39:08 skrll Exp $"); +__RCSID("$NetBSD: hppa_reloc.c,v 1.49 2022/05/30 17:06:34 skrll Exp $"); #endif /* not lint */ #include @@ -52,6 +52,7 @@ __RCSID("$NetBSD: hppa_reloc.c,v 1.48 20 caddr_t _rtld_bind(const Obj_Entry *, const Elf_Addr); void _rtld_bind_start(void); void __rtld_setup_hppa_pltgot(const Obj_Entry *, Elf_Addr *); +void _rtld_set_dp(Elf_Addr *); /* * It is possible for the compiler to emit relocations for unaligned data. @@ -417,6 +418,16 @@ _rtld_relocate_nonplt_objects(Obj_Entry const Obj_Entry *defobj = NULL; unsigned long last_symnum = ULONG_MAX; + /* + * This will be done by the crt0 code, but make sure it's set + * early so that symbols overridden by the non-pic binary + * get the right DP value. + */ + if (obj->mainprog) { + hdbg(("setting DP to %p", obj->pltgot)); + _rtld_set_dp(obj->pltgot); + } + for (rela = obj->rela; rela < obj->relalim; rela++) { Elf_Addr*where; Elf_Addr tmp; Index: src/libexec/ld.elf_so/arch/hppa/rtld_start.S diff -u src/libexec/ld.elf_so/arch/hppa/rtld_start.S:1.13 src/libexec/ld.elf_so/arch/hppa/rtld_start.S:1.14 --- src/libexec/ld.elf_so/arch/hppa/rtld_start.S:1.13 Sun May 10 06:42:38 2020 +++ src/libexec/ld.elf_so/arch/hppa/rtld_start.S Mon May 30 17:06:34 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: rtld_start.S,v 1.13 2020/05/10 06:42:38 skrll Exp $ */ +/* $NetBSD: rtld_start.S,v 1.14 2022/05/30 17:06:34 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -231,3 +231,9 @@ ENTRY(_rtld_bind_start,HPPA_FRAME_SIZE) bv %r0(%r21) nop EXIT(_rtld_bind_start) + + +LEAF_ENTRY_NOPROFILE(_rtld_set_dp) + bv %r0(%rp) + copy %arg0, %dp +EXIT(_rtld_set_dp)
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: skrll Date: Mon May 30 17:06:34 UTC 2022 Modified Files: src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c rtld_start.S Log Message: Set DP early so that any binary functions that override others get the right value if they're called before _start. This is true of bash where it provides its own getenv. Part of port-hppa/56118: sporadic app crashes in HPPA -current To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c cvs rdiff -u -r1.13 -r1.14 src/libexec/ld.elf_so/arch/hppa/rtld_start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/libexec/ld.elf_so/arch/hppa
Module Name:src Committed By: skrll Date: Sat Jan 9 15:36:44 UTC 2010 Modified Files: src/libexec/ld.elf_so/arch/hppa: rtld_start.S Log Message: Small tidyup. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/libexec/ld.elf_so/arch/hppa/rtld_start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.