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

Re: [Xen-devel] [PATCH v4 06/20] x86emul: place test blobs in executable section



On 28/02/18 13:00, Jan Beulich wrote:
> This allows the section contents to be disassembled without going
> through any extra hoops, simplifying the analysis of problems in test
> and/or emulation code.
>
> The blobs being emitted as (r/o) data means we need to accept an
> assembler warning here (about the differing section attributes).
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> v3: New.
>
> --- unstable.orig/tools/tests/x86_emulator/Makefile   2017-05-09 
> 10:57:16.000000000 +0200
> +++ unstable/tools/tests/x86_emulator/Makefile        2017-10-16 
> 14:11:41.000000000 +0200
> @@ -91,7 +91,7 @@ $(addsuffix .h,$(TESTCASES)): %.h: %.c t
>               $(MAKE) -f testcase.mk TESTCASE=$* XEN_TARGET_ARCH=$(arch) 
> $*-cflags="$$cflags" all; \
>               prefix=$(shell echo $(subst -,_,$*) | sed -e 
> 's,^\([0-9]\),_\1,'); \
>               flavor=$$(echo $${cflags} | sed -e 's, .*,,' -e 'y,-=,__,') ; \
> -             (echo "static const unsigned int $${prefix}_$(arch)$${flavor}[] 
> = {"; \
> +             (echo 'static const unsigned int 
> __attribute__((section(".test"))) '"$${prefix}_$(arch)$${flavor}[] = {"; \

Given that we're already playing many toolchain games, the following
actually removes the warning you cite in the commit message.

__attribute__((section(".test, \"ax\", @progbits #")))

And it turns out to be clang-compatible as well (although there are many
other bits of the emulator which are not).

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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