PHDRS { text PT_LOAD FLAGS(5); /* R_E */ data PT_LOAD FLAGS(6); /* RW_ */ percpu PT_LOAD FLAGS(6); /* RW_ */ init PT_LOAD FLAGS(7); /* RWE */ note PT_NOTE FLAGS(0); /* ___ */ } SECTIONS { . = (0xffffffff80000000 + ALIGN(0x1000000, 0x200000)); .text : AT(ADDR(.text) - 0xffffffff80000000) {...} :text = 0x9090 .notes : AT(ADDR(.notes) - 0xffffffff80000000) {...} :text :note __ex_table : AT(ADDR(__ex_table) - 0xffffffff80000000) {...} :text = 0x9090 ... .data..percpu 0 : AT(__per_cpu_load - 0xffffffff80000000) { } :percpu . = __per_cpu_load + SIZEOF(.data..percpu); ... }
When trying to assign address 0x0 to .data..percpu LLD fails with
"unable to move location counter backward" error. Though it should be safe to do
because script controls segments via PHDRS command by itself.
This patch suggests to change logic we use currently. I think what we can do instead of
restricting moving counter always is to check that all sections in PT_LOAD are in assending order.