From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22019 invoked by alias); 21 Apr 2013 17:42:43 -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 22005 invoked by uid 89); 21 Apr 2013 17:42:42 -0000 X-Spam-SWARE-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 21 Apr 2013 17:42:42 +0000 Received: by mail-ob0-f178.google.com with SMTP id 16so838786obc.23 for ; Sun, 21 Apr 2013 10:42:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding :x-gm-message-state; bh=fT6WDaTZC0KB/KxDwSNfmlwyefmPaGAcbRzjqbbHG0g=; b=kVAyzIzwko5xB6/Ms+fOqjOBaxZs9k0gZV729Mbd89D7JcV17gtnH0Seg/lW1q4GnB gEHxADhmN5ZV1IidQ7i3L9s5TndkxwIMnu5ZtP6zud2+ZKeoKuqOxw8sbnF2r+i807RM Iwpwd1f4PTlq3RRK16aS1c4d3uwmd98sgGoMtym5r3pMW+nNfzS7mAKSIke6DGBIT9xz JDcPk1OJLCRbBKw1S+gIyprjmzaeIGToWxOu6BH34zR/EVgZssZCR7qRAPoH/xdQNz+R GfgKUg45M7091g1bbHPQG0KOTPgZKYT+ATVCb2wyCdYPIQC7+4nXqmAt0+yhSRwejYWd A6BA== MIME-Version: 1.0 X-Received: by 10.182.78.41 with SMTP id y9mr12428548obw.69.1366566160483; Sun, 21 Apr 2013 10:42:40 -0700 (PDT) Received: by 10.60.50.40 with HTTP; Sun, 21 Apr 2013 10:42:40 -0700 (PDT) In-Reply-To: <10A84606-654D-4FBC-A66D-40BA39916061@gmail.com> References: <10A84606-654D-4FBC-A66D-40BA39916061@gmail.com> Date: Sun, 21 Apr 2013 17:42:00 -0000 Message-ID: Subject: Re: gold linker: Access section start & end address w/o using a linker script From: Ian Lance Taylor To: Raphael Zulliger Cc: "binutils@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQknAUN5BMpG/AnUN0TR8SdHXZ+NZ05fyz2V96yYguxIPTl7mR5HDj/t6XOmZkwBDvRzoFLmj9w5bIHb+8o07hMIm9ojbYkln5sxUvKo3AHxJ/PqA6Pu+zbKflDBgRPKJm42bMo8IOgd47+n/sCpwxZViKVn63S7RhqJJhWCLaBoiRsBrv5upmBdzSYu4iZpmt7Mw5Gq X-SW-Source: 2013-04/txt/msg00214.txt.bz2 On Sun, Apr 21, 2013 at 9:04 AM, Raphael Zulliger wrote: > > 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 b= fd linker. But the "gold style of linking" is to avoid using linker scripts= . Am I roughly right with this conclusion? Yes. > 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 a= ddress and end address of certain sections, such as data, sbss, etc. We nee= d to know these addresses in order to create copies of these section during= startup to support 'soft reset OS' features. 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. Ian