From patchwork Sun Jul 26 12:29:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chung-Lin Tang X-Patchwork-Id: 500052 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 0BC4D1402B2 for ; Sun, 26 Jul 2015 22:29:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=tjk6ATNk; 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:from:subject:to:message-id:date:mime-version :content-type; q=dns; s=default; b=ruKWKiR4FjNoZlqcMCqctb6oj1Z1N Gq7oOKqSb5oVOT8lS2x8IJ9di92e+3ivj6eOP69nxyBnOVsbvnFeElJnaViMYdJS hwva65WUZjCFFxdQpVBtAquiDQ5TZbTR4OpuxOXtTBn8rAR1nG6yiuKnc/M2/kFc WSdTIPgSn5K6Yg= 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:from:subject:to:message-id:date:mime-version :content-type; s=default; bh=HXcuWtW0DCI8ItYTgxIAc3rDUTY=; b=tjk 6ATNkoVEmpmC5g94MzCEs1Y6eRpETBk6MoUTv2vT+3wMYqA8IH3s/Y+X5N+solUC u9WMRYq9ToyoQNpH7UXqWDCzl2U5ZfGEOJu2F4tZjNFQR8k+m7ArWCxnOflVNZoK dYxlNatzxfkHIDUb2gnNovS5fXq1B+GJRJJQrqhY= Received: (qmail 100502 invoked by alias); 26 Jul 2015 12:29:47 -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 100490 invoked by uid 89); 26 Jul 2015 12:29:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com From: Chung-Lin Tang Subject: [PATCH, nios2] Extern protected data definitions To: GNU C Library Message-ID: <55B4D2B6.8000903@codesourcery.com> Date: Sun, 26 Jul 2015 20:29:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Like the additions for ARM/aarch64, this fixes the elf/tst-protected1[ab] tests on Nios II. It does require a single liner patch to BFD to define 'elf_backend_extern_protected_data', which I'll submit to upstream soon. Tested and committed to master. This should be the last fix I have for Nios II for 2.22, I'll be posting the test results to the release wiki page soon. Thanks, Chung-Lin 2015-07-26 Chung-Lin Tang * sysdeps/nios2/dl-sysdep.h (DL_EXTERN_PROTECTED_DATA): Define. * sysdeps/nios2/dl-machine.h (elf_machine_type_class): Handle ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA. diff --git a/sysdeps/nios2/dl-machine.h b/sysdeps/nios2/dl-machine.h index 1a8397f..10ec821 100644 --- a/sysdeps/nios2/dl-machine.h +++ b/sysdeps/nios2/dl-machine.h @@ -193,7 +193,8 @@ _start:\n\ || (type) == R_NIOS2_TLS_DTPMOD \ || (type) == R_NIOS2_TLS_DTPREL \ || (type) == R_NIOS2_TLS_TPREL) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_NIOS2_COPY) * ELF_RTYPE_CLASS_COPY)) + | (((type) == R_NIOS2_COPY) * ELF_RTYPE_CLASS_COPY) \ + | (((type) == R_NIOS2_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA)) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_NIOS2_JUMP_SLOT diff --git a/sysdeps/nios2/dl-sysdep.h b/sysdeps/nios2/dl-sysdep.h index 4f49c2d..ef6d3f3 100644 --- a/sysdeps/nios2/dl-sysdep.h +++ b/sysdeps/nios2/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