Skip to contentSkip to conversation

libelf.h and elfstructs.h

DISCUSSION Jan Beulich 2 participants 3 messages Dec 22, 2008 – Jan 8, 2009

lore
Share & tools
lore
#0 lore raw

What is the reason for these two to be part of the public (interface) headers? Using them anywhere outside of the Xen tree could easily conflict with the various other ELF headers used in different environments.

Thanks, Jan

#1 lore raw
Quoted 3 lines · Jan Beulich

What is the reason for these two to be part of the public (interface) headers? Using them anywhere outside of the Xen tree could easily conflict with the various other ELF headers used in different environments.

Gerd probably put them there for consumption, privately, by libxenguest. Same as libxenguest hoovers up Xen's common/libelf.

I'd be happy to see those headers moved into include/xen/ or include/xen/libelf, and have libxenguest grab them from there...

-- Keir

#2 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 22.12.08 11:36 >>>

Quoted 3 lines · Jan Beulich

What is the reason for these two to be part of the public (interface) headers? Using them anywhere outside of the Xen tree could easily conflict with the various other ELF headers used in different environments.

Quoted 5 lines

Gerd probably put them there for consumption, privately, by libxenguest. Same as libxenguest hoovers up Xen's common/libelf.

I'd be happy to see those headers moved into include/xen/ or include/xen/libelf, and have libxenguest grab them from there...

Assumes the libelf.h change accompanying the XEN_ELFNOTE_INIT_P2M addition is present.

tools/include/Makefile +2 -1
@@ -10,11 +10,12 @@ xen-foreign:
 
 xen/.dir:
 	@rm -rf xen
-	mkdir xen
+	mkdir -p xen/libelf
 	ln -sf ../$(XEN_ROOT)/xen/include/public/COPYING xen
 	ln -sf $(addprefix ../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) xen
 	ln -sf $(addprefix ../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) xen
 	ln -sf ../xen-sys/$(XEN_OS) xen/sys
+	ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
 	touch $@
 
tools/libxc/xc_core.h +1 -1
@@ -23,7 +23,7 @@
 
 #include "xen/version.h"
 #include "xg_private.h"
-#include "xen/elfstructs.h"
+#include "xen/libelf/elfstructs.h"
 
 /* section names */
 #define XEN_DUMPCORE_SEC_NOTE                   ".note.Xen"
tools/libxc/xc_dom.h +1 -1
@@ -1,4 +1,4 @@
-#include <xen/libelf.h>
+#include <xen/libelf/libelf.h>
 
 #define INVALID_P2M_ENTRY   ((xen_pfn_t)-1)
 
tools/libxc/xc_elf.h +1 -1
@@ -1 +1 @@
-#include <xen/elfstructs.h>
+#include <xen/libelf/elfstructs.h>
tools/libxc/xc_hvm_build.c +1 -1
@@ -17,7 +17,7 @@
 #include <xen/hvm/params.h>
 #include "xc_e820.h"
 
-#include <xen/libelf.h>
+#include <xen/libelf/libelf.h>
 
 #define SUPERPAGE_PFN_SHIFT  9
 #define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
tools/xcutils/readnotes.c +1 -1
@@ -13,7 +13,7 @@
 #include <xg_private.h>
 #include <xc_dom.h> /* gunzip bits */
 
-#include <xen/libelf.h>
+#include <xen/libelf/libelf.h>
 
 static void print_string_note(const char *prefix, struct elf_binary *elf,
 			      const elf_note *note)
xen/arch/ia64/xen/domain.c +1 -1
@@ -31,7 +31,7 @@
 #include <xen/event.h>
 #include <xen/console.h>
 #include <xen/version.h>
-#include <public/libelf.h>
+#include <xen/libelf.h>
 #include <asm/pgalloc.h>
 #include <asm/offsets.h>  /* for IA64_THREAD_INFO_SIZE */
 #include <asm/vcpu.h>   /* for function declarations */
xen/arch/x86/boot/mkelf32.c +1 -1
@@ -25,7 +25,7 @@
 #define s16 int16_t
 #define s32 int32_t
 #define s64 int64_t
-#include "../../../include/public/elfstructs.h"
+#include "../../../include/xen/elfstructs.h"
 
 #define DYNAMICALLY_FILLED   0
 #define RAW_OFFSET         128
xen/arch/x86/domain_build.c +1 -1
@@ -19,6 +19,7 @@
 #include <xen/iocap.h>
 #include <xen/bitops.h>
 #include <xen/compat.h>
+#include <xen/libelf.h>
 #include <asm/regs.h>
 #include <asm/system.h>
 #include <asm/io.h>
@@ -30,7 +31,6 @@
 #include <asm/e820.h>
 
 #include <public/version.h>
-#include <public/libelf.h>
 
 extern unsigned long initial_images_nrpages(void);
 extern void discard_initial_images(void);
xen/common/libelf/libelf-private.h +2 -2
@@ -7,9 +7,9 @@
 #include <xen/types.h>
 #include <xen/string.h>
 #include <xen/lib.h>
+#include <xen/libelf.h>
 #include <asm/byteorder.h>
 #include <public/elfnote.h>
-#include <public/libelf.h>
 
 #define elf_msg(elf, fmt, args ... ) \
    if (elf->verbose) printk(fmt, ## args )
@@ -49,7 +49,7 @@
 #error Unsupported OS
 #endif
 #include <xen/elfnote.h>
-#include <xen/libelf.h>
+#include <xen/libelf/libelf.h>
 
 #include "xenctrl.h"
 #include "xc_private.h"
xen/include/public/elfstructs.h deleted +0 -527

527 lines not on this page · raw message

xen/include/public/libelf.h deleted +0 -266

266 lines not on this page · raw message

xen/include/xen/elf.h +1 -1
@@ -27,7 +27,7 @@
 #ifndef __XEN_ELF_H__
 #define __XEN_ELF_H__
 
-#include <public/elfstructs.h>
+#include <xen/elfstructs.h>
 
 #define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
 #define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
xen/include/xen/elfstructs.h new file +527 -0

527 lines not on this page · raw message

xen/include/xen/libelf.h new file +271 -0

271 lines not on this page · raw message