This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[patch] Pushing Inferior Function Arguments onto Stack on PowerPC64 machines


Is Andrew's comment about the ABI correct, or incorrect? Do you know
for sure?
! 		 		       /* WARNING: cagney/2003-09-21: As best I can
! 		 		          tell, the ABI specifies that the value should
! 		 		          be left aligned.  Unfortunately, GCC doesn't
! 		 		          do this - it instead right aligns even sized
! 		 		          values and puts odd sized values on the
! 		 		          stack.  Work around that by putting both a
! 		 		          left and right aligned value into the
! 		 		          register (hopefully no one notices :-^).
! 		 		          Arrrgh!  */

--
Daniel Jacobowitz
CodeSourcery


I am new to this, so my interpretation might not be completely accurate, but the way I read the note below ( a snippet from the GNU GCC Manual about passing function arguments in registers) is that since PPC64 is big endian, even though the default is to pad downward (i.e. right align), if the size if greater than the size of an int, you need to pad upward (left align).
.......


FUNCTION_ARG_PADDING (mode, type)
If defined, a C expression which determines whether, and in which direction, to pad out an argument with extra space. The value should be of type enum direction: either upward to pad above the argument, downward to pad below, or none to inhibit padding.


The amount of padding is always just enough to reach the next multiple of FUNCTION_ARG_BOUNDARY; this macro does not control it.

This macro has a default definition which is right for most systems. For little-endian machines, the default is to pad upward. For big-endian machines, the default is to pad downward for an argument of constant size shorter than an int, and upward otherwise.
.....


Janani Janakiraman


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