From patchwork Tue Dec 18 21:04:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 1015618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dUpWrjpu"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="E12YEWix"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43K9Xf3wVnz9sCh for ; Wed, 19 Dec 2018 08:05:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oekO1J1D/XV/54ceMzrKRdul9Y7AacIwd1dmly6Z2JU=; b=dUpWrjpuHaCK0o fZLhYR6c2igXQRTcm+UsOGPz/jJ3x3jZvaE0Gm9o1jO0PiTzuZwyxTjQk/jyirFGQoenltyo8W/QJ aZ53K2KR3dZ5oy2aBDWYZZtPkqKvgzcp5aZUQIA5z9Tb1TwOxEt8U2hh9j//pJEqjQFPGXyg4XDSC nzi2EbARZRwNsdNDjLqgN6UNSe3ADuy7iKh3Ln95T1B9Oif4j657KjHPcmLL6dWRGruqN3Nry+2kN ahu/NHYHa+sbI0X2hAMHQQImJOZjyFwtyrHhqdHD2zQMawvZ1L4HmuSgxi9eSI8khch4R5uk99Q+l b5QWVlDhLyNhyX3s7dgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZMYZ-0001iW-S1; Tue, 18 Dec 2018 21:05:35 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZMYS-0001cY-UV for linux-snps-arc@lists.infradead.org; Tue, 18 Dec 2018 21:05:32 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 746D410C1DB9; Tue, 18 Dec 2018 13:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1545167123; bh=lNAN9nd7/ZHk6r90zsK7J7biUNkYb5pemMPrrDIua0I=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=E12YEWixak7939gqzA9znW9zVeEV+EcV/e4B8VFavCLq6ELQsRY+O8TE2v2k+q1qe geA+yB7rO/NRnTw2jbyUhsXR28qu/7mdYmo27OgJIhdiT9GUSB/yZ5RA/k2B3dWl3E 0PVgTWB89yH2a3YqmJpyuKMnbygLEyWiNbptROgJyIsmsPhxaG8a9h23fAptmF4y8v 639VeZtV4J3lf/KW+0vS3fwtgCSm5RJD9qyNEsEJLmXESIa9Tayp0oTZt13s1mCmSJ Ycb+RUzxeJGtwv85Yzp30gA09E2TQL04WDrhlQQ/b1kgguMWPH+ifkOMxX6GdN72g3 PDjsDggGO3k6A== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 68FA1519C; Tue, 18 Dec 2018 13:05:23 -0800 (PST) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 18 Dec 2018 13:05:23 -0800 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 02:35:20 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.70) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 02:35:19 +0530 From: Vineet Gupta To: Subject: [PATCH 14/21] ARC: Enable __start as entry point vs. canonical _start Date: Tue, 18 Dec 2018 13:04:36 -0800 Message-ID: <1545167083-16764-15-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545167083-16764-1-git-send-email-vgupta@synopsys.com> References: <1545167083-16764-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 X-Originating-IP: [10.10.161.70] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181218_130529_122397_F2145CB4 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , linux-snps-arc@lists.infradead.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ARC linker scripts have defined __start as entry point so to not break ABI for uClibc et al we allow __start for glibc as well Signed-off-by: Vineet Gupta --- ChangeLog | 3 +++ sysdeps/arc/dl-machine.h | 14 ++++++++++---- sysdeps/arc/entry.h | 5 +++++ sysdeps/arc/start.S | 14 +++++++++++--- 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 sysdeps/arc/entry.h diff --git a/ChangeLog b/ChangeLog index 6628960c487e..86e4db890850 100644 --- a/ChangeLog +++ b/ChangeLog @@ -105,6 +105,9 @@ * sysdeps/unix/sysv/linux/arc/configure: New file. * sysdeps/unix/sysv/linux/arc/configure.ac: New file. * sysdeps/unix/sysv/linux/arc/shlib-versions: New file. + * sysdeps/arc/dl-machine.h: replace _start with __start. + * sysdeps/arc/start.S: likewise. + * sysdeps/arc/entry.h: Add ENTRY_POINT define check. 2018-12-17 Joseph Myers diff --git a/sysdeps/arc/dl-machine.h b/sysdeps/arc/dl-machine.h index da1aef79152d..02727a3a4d47 100644 --- a/sysdeps/arc/dl-machine.h +++ b/sysdeps/arc/dl-machine.h @@ -21,6 +21,12 @@ #define ELF_MACHINE_NAME "arc" +#include + +#ifndef ENTRY_POINT +#error ENTRY_POINT needs to be defined for ARC +#endif + #include #include #include @@ -150,9 +156,9 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) #define RTLD_START asm ("\ .text \n\ -.globl _start \n\ -.type _start, @function \n\ -_start: \n\ +.globl __start \n\ +.type __start, @function \n\ +__start: \n\ ; (1). bootstrap ld.so \n\ bl.d _dl_start \n\ mov_s r0, sp ; pass ptr to aux vector tbl \n\ @@ -182,7 +188,7 @@ _start: \n\ add r0, pcl, _dl_fini@pcl \n\ j [r13] \n\ \n\ - .size _start,.-_start \n\ + .size __start,.-__start \n\ .previous \n\ "); diff --git a/sysdeps/arc/entry.h b/sysdeps/arc/entry.h new file mode 100644 index 000000000000..adb01d981afd --- /dev/null +++ b/sysdeps/arc/entry.h @@ -0,0 +1,5 @@ +#ifndef __ASSEMBLY__ +extern void __start (void) attribute_hidden; +#endif + +#define ENTRY_POINT __start diff --git a/sysdeps/arc/start.S b/sysdeps/arc/start.S index 119d596db07f..79e73e27d00d 100644 --- a/sysdeps/arc/start.S +++ b/sysdeps/arc/start.S @@ -34,7 +34,14 @@ . */ +#define __ASSEMBLY__ 1 +#include +#ifndef ENTRY_POINT +#error ENTRY_POINT needs to be defined for ARC +#endif + /* When we enter this piece of code, the program stack looks like this: + argc argument counter (integer) argv[0] program name (pointer) argv[1...N] program args (pointers) @@ -45,9 +52,9 @@ */ .text .align 4 - .global _start - .type _start,@function -_start: + .global __start + .type __start,@function +__start: mov fp, 0 ld_s r1, [sp] ; argc @@ -71,6 +78,7 @@ _start: /* Should never get here.... */ flag 1 + .size __start,.-__start /* Define a symbol for the first piece of initialized data. */ .data