x86/link: Don't merge .init.text and .init.data
PATCH v2 1/1 x86/link: Don't merge .init.text and .init.data
c/s 1308f0170c merged .init.text and .init.data, because EFI might properly write-protect r/o sections.
However, that change makes xen-syms unusable for disassembly analysis. In particular, searching for indirect branches as part of the SP2/Spectre mitigation series.
As the merging isn't necessary for ELF targets at all, make it conditional on the EFI side of the build.
---
CC: Jan Beulich <[email protected]>
v2:
* Reimplement using linker ifdefary
--- xen/arch/x86/xen.lds.S | 9 +++++++++ 1 file changed, 9 insertions(+)
xen/arch/x86/xen.lds.S +9 -0
@@ -172,7 +172,11 @@ SECTIONS __2M_init_start = .; /* Start of 2M superpages, mapped RWX (boot only). */ . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; +#ifdef EFI /* EFI wants to merge all of .init.* ELF doesn't. */ DECL_SECTION(.init) { +#else + DECL_SECTION(.init.text) { +#endif _sinittext = .; *(.init.text) /*
@@ -183,7 +187,12 @@ SECTIONS *(.altinstr_replacement) _einittext = .; +#ifdef EFI /* EFI wants to merge all of .init.* ELF doesn't. */ . = ALIGN(SMP_CACHE_BYTES); +#else + } :text + DECL_SECTION(.init.data) { +#endif *(.init.rodata) *(.init.rodata.rel)
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 01.03.18 at 19:33, <[email protected]> wrote:
c/s
1308f0170cmerged .init.text and .init.data, because EFI might properly write-protect r/o sections.
Quoted 8 lines
However, that change makes xen-syms unusable for disassembly analysis. In particular, searching for indirect branches as part of the SP2/Spectre mitigation series.
As the merging isn't necessary for ELF targets at all, make it conditional on the EFI side of the build.
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel