From patchwork Wed Jun 22 17:48:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Kolesov X-Patchwork-Id: 639332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rZXBx4WSwz9t1B for ; Thu, 23 Jun 2016 03:48:41 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id A80EF10119; Wed, 22 Jun 2016 19:48:38 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from smtprelay.synopsys.com (us01smtprelay-2.synopsys.com [198.182.60.111]) by helium.openadk.org (Postfix) with ESMTPS id B6DF610113 for ; Wed, 22 Jun 2016 19:48:36 +0200 (CEST) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 7D8FE10C0798 for ; Wed, 22 Jun 2016 10:48:34 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 479C355F13 for ; Wed, 22 Jun 2016 10:48:34 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 2BC5755F02 for ; Wed, 22 Jun 2016 10:48:34 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 17796B80; Wed, 22 Jun 2016 10:48:34 -0700 (PDT) Received: from akolesov-lab.internal.synopsys.com (akolesov-lab.internal.synopsys.com [10.121.8.134]) by mailhost.synopsys.com (Postfix) with ESMTP id DD846B79; Wed, 22 Jun 2016 10:48:32 -0700 (PDT) From: Anton Kolesov To: devel@uclibc-ng.org Date: Wed, 22 Jun 2016 20:48:29 +0300 Message-Id: <1466617709-12330-1-git-send-email-Anton.Kolesov@synopsys.com> X-Mailer: git-send-email 2.8.1 Cc: Vineet Gupta , Francois.Bedard@synopsys.com Subject: [uclibc-ng-devel] [PATCH] ARC: Implement .note.ABI-tag section in crt1.S X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Linux Standard Base specifies section .note.ABI-tag that can be considered as a marker for ELF files targeted to Linux systems. See https://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/noteabitag.html This section, for example, is used by the GDB to identify Linux ELFs as compared to baremetal ELFs that do not have this section. Signed-off-by: Anton Kolesov Cc: Vineet Gupta --- libc/sysdeps/linux/arc/crt1.S | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libc/sysdeps/linux/arc/crt1.S b/libc/sysdeps/linux/arc/crt1.S index 95c41f8..0fe3cf9 100644 --- a/libc/sysdeps/linux/arc/crt1.S +++ b/libc/sysdeps/linux/arc/crt1.S @@ -55,3 +55,18 @@ __start: /* Should never get here.... */ flag 1 .size __start,.-__start + +/* Implement a .note.ABI-tag section that is mandatory for Linux executables + according to LSB. See: + https://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/noteabitag.html. + Also: libc/sysdeps/linux/avr32/crt1.S. */ +.section ".note.ABI-tag", "a" + .align 4 + .long 1f - 0f /* Name length */ + .long 3f - 2f /* Data length */ + .long 1 /* Note type */ +0: .asciz "GNU" /* Vendor name */ +1: .align 4 +2: .long 0 /* Note data: Linux executable */ + .long 3,9,0 /* Earliest compatible kernel */ +3: .align 4 /* Pad out section */