1. 03 5月, 2007 1 次提交
  2. 26 9月, 2006 2 次提交
    • I
      [PATCH] Translate asm version of ELFNOTE macro into preprocessor macro · 5091e746
      Ian Campbell 提交于
      I've come across some problems with the assembly version of the ELFNOTE
      macro currently in -mm. (in
      x86-put-note-sections-into-a-pt_note-segment-in-vmlinux.patch)
      
      The first is that older gas does not support :varargs in .macro
      definitions (in my testing 2.17 does while 2.15 does not, I don't know
      when it became supported). The Changes file says binutils >= 2.12 so I
      think we need to avoid using it. There are no other uses in mainline or
      -mm. Old gas appears to just ignore it so you get "too many arguments"
      type errors.
      
      Secondly it seems that passing strings as arguments to assembler macros
      is broken without varargs. It looks like they get unquoted or each
      character is treated as a separate argument or something and this causes
      all manner of grief. I think this is because of the use of -traditional
      when compiling assembly files.
      
      Therefore I have translated the assembler macro into a pre-processor
      macro.
      
      I added the desctype as a separate argument instead of including it with
      the descdata as the previous version did since -traditional means the
      ELFNOTE definition after the #else needs to have the same number of
      arguments (I think so anyway, the -traditional CPP semantics are pretty
      fscking strange!).
      
      With this patch I am able to define elfnotes in assembly like this with
      both old and new assemblers.
      
      	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz, "linux")
      	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz, "2.6")
      	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz, "xen-3.0")
      	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .long,  __PAGE_OFFSET)
      
      Which seems reasonable enough.
      Signed-off-by: NIan Campbell <ian.campbell@xensource.com>
      Acked-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5091e746
    • J
      [PATCH] x86: put .note.* sections into a PT_NOTE segment in vmlinux · 9c9b8b38
      Jeremy Fitzhardinge 提交于
      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: NJeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Hollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9c9b8b38
新手
引导
客服 返回
顶部