From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49679 invoked by alias); 15 Mar 2017 22:03:43 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 49141 invoked by uid 89); 15 Mar 2017 22:03:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-qk0-f180.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aoRjlQl8sVd1jWonPvfhXok2aP+AM3VqqfDEfPs8XwA=; b=LmFRYEvYH8y2dPafOT+y58rsHOJQujZMGRCRg3Bc72y6Gde0JD4oAoJhqC+DAp+TPS UiB6Ep9UbdCgkZEIWUJUSnxgpeScIQFhmB+qIcD+Cg96G5p+Ru3WGqiPTdj6VHr2IKUT t1i/0FdM1N/9U1MoMO59Wl3sBo85Du5dJzHOigt8tQoOBngJ4y4tJfQZcRr3XqM5MxAV 3eowBpU3JN9OaTJCWV4CsEPc0IjSDl7b1k6jVrek8UPGPPrcLQc1J83yQig2SzTSQIoi nh0sYweBjnMbVMFECxm1riqlYVZz65xNKS/WABnknRYXaYHat7ATUY8PcEU4RQg1aKDF YCAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aoRjlQl8sVd1jWonPvfhXok2aP+AM3VqqfDEfPs8XwA=; b=jFGPaBDhqZPWMI6Ius7tYFE1TOQCgObbUxHFgRzjSo1+dR5r62jTXzufMURtXh9ook +Q6H5i1N+KHIKu+JWTzcUIqupbie79bxL+a7W8GdAu6QDDx1G4sFhyYXmq5Rtm95SJqh HvZBXFzIAw8vsxrZBQX7UKarY3MWK1LKlrs4J9LClucKjH+xEmROqjHmDOZeSzQ3a87i m8SJD4jIofP4mjLQ26W7NmWNT54FpF1kW/ciRAZ3D2rJ8jMUj+jEIO/Rv3kBdTLUMJfO dRlVAqPEI7X2Dl7TRLMVfSW7e2WCJre9Hzo5CNvPD77X+++yg+LE99gr06pDCtWB6eY4 1/iA== X-Gm-Message-State: AFeK/H3k5mVIhrus6T0PraLcC7vyBOaM7UX0jBkrtAWcmPMvGfQcquC5Vkxhg2K/foTC/HirBB20nzQM5CMp5w== X-Received: by 10.55.11.10 with SMTP id 10mr5387879qkl.100.1489615420610; Wed, 15 Mar 2017 15:03:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <88608944-14c9-9d28-80d1-32283521683b@gmail.com> From: "H.J. Lu" Date: Sun, 01 Jan 2017 00:00:00 -0000 Message-ID: Subject: Re: RFC: ABI support for special memory area To: Suprateeka R Hegde Cc: "Carlos O'Donell" , gnu-gabi@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017-q1/txt/msg00016.txt.bz2 Here is the my current proposal. -- H.J. ---- ABI support for special memory area To section attributes, add #define SHF_GNU_MBIND 0x00100000 for sections used to place data or text into a special memory area. The section names should start with ".mbind" so that they won't be grouped together with normal sections by link editor. The sh_info field indicates the special memory type. SHF_GNU_MBIND is only applicable to SHF_ALLOC sections. To the "Program Header" section, add an inclusive range of segment types for GNU_MBIND segments: #define PT_GNU_MBIND_NUM 4096 #define PT_GNU_MBIND_LO (PT_LOOS + 0x474e555) #define PT_GNU_MBIND_HI (PT_GNU_MBIND_LO + PT_GNU_MBIND_NUM - 1) The array element specifies the location and size of a special memory area. Each GNU_MBIND segment contains one GNU_MBIND section and the segment type is PT_GNU_MBIND_LO plus the sh_info value. If the sh_info value is greater than PT_GNU_MBIND_NUM, no GNU_MBIND segment will be created. Each GNU_MBIND segment must be aligned at page boundary. The interpretation of the special memory area information is implementation-dependent. Implementations may ignore GNU_MBIND segment. Run-time support int __gnu_mbind_setup (unsigned int type, void *addr, size_t length); It sets up special memory area of 'type' and 'length' at 'addr' where 'addr' is a multiple of page size. It returns zero for success, positive value of ERRNO for non-fatal error and negative value of ERRNO for fatal error. After all shared objects and the executable file are loaded, relocations are processed, for each GNU_MBIND segment in a shared object or the executable file, run-time loader calls __gnu_mbind_setup with type, address and length. The default implementation of __gnu_mbind_setup is int __gnu_mbind_setup (unsigned int type, void *addr, size_t length) { return 0; } which can be overridden by a different implementation at link-time.