From patchwork Wed Jul 22 16:31:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 498716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E67D0140293 for ; Thu, 23 Jul 2015 02:32:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=IodTgWXu; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type; q=dns; s=default; b=RtBz//sTkbf6US67ouUO2 4bpVjtp7gNegMFQ5e/RWqkQOP3EBIZ5z+d9Blnbh9CgDD4sClp520M0IQEHxjnKA 1H9/cXhAHrq+ToPVUXwWKpZN0/giMOeF8Tk01n2rayWhbuVxwjv8aXRTjSz6xH19 9TwOOKX0/5BR35BNM3dwnY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type; s=default; bh=ebGyF5vGtlXBNxyhL5ElPoKaa+0 =; b=IodTgWXuoF6B0ZtS0xpkE5NBN14O8VLDmFa3nKAzFCrxPbYR32YsJkd+so2 EJtFIFmZHE0VdQSTt4tPfJl19L+UybtclX0GY6DNVazyqvjpIqhTlAppEC6z8ONP YJREZrIA6g34zriwEyd5VvZI4Us2SdJSLd1hPVO/S2yIB/Dc= Received: (qmail 38231 invoked by alias); 22 Jul 2015 16:32:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 38222 invoked by uid 89); 22 Jul 2015 16:32:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Message-ID: <55AFC57B.8020602@arm.com> Date: Wed, 22 Jul 2015 17:31:55 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: GNU C Library CC: Marcus Shawcroft Subject: [PATCH][ARM][BZ #17711] Fix extern protected data handling X-MC-Unique: tlEz14pjTR2Cz6eMe5laCg-1 Fixes elf/tst-protected1a and elf/tst-protected1b tests. Depends on a gcc and binutils fix too. 2015-07-22 Szabolcs Nagy [BZ #17711] * sysdeps/arm/dl-sysdep.h (DL_EXTERN_PROTECTED_DATA): Define. * sysdeps/arm/dl-machine.h (elf_machine_type_class): Handle ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA. diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index f901538..6fb20bd 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -224,18 +224,22 @@ _dl_start_user:\n\ TLS variable, so undefined references should not be allowed to define the value. ELF_RTYPE_CLASS_COPY iff TYPE should not be allowed to resolve to one - of the main executable's symbols, as for a COPY reloc. */ + of the main executable's symbols, as for a COPY reloc. + ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA iff TYPE describes relocation against + protected data whose address may be external due to copy relocation. */ #ifndef RTLD_BOOTSTRAP # define elf_machine_type_class(type) \ ((((type) == R_ARM_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32 \ || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32 \ || (type) == R_ARM_TLS_DESC) \ * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) + | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY) \ + | (((type) == R_ARM_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA)) #else #define elf_machine_type_class(type) \ ((((type) == R_ARM_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) + | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY) \ + | (((type) == R_ARM_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA)) #endif /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ diff --git a/sysdeps/arm/dl-sysdep.h b/sysdeps/arm/dl-sysdep.h index e5657dd..463ce59 100644 --- a/sysdeps/arm/dl-sysdep.h +++ b/sysdeps/arm/dl-sysdep.h @@ -21,3 +21,5 @@ /* _dl_argv cannot be attribute_relro, because _dl_start_user might write into it after _dl_start returns. */ #define DL_ARGV_NOT_RELRO 1 + +#define DL_EXTERN_PROTECTED_DATA