lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 1433ecda was 47b2d7e3, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago |
Always load ELF headers as part of the text segment.
This forces us to align the start of the text segment to its
declared alignment, otherwise the linker would be forced to allocate
address 0, which the kernel doesn't allow.
Instead of setting the start differently based on each platform's
declared text alignment, set it always to 0x400000 (4 MB),
which is greater than the largest alignment among the currently
supported platforms (amd64, 2MB alignment), and also aligns with
large pages on all platforms that support them.
|
-
Property mode
set to
100644
|
File size:
888 bytes
|
Line | |
---|
1 | STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
|
---|
2 | ENTRY(__entry)
|
---|
3 |
|
---|
4 | PHDRS {
|
---|
5 | #ifdef LOADER
|
---|
6 | interp PT_INTERP;
|
---|
7 | #endif
|
---|
8 | text PT_LOAD FILEHDR PHDRS FLAGS(5);
|
---|
9 | data PT_LOAD FLAGS(6);
|
---|
10 | }
|
---|
11 |
|
---|
12 | SECTIONS {
|
---|
13 | #ifdef LOADER
|
---|
14 | . = SEGMENT_START("text-segment", 0x70400000);
|
---|
15 | #else
|
---|
16 | . = SEGMENT_START("text-segment", 0x400000);
|
---|
17 | #endif
|
---|
18 | #ifndef SHLIB
|
---|
19 | PROVIDE (__executable_start = .);
|
---|
20 | #endif
|
---|
21 | . = . + SIZEOF_HEADERS;
|
---|
22 |
|
---|
23 | .init : {
|
---|
24 | *(.init);
|
---|
25 | } :text
|
---|
26 |
|
---|
27 | .text : {
|
---|
28 | *(.text .text.*);
|
---|
29 | *(.rodata .rodata.*);
|
---|
30 | } :text
|
---|
31 |
|
---|
32 | #ifdef LOADER
|
---|
33 | .interp : {
|
---|
34 | *(.interp);
|
---|
35 | } :interp :text
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | . = . + 0x1000;
|
---|
39 |
|
---|
40 | .data : {
|
---|
41 | *(.opd);
|
---|
42 | *(.data .data.*);
|
---|
43 | *(.sdata);
|
---|
44 | } :data
|
---|
45 |
|
---|
46 | .tdata : {
|
---|
47 | _tdata_start = .;
|
---|
48 | *(.tdata);
|
---|
49 | _tdata_end = .;
|
---|
50 | _tbss_start = .;
|
---|
51 | *(.tbss);
|
---|
52 | _tbss_end = .;
|
---|
53 | } :data
|
---|
54 |
|
---|
55 | _tls_alignment = ALIGNOF(.tdata);
|
---|
56 |
|
---|
57 | .bss : {
|
---|
58 | *(.sbss);
|
---|
59 | *(.scommon);
|
---|
60 | *(COMMON);
|
---|
61 | *(.bss);
|
---|
62 | } :data
|
---|
63 |
|
---|
64 | /DISCARD/ : {
|
---|
65 | *(*);
|
---|
66 | }
|
---|
67 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.