From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8117 invoked by alias); 21 Apr 2013 19:27:19 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 8106 invoked by uid 89); 21 Apr 2013 19:27:19 -0000 X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-we0-f176.google.com (HELO mail-we0-f176.google.com) (74.125.82.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 21 Apr 2013 19:27:18 +0000 Received: by mail-we0-f176.google.com with SMTP id s10so539868wey.7 for ; Sun, 21 Apr 2013 12:27:16 -0700 (PDT) X-Received: by 10.180.188.141 with SMTP id ga13mr5086409wic.9.1366572436480; Sun, 21 Apr 2013 12:27:16 -0700 (PDT) Received: from [192.168.10.24] (adsl-89-217-245-58.adslplus.ch. [89.217.245.58]) by mx.google.com with ESMTPS id b5sm36377597eew.16.2013.04.21.12.27.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Apr 2013 12:27:15 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: gold linker: Access section start & end address w/o using a linker script From: Raphael Zulliger In-Reply-To: Date: Sun, 21 Apr 2013 19:27:00 -0000 Cc: "binutils@sourceware.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <10A84606-654D-4FBC-A66D-40BA39916061@gmail.com> To: Ian Lance Taylor X-SW-Source: 2013-04/txt/msg00217.txt.bz2 Thanks Ian! __start_SECNAME / __stop_SECNAME: I've been googling for something like thi= s almost for hours=85 That certainly answers my question for "project specific" section names. Bu= t I cant see yet how it solve my question for pre-defined sections like .sb= ss, .sdata, etc.? Is there another trick I don't know yet? E.g. can I creat= e section-aliasses or something like that? (again, a short google session d= idn't give useful results) Raphael On Apr 21, 2013, at 7:42 PM, Ian Lance Taylor wrote: > On Sun, Apr 21, 2013 at 9:04 AM, Raphael Zulliger wro= te: >>=20 >> After having read several things about gold in the net, my impression is= that gold mainly supports linker scripts to be backward compatible to the = bfd linker. But the "gold style of linking" is to avoid using linker script= s. Am I roughly right with this conclusion? >=20 > Yes. >=20 >> The problem that arises when no linker script should be used is that our= RTOS (and probably embedded system in general) requires to know the start = address and end address of certain sections, such as data, sbss, etc. We ne= ed to know these addresses in order to create copies of these section durin= g startup to support 'soft reset OS' features. >=20 > With both gold and GNU ld, if the name of the section is a valid C > identifier (e.g., does not start with '.') then the symbols > __start_SECNAME and __stop_SECNAME will be automatically defined by > the linker and available for use by the program. >=20 > Ian