mirror of
https://github.com/drasko/codezero.git
synced 2026-01-13 19:33:15 +01:00
71 lines
993 B
Plaintext
71 lines
993 B
Plaintext
/*
|
|
* Userspace linker script
|
|
*
|
|
* Copyright (C) 2007 - 2009 Bahadir Balban
|
|
*/
|
|
|
|
virtual_base = %s;
|
|
physical_base = %s;
|
|
|
|
__stack = (virtual_base - 0x1000 - 8); /* First page before the env/args */
|
|
|
|
offset = virtual_base - physical_base;
|
|
|
|
OUTPUT_ARCH(arm)
|
|
ENTRY(_start)
|
|
|
|
PHDRS
|
|
{
|
|
rx PT_LOAD;
|
|
rw PT_LOAD;
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
. = virtual_base;
|
|
|
|
/* Put all RX, RO sections here */
|
|
_start_text = .;
|
|
.text : AT (ADDR(.text) - offset)
|
|
{
|
|
*(.text.head)
|
|
*(.text)
|
|
} : rx = 0x90909090
|
|
|
|
.rodata : AT (ADDR(.rodata) - offset)
|
|
{
|
|
*(.rodata)
|
|
} : rx = 0x90909090
|
|
.rodata1 : AT (ADDR(.rodata1) - offset)
|
|
{
|
|
*(.rodata1)
|
|
} : rx = 0x90909090
|
|
|
|
. = ALIGN(4K);
|
|
|
|
/* Put all RW sections here */
|
|
.data : AT (ADDR(.data) - offset)
|
|
{
|
|
_start_test_exec = .;
|
|
*(.testexec)
|
|
_end_test_exec = .;
|
|
*(.data)
|
|
} : rw
|
|
|
|
.got : AT (ADDR(.got) - offset)
|
|
{
|
|
*(.got)
|
|
} : rw
|
|
|
|
.got.plt : AT (ADDR(.got.plt) - offset)
|
|
{
|
|
*(.got.plt)
|
|
} : rw
|
|
|
|
.bss : AT (ADDR(.bss) - offset)
|
|
{
|
|
*(.bss)
|
|
} : rw
|
|
_end = .;
|
|
}
|