This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Systemtap's DTRACE_PROBE and clang


On 09/20/2013 02:45 AM, Martin Martin wrote:
> Hi,
> 
> I've been submitting bug reports to Clang to get DTRACE_PROBE to
> compile.  They implemented section flag "?", which solved the first
> problem.

Great!

> The remaining problem is that systemtap is using "note" in place of
> "@note."  llvm-mc only accepts the @note form, which is the only form
> gas is documented to accept:
> https://sourceware.org/binutils/docs/as/Section.html#Section
> (.pushsection refers to the documentation for .section for syntax).
> 
> The clang people write:
> 
> How onerous is it to change the code here? On the other side, it'd be
> helpful to understand why gas is accepting (and people are writing) a
> form of .pushsection that isn't in the documentation.
> 
> Workaround for now, it does work if you change it to:
>   .pushsection .note.stapsdt,"?",@note

Interesting.  I'm not sure why we have "note" rather than @note, but
it's been that way at least since the beginning of Roland's SDTv3
rewrite.  But I just tried @note, like the patch below, and it looks ok
both on Fedora 19 and on RHEL5 (roughly the oldest we support).

I'll run it through our full testsuite, and assuming nothing comes up
then I'm happy to commit the change.


(quoted just so my mailer won't break lines)
> diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
> index ba04c12..c623caf 100644
> --- a/includes/sys/sdt.h
> +++ b/includes/sys/sdt.h
> @@ -173,7 +173,7 @@ __extension__ extern unsigned long long __sdt_unsp;
>  
>  #define _SDT_ASM_BODY(provider, name, pack_args, args)			      \
>    _SDT_ASM_1(990:	_SDT_NOP)					      \
> -  _SDT_ASM_3(		.pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \
> +  _SDT_ASM_3(		.pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,@note)  \
>    _SDT_ASM_1(		.balign 4)					      \
>    _SDT_ASM_3(		.4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE)	      \
>    _SDT_ASM_1(991:	.asciz _SDT_NOTE_NAME)				      \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]