From owner-freebsd-bugs@freebsd.org Fri Aug 11 01:02:22 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F51C7EF02 for ; Fri, 11 Aug 2017 01:02:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE1D67D3C9 for ; Fri, 11 Aug 2017 01:02:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v7B12MDo079631 for ; Fri, 11 Aug 2017 01:02:22 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 221107] -r322109 and -r322210 (so clang 5) TARGET_ARCH=powerpc agp.kld or agp.kld gets: R_PPC_PLTREL24 reloc against local symbol; could not read symbols: Bad value Date: Fri, 11 Aug 2017 01:02:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2017 01:02:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221107 --- Comment #4 from Mark Millard --- The "reloc against local symbol" text is omitted by code from: /usr/src/contrib/binutils/bfd/elf32-ppc.c in its routine: /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ static bfd_boolean ppc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, const Elf_Internal_Rela *relocs) via: tls_type =3D 0; r_type =3D ELF32_R_TYPE (rel->r_info); . . .=20=20=20=20=20=20=20=20=20=20=20=20=20=20 switch (r_type) { . . . case R_PPC_PLT32: case R_PPC_PLTREL24: case R_PPC_PLTREL32: case R_PPC_PLT16_LO: case R_PPC_PLT16_HI: case R_PPC_PLT16_HA: #ifdef DEBUG fprintf (stderr, "Reloc requires a PLT entry\n"); #endif /* This symbol requires a procedure linkage table entry. We actually build the entry in finish_dynamic_symbol, because this might be a case of linking PIC code without linking in any dynamic objects, in which case we don't need to generate a procedure linkage table after all. */ if (h =3D=3D NULL) { /* It does not make sense to have a procedure linkage table entry for a local symbol. */ (*_bfd_error_handler) (_("%B(%A+0x%lx): %s reloc against " "local symbol"), abfd, sec, (long) rel->r_offset, ppc_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); return FALSE; } else { bfd_vma addend =3D 0; if (r_type =3D=3D R_PPC_PLTREL24) { ppc_elf_tdata (abfd)->makes_plt_call =3D 1; addend =3D rel->r_addend; } h->needs_plt =3D 1; if (!update_plt_info (abfd, h, got2, addend)) return FALSE; } break; where the earlier code for finding the h value is: r_symndx =3D ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h =3D NULL; else=20=20 { h =3D sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.type =3D=3D bfd_link_hash_indirect || h->root.type =3D=3D bfd_link_hash_warning) h =3D (struct elf_link_hash_entry *) h->root.u.i.link; } --=20 You are receiving this mail because: You are the assignee for the bug.=