[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/3] XENVER_build_id: Provide ld-embedded build-ids



On 11/06/2015 07:36 PM, Konrad Rzeszutek Wilk wrote:
From: Martin Pohlack <mpohlack@xxxxxxxxx>

The mechanism to get this is via the XENVER_build_id and
we add a new subsequent sub-command to retrieve the
binary build-id. The hypercall allows an arbitrary
size (the buffer and len is provided to the hypervisor).

Note that one can also retrieve the value by 'readelf -h xen-syms'.

For EFI builds we re-use the same build-id that the xen-syms
was built with.

Note that there are no changes to the XSM files (dummy.c
and hooks.c) as the priviliged subops fall in the default case.

Since the new sub-ops provides the len parameter in the
arguments to the hypercall we have to modify libxc to allow
copying the arguments before the hypercall. We provide a
new macro that modifies the bounce structure to change
the direction.

snip
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d4e507a..17a4830 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -109,15 +109,19 @@ $(TARGET)-syms: prelink.o xen.lds 
$(BASEDIR)/common/symbols-dummy.o

The above invocation of ld also needs to pass "--build-id=sha1".
Otherwise, the first invocation of tools/symbols has __note_gnu_build_id_end == __note_gnu_build_id_start, which may cause the size of the symbol table to change later when there is actually a build id (presumably due to the way it is compressed?) ultimately resulting in incorrect values in the symbol table.

        $(NM) -pa --format=sysv $(@D)/.$(@F).0 \
                | $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0.S
        $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o
-       $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
+       $(LD) $(LDFLAGS) -T xen.lds -N prelink.o --build-id=sha1 \
            $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
        $(NM) -pa --format=sysv $(@D)/.$(@F).1 \
                | $(BASEDIR)/tools/symbols --sysv --sort --warn-dup 
>$(@D)/.$(@F).1.S
        $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
-       $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
+       $(LD) $(LDFLAGS) -T xen.lds -N prelink.o --build-id=sha1 \
            $(@D)/.$(@F).1.o -o $@
        rm -f $(@D)/.$(@F).[0-9]*


--
Ross Lagerwall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.