From 34174843695ce2380fed2bddb1c631be97420f8d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 22 Feb 2011 12:31:48 -0500 Subject: [PATCH] markers: ensure assembly is portable by using .hword instead of .word http://www.chemie.fu-berlin.de/chemnet/use/info/gas/gas_7.html .hword expressions This expects zero or more expressions, and emits a 16 bit number for each. This directive is a synonym for `.short'; depending on the target architecture, it may also be a synonym for `.word'. (caused marker struct layout discrepancy on ARM) Signed-off-by: Mathieu Desnoyers --- include/ust/marker.h | 4 ++-- include/ust/processor.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ust/marker.h b/include/ust/marker.h index c565268d..c82dd30d 100644 --- a/include/ust/marker.h +++ b/include/ust/marker.h @@ -113,8 +113,8 @@ struct marker { _ASM_PTR "(__mstrtab_" __stringify(channel) "_" __stringify(name) "_format_" __stringify(unique) ")\n\t" /* format string */ \ ".byte 0\n\t" /* state imv */ \ ".byte 0\n\t" /* ptype */ \ - ".word 0\n\t" /* channel_id */ \ - ".word 0\n\t" /* event_id */ \ + ".hword 0\n\t" /* channel_id */ \ + ".hword 0\n\t" /* event_id */ \ ".balign " __stringify(__WORDSIZE) " / 8\n\t" /* alignment */ \ _ASM_PTR "(marker_probe_cb)\n\t" /* call */ \ _ASM_PTR "(__mark_empty_function)\n\t" /* marker_probe_closure single.field1 */ \ diff --git a/include/ust/processor.h b/include/ust/processor.h index 098e6b3e..8a01a886 100644 --- a/include/ust/processor.h +++ b/include/ust/processor.h @@ -293,7 +293,7 @@ static inline int fls(int x) /* Start TLS access of private reg stack pointer */ \ ".byte 0x66\n\t" \ "leaq ust_reg_stack_ptr@tlsgd(%%rip), %%rdi\n\t" \ - ".word 0x6666\n\t" \ + ".hword 0x6666\n\t" \ "rex64\n\t" \ "call __tls_get_addr@plt\n\t" \ /* --- End TLS access */ \ @@ -305,7 +305,7 @@ static inline int fls(int x) /* Start TLS access of private reg stack */ \ ".byte 0x66\n\t" \ "leaq ust_reg_stack@tlsgd(%%rip), %%rdi\n\t" \ - ".word 0x6666\n\t" \ + ".hword 0x6666\n\t" \ "rex64\n\t" \ "call __tls_get_addr@plt\n\t" \ /* --- End TLS access */ \ -- 2.34.1