lol lol
lol lol

Reputation: 491

How can I prevent interleaving sections in a linker script?

I’m working with a linker script and I need to ensure that two specific sections, .feature.rodata and .feature.text, are placed contiguously in memory without any other sections (like .eh_frame) being interleaved between them.

Here’s a snippet of my linker script:

SECTIONS
{
    .feature.rodata ALIGN(PAGE_SIZE) : {
        _feature_rodata_start = .;
        KEEP(*(.feature.rodata))
        _feature_rodata_end = .;
    } = 0x0

    .feature.text ALIGN(PAGE_SIZE) : {
        _feature_text_start = .;
        KEEP(*(.feature.text))
        _feature_text_end = .;
    } = LINKER_INFINITE_LOOP_OPCODE
}

Upvotes: 0

Views: 38

Answers (0)

Related Questions