From owner-svn-src-stable-8@freebsd.org Tue Sep 18 20:46:56 2018 Return-Path: Delivered-To: svn-src-stable-8@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C1310A8958; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6029682AD0; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 595492513D; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8IKkuTS055600; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8IKkuCp055599; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809182046.w8IKkuCp055599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Sep 2018 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r338756 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Group: stable-8 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Commit-Revision: 338756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 20:46:56 -0000 Author: dim Date: Tue Sep 18 20:46:55 2018 New Revision: 338756 URL: https://svnweb.freebsd.org/changeset/base/338756 Log: MFC r309748 (by glebius): Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Modified: stable/8/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/elf_machdep.c stable/11/sys/amd64/amd64/elf_machdep.c stable/9/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/elf_machdep.c Tue Sep 18 17:51:45 2018 (r338755) +++ stable/8/sys/amd64/amd64/elf_machdep.c Tue Sep 18 20:46:55 2018 (r338756) @@ -161,6 +161,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas switch (rtype) { case R_X86_64_PC32: case R_X86_64_32S: + case R_X86_64_PLT32: addend = *(Elf32_Addr *)where; break; default: @@ -194,6 +195,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_X86_64_PC32: /* S + A - P */ + case R_X86_64_PLT32: /* L + A - P, L is PLT location for + the symbol, which we treat as S */ addr = lookup(lf, symidx, 1); where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where);