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

Re: [Xen-devel] [PATCH] tests/x86emul: Annotate test blobs as executable code



>>> On 24.05.19 at 17:15, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/tools/tests/x86_emulator/Makefile
> +++ b/tools/tests/x86_emulator/Makefile
> @@ -149,7 +149,7 @@ $(addsuffix .h,$(TESTCASES)): %.h: %.c testcase.mk 
> Makefile
>               (echo 'static const unsigned int __attribute__((section(".test, 
> \"ax\", @progbits #")))' \
>                     "$${prefix}_$(arch)$${flavor}[] = {"; \
>                od -v -t x $*.bin | sed -e 's/^[0-9]* /0x/' -e 's/ /, 0x/g' -e 
> 's/$$/,/'; \
> -              echo "};") >>$@.new; \
> +              echo "}; asm(\".type $${prefix}_$(arch)$${flavor}, 
> STT_FUNC;\");") >>$@.new; \

While I think we've sufficiently agreed on future gas behavior
that I'd consider this change fine to make as long as you add
an intermediate step going through STT_NOTYPE, I'd like to note
that your mileage from this will only be about 50%: While the
64-bit blobs will disassemble fine, I'm afraid the 32-bit ones
will be somewhat garbled. Sadly there's no annotation or alike
(like Arm's mapping symbols) that one could use to make
disassemblers switch bitness for separate blocks of code.

Jan
_______________________________________________
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®.