This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH 3/6] PowerPC64 sysdep.h tidy


On Mon, Jun 12, 2017 at 03:12:22PM -0300, Tulio Magno Quites Machado Filho wrote:
> Alan Modra <amodra@gmail.com> writes:
> 
> > .align on some targets takes a byte alignment, on others like powerpc,
> > log2 of the byte alignment.  It's a good idea to avoid .align,
> > particularly since x86 and powerpc are different.  This patch fixes
> > the occurrences of .align in powerpc64/sysdep.h, renames DOT_LABEL
> > since the macro doesn't have anything to do with adding dots, removes
> > extraneous semicolons, and fixes some formatting.
[snip]
> Looks good to me, but I have just one question...
> 
> > diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
> > index 4347323..860420e 100644
> > --- a/sysdeps/powerpc/powerpc64/sysdep.h
> > +++ b/sysdeps/powerpc/powerpc64/sysdep.h
> > @@ -106,25 +106,25 @@
> >  # define OPD_ENT(name)	.quad BODY_LABEL (name), .TOC.@tocbase, 0
> >  #endif
> >
> > -#define ENTRY_1(name)	\
> > +#define ENTRY_1(name)				\
> >  	.type BODY_LABEL(name),@function;	\
> >  	.globl name;				\
> >  	.section ".opd","aw";			\
> > -	.align 3;				\
> > -name##: OPD_ENT (name);				\
> > -	.previous;
> > +	.p2align 3;FUNC_LABEL(name):		\
> > +	OPD_ENT (name);				\
> > +	.previous
> 
> I'm just curious: is this format written somewhere or used somewhere else?

If you're referring to the first line change, macros are generally
defined with a single space before the first continuation, or have
that continuation line up with any following continuation
backslashes.  Emacs uses the latter by default with auto-format (at
least my installed emacs does, and it doesn't appear to have
customization that would affect this).

If you're referring to the label change, assembly labels generally
start in the first column (or immediately after a semicolon).  On
targets that don't need a colon to mark a label that matters a lot,
since an identifier starting in the first column is a label and
anything past that is a directive or instruction..  PowerPC isn't such
a target, but it's a good convention to follow.  I know it doesn't
look as nice the way the macro is written now.  Hmm, perhaps I should
change the relevant lines to:

	.p2align 3				\
;FUNC_LABEL(name):				\
	OPD_ENT (name);				\

-- 
Alan Modra
Australia Development Lab, IBM


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