mirror of https://github.com/acidanthera/audk.git
BaseTools/Scripts/GccBase.lds: Use separate R-W and RW- ELF segments
To prevent the ELF linkers from complaining about emitted ELF segments that require both writable and executable permissions, define two separate R-X and RW- ELF segments, and emit the output sections explicitly into those segments as appropriate. Note that this has no bearing on the PE image, and using a single RW- segment would probably be fine too. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
e5d95c786b
commit
f2b42c83dd
|
@ -10,6 +10,12 @@
|
|||
|
||||
**/
|
||||
|
||||
PHDRS {
|
||||
text PT_LOAD FLAGS(5); /* R_X */
|
||||
data PT_LOAD FLAGS(6); /* RW_ */
|
||||
dynamic PT_DYNAMIC FLAGS(4); /* R__ */
|
||||
}
|
||||
|
||||
SECTIONS {
|
||||
|
||||
/*
|
||||
|
@ -35,7 +41,7 @@ SECTIONS {
|
|||
* emitted GUIDs here.
|
||||
*/
|
||||
*:AutoGen.obj(.data.g*Guid)
|
||||
}
|
||||
} :text
|
||||
|
||||
/*
|
||||
* The alignment of the .data section should be less than or equal to the
|
||||
|
@ -46,19 +52,21 @@ SECTIONS {
|
|||
.data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) {
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
} :data
|
||||
|
||||
.eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : {
|
||||
KEEP (*(.eh_frame))
|
||||
}
|
||||
|
||||
.dynamic : { *(.dynamic) } :data :dynamic
|
||||
|
||||
.rela (INFO) : {
|
||||
*(.rela .rela.*)
|
||||
}
|
||||
|
||||
.hii : ALIGN(CONSTANT(COMMONPAGESIZE)) {
|
||||
KEEP (*(.hii))
|
||||
}
|
||||
} :data
|
||||
|
||||
.got : {
|
||||
*(.got)
|
||||
|
|
Loading…
Reference in New Issue