mirror of
https://github.com/systemd/systemd.git
synced 2025-02-02 13:47:27 +03:00
elf2efi: ensure minimum gap between .text and other sections
When linking an almost empty binary the linker can merged .text with a later section, creating a RWE segment, that then it rejects.
This commit is contained in:
parent
e18e3c4305
commit
e78fc81d30
@ -6,6 +6,13 @@ SECTIONS {
|
||||
.text ALIGN(CONSTANT(MAXPAGESIZE)) : {
|
||||
*(.text .text.*)
|
||||
}
|
||||
|
||||
/* When linking a minimal addon stub, the linker can merge .text and .dynsym, creating a RWE
|
||||
* segment, and then rejects it. Ensure there's a gap so that we end up with two separate segments.
|
||||
* The alignments for the next sections are only applied if the section exists, so they are not
|
||||
* enough, and we need to have this unconditional one. */
|
||||
. = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||
|
||||
.rodata ALIGN(CONSTANT(MAXPAGESIZE)) : {
|
||||
*(.rodata .rodata.*)
|
||||
*(.srodata .srodata.*)
|
||||
|
Loading…
x
Reference in New Issue
Block a user