public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gold linker: Access section start & end address w/o using a linker script
@ 2013-04-21 16:04 Raphael Zulliger
  2013-04-21 17:42 ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Raphael Zulliger @ 2013-04-21 16:04 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-02-02  4:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-21 16:04 gold linker: Access section start & end address w/o using a linker script Raphael Zulliger
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

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).