• Jeremy Fitzhardinge's avatar
    [PATCH] x86: put .note.* sections into a PT_NOTE segment in vmlinux · 9c9b8b38
    Jeremy Fitzhardinge authored
    This patch will pack any .note.* section into a PT_NOTE segment in the output
    file.
    
    To do this, we tell ld that we need a PT_NOTE segment.  This requires us to
    start explicitly mapping sections to segments, so we also need to explicitly
    create PT_LOAD segments for text and data, and map the sections to them
    appropriately.  Fortunately, each section will default to its previous
    section's segment, so it doesn't take many changes to vmlinux.lds.S.
    
    This only changes i386 for now, but I presume the corresponding changes for
    other architectures will be as simple.
    
    This change also adds <linux/elfnote.h>, which defines C and Assembler macros
    for actually creating ELF notes.
    Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@xensource.com>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Cc: Hollis Blanchard <hollisb@us.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    9c9b8b38
vmlinux.lds.S 4.64 KB