Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/libexec/ld.elf_so Pull up following revision(s) (requeste...
details: https://anonhg.NetBSD.org/src/rev/0a975d24e053
branches: netbsd-7
changeset: 800248:0a975d24e053
user: snj <snj%NetBSD.org@localhost>
date: Sun Jul 09 04:35:00 2017 +0000
description:
Pull up following revision(s) (requested by uwe in ticket #1411):
libexec/ld.elf_so/reloc.c: revision 1.110
PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY
relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by
accident. They no longer happen to work when old binaries are run on
newer systems. Explicitly ignore these bogus relocations.
diffstat:
libexec/ld.elf_so/reloc.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diffs (41 lines):
diff -r ec2e0228e3f3 -r 0a975d24e053 libexec/ld.elf_so/reloc.c
--- a/libexec/ld.elf_so/reloc.c Sat Jul 08 17:19:31 2017 +0000
+++ b/libexec/ld.elf_so/reloc.c Sun Jul 09 04:35:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: reloc.c,v 1.106.18.1 2016/03/06 18:17:55 martin Exp $ */
+/* $NetBSD: reloc.c,v 1.106.18.2 2017/07/09 04:35:00 snj Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -39,7 +39,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: reloc.c,v 1.106.18.1 2016/03/06 18:17:55 martin Exp $");
+__RCSID("$NetBSD: reloc.c,v 1.106.18.2 2017/07/09 04:35:00 snj Exp $");
#endif /* not lint */
#include <err.h>
@@ -73,6 +73,22 @@
const Elf_Sym *srcsym = NULL;
Obj_Entry *srcobj;
+ if (__predict_false(size == 0)) {
+#if defined(__powerpc__) && !defined(__LP64) /* PR port-macppc/47464 */
+ if (strcmp(name, "_SDA_BASE_") == 0
+ || strcmp(name, "_SDA2_BASE_") == 0)
+ {
+ rdbg(("COPY %s %s --> ignoring old binutils bug",
+ dstobj->path, name));
+ return 0;
+ }
+#endif
+#if 0 /* shall we warn? */
+ xwarnx("%s: zero size COPY relocation for \"%s\"",
+ dstobj->path, name);
+#endif
+ }
+
for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) {
srcsym = _rtld_symlook_obj(name, hash, srcobj, 0,
_rtld_fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)));
Home |
Main Index |
Thread Index |
Old Index