Message ID | 20160408170629.GY15411@char.us.oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 08.04.16 at 19:06, <konrad.wilk@oracle.com> wrote: > "Since you put the notes into .rodata anyway, why name the section .note" > > Perhaps you mean - why name the section .note.gnu_build-id ? Sure - .note or .note.*. > So that when xen.efi is linked with this build_id.o (in v5, now called > notes.o in v6) > it can encapsulate __note_gnu_build_id_start and __note_gnu_build_id_end > around > it. I could change for EFI builds the xen.lds.S to be: > > *(.rodata.*) > +#if defined(BUILD_ID) && defined(EFI) > +/* > + * No mechanism to put an PT_NOTE in the EFI file - so put > + * it in .data section. > + */ > + . = ALIGN(4); > + > + __note_gnu_build_id_start = .; > + *(.rodata.note.gnu.build-id) > + __note_gnu_build_id_end = .; > + *(.note) > + *(.note.*) > +#endif > > But then it differes from the change for !EFI (Which would be naturally > called .note.gnu.build-id). But that looks to be the right approach, accounting for the differences between ELF and COFF/PE. And btw., unless you did changes elsewhere I don't think this inclusion of .note and .note.* here would have the effect you want it to have. Jan
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 5eb825e..3b4fd15 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -31,6 +31,9 @@ OUTPUT_ARCH(i386:x86-64) PHDRS { text PT_LOAD ; +#if defined(BUILD_ID) + note PT_NOTE ; +#endif } SECTIONS { @@ -96,8 +99,18 @@ SECTIONS *(.lockprofile.data) __lock_profile_end = .; #endif - _erodata = .; } :text +#if defined(BUILD_ID) + .rodata.note : { + . = ALIGN(4); + __note_gnu_build_id_start = .; + *(.note.gnu.build-id) + __note_gnu_build_id_end = .; + *(.note) + *(.note.*) + } :note :text +#endif + _erodata = .; #ifdef EFI . = ALIGN(MB(2));