public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Raphael Zulliger <zulli73@gmail.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: gold linker: Access section start & end address w/o using a linker script
Date: Sun, 21 Apr 2013 16:04:00 -0000	[thread overview]
Message-ID: <10A84606-654D-4FBC-A66D-40BA39916061@gmail.com> (raw)

Hi

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 scripts. Am I roughly right with this conclusion?

Assuming 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 address and end address of certain sections, such as data, sbss, etc. We need to know these addresses in order to create copies of these section during startup to support 'soft reset OS' features. Moreover, according to my understanding, gcc itself requires certain such symbols when compiled for powerpc-*-eabi from gcc 4.7.2 sources: libgcc/config/rs6000/eabi.S:
…
/* Do any initializations needed for the eabi environment */

	.section ".text"
	#include "ppc-asm.h"

#ifndef __powerpc64__

	 .section ".got2","aw"
	.align	2
.LCTOC1 = . /* +32768 */

/* Table of addresses */
.Ltable = .-.LCTOC1
	.long	.LCTOC1				/* address we are really at */

.Lsda = .-.LCTOC1
	.long	_SDA_BASE_			/* address of the first small data area */

.Lsdas = .-.LCTOC1
	.long	__SDATA_START__			/* start of .sdata/.sbss section */
...


Finally, the question: What is the concept of gold to support the symbols as required by gcc and to create "project-specific" symbols at the start and end of sections? Should we continue using linker scripts or is there something else we can/should do?

Thanks,
Raphael

             reply	other threads:[~2013-04-21 16:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-21 16:04 Raphael Zulliger [this message]
2013-04-21 17:42 ` Ian Lance Taylor
2013-04-21 19:27   ` Raphael Zulliger
2013-04-21 19:42     ` Ian Lance Taylor
2013-04-22 11:39       ` Raphael Zulliger
2013-04-22 17:51         ` Ian Lance Taylor
2013-05-12 12:08           ` Raphael Zulliger
2014-02-02  1:20           ` Kevin
2014-02-02  4:59             ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10A84606-654D-4FBC-A66D-40BA39916061@gmail.com \
    --to=zulli73@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).