This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld script to emulparams conversion
- From: "Austin, Alex" <Alex dot Austin at spectrumdsi dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 3 Nov 2008 13:55:39 -0600
- Subject: ld script to emulparams conversion
- Accept-language: en-US
- Acceptlanguage: en-US
Hello, all.
We have a vendor-provided LD script for a proprietary OS that looks like the following.
Anyway, I'm trying to build an internal gcc toolchain that'll make things a bit easier for us. Right now, I'm trying to write the ld/emulparams/myos_arm.sh and I'm not really sure what to do differently with .rodata, .glue_7t, etc.
Any hints? Are emulparams well defined somewhere? So far, I'm basing my work on:
http://wiki.osdev.org/OS_Specific_Toolchain
Thanks,
- Alex
ENTRY (custom_entry_name)
MEMORY {
ROM_MAP (rx) : ORIGIN= 0xACONSTANT, LENGTH=8192k
RAM_MAP (!rx): ORIGIN= 0xAVARIABLE, LENGTH=8192k
/* AVARIABLE could be one of two values, preferably determined by a GCC command line switch */
}
PHDRS { applic PT_LOAD;}
SECTIONS
{
.cust_header :
{
Mos_header.o (.rodata*)
} > ROM_MAP :appli
.text :
{
PROVIDE(A_Custom_Symbol = .);
*( .text)
*( .rodata*)
PROVIDE(Another_Cystom_Symbol = .);
PROVIDE(Yet_Another_Sym = SIZEOF(.text));
*(.glue_7t) *(.glue_7)
_etext = .;
} > ROM_MAP : appli
.data : AT (_etext)
{
PROVIDE(Cutom_data_Symbol = .);
*(.data)
PROVIDE(Another_Custom_Data_Symbol = .);
PROVIDE(Yet_Another_Data_Sym = SIZEOF(.data));
} > RAM_MAP : appli
.bss :
{
PROVIDE(Custom_BSS_Symbol = .);
*( .bss)
*( COMMON)
PROVIDE(Another_Custom_BSS_Symbol = .);
PROVIDE(Yet_Another_BSS_Sym = SIZEOF(.bss));
} > RAM_MAP : appli
.uninit (NOLOAD) :
{
PROVIDE(Custom_Uninit_Symbol = .);
* (UNINIT)
PROVIDE(Another_Custom_Uninit_Symbol = .);
PROVIDE(end = .);
PROVIDE(Yet_Another_Uninit_Sym = SIZEOF(.uninit));
} > RAM_MAP :appli
. = ALIGN(4);
}