Changeset 47b2d7e3 in mainline for uspace/lib/c/arch/ia32/_link.ld.in


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/ia32/_link.ld.in

    r5b8f731 r47b2d7e3  
    77#if defined(LOADER) || defined(DLEXE)
    88        interp PT_INTERP;
     9#endif
    910        text PT_LOAD FILEHDR PHDRS FLAGS(5);
    10 #else
    11         text PT_LOAD FLAGS(5);
    12 #endif
    1311        data PT_LOAD FLAGS(6);
    1412        tls PT_TLS;
     
    2119SECTIONS {
    2220#ifdef LOADER
    23         . = 0x70001000 + SIZEOF_HEADERS;
     21        . = SEGMENT_START("text-segment", 0x70400000);
    2422#else
    25         . = 0x1000 + SIZEOF_HEADERS;
     23        . = SEGMENT_START("text-segment", 0x400000);
    2624#endif
     25#ifndef SHLIB
     26        PROVIDE (__executable_start = .);
     27#endif
     28        . = . + SIZEOF_HEADERS;
    2729
    2830        .init : {
Note: See TracChangeset for help on using the changeset viewer.