Ignore:
Timestamp:
2018-03-30T21:35:15Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1433ecda
Parents:
5b8f731
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/riscv64/_link.ld.in

    r5b8f731 r47b2d7e3  
    55#ifdef LOADER
    66        interp PT_INTERP;
     7#endif
    78        text PT_LOAD FILEHDR PHDRS FLAGS(5);
    8 #else
    9         text PT_LOAD FLAGS(5);
    10 #endif
    119        data PT_LOAD FLAGS(6);
    1210        debug PT_NOTE;
     
    1513SECTIONS {
    1614#ifdef LOADER
    17         . = 0x70001000 + SIZEOF_HEADERS;
     15        . = SEGMENT_START("text-segment", 0x70400000);
    1816#else
    19         . = 0x1000 + SIZEOF_HEADERS;
     17        . = SEGMENT_START("text-segment", 0x400000);
    2018#endif
     19#ifndef SHLIB
     20        PROVIDE (__executable_start = .);
     21#endif
     22        . = . + SIZEOF_HEADERS;
    2123
    2224        .text : {
Note: See TracChangeset for help on using the changeset viewer.