Fixed x86-64 long double passing.

long double arguments require 16-byte alignment on the stack, which
requires adjustment when the the stack offset is not an evven number of
8-byte words.
This commit is contained in:
James Lyon
2013-04-26 16:42:12 +01:00
parent 41d76e1fcb
commit 6ee366e765
4 changed files with 206 additions and 123 deletions

View File

@ -645,9 +645,10 @@ void *__va_start(void *fp)
void *__va_arg(struct __va_list_struct *ap,
enum __va_arg_type arg_type,
int size)
int size, int align)
{
size = (size + 7) & ~7;
align = (align + 7) & ~7;
switch (arg_type) {
case __va_gen_reg:
if (ap->gp_offset < 48) {
@ -668,6 +669,7 @@ void *__va_arg(struct __va_list_struct *ap,
case __va_stack:
use_overflow_area:
ap->overflow_arg_area += size;
ap->overflow_arg_area = (char*)((long long)(ap->overflow_arg_area + align - 1) & -(long long)align);
return ap->overflow_arg_area - size;
default: