lsb

s390(x) ELF ABI issue: calling convention for function pointer arguments

Bug #1335181 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lsb
In Progress
Medium
Unassigned
Mandriva
In Progress
Low

Bug Description

Both the S/390 and zSeries ELF ABI specification contain incorrect text
describing the calling convention with regard to arguments of function pointer
type.

In section "Parameter passing", both documents provide a description of an
algorithm to determine how to pass arguments of certain types. This algorithm
contains the lines:

  A SIMPLE_ARG is one of the following:
    [...]
    * A pointer to an object of any type.
    [...]

If read according to a strict interpretation of the terms according to the C
standard, "a pointer to an object of any type" does not include function
pointers, so those would not be covered by the SIMPLE_ARG rule (and thus passed
on the stack instead of in general purpose registers).

This is incorrect. The intent has always been that function pointers are
passed as argument in the same fashion as object pointers (in general purpose
registers), and all existing implementations do it that way.

I'd suggest the specification be brought in line with the original intent and
outstanding implementations by changing the line:
    A pointer to an object of any type.
to
    Any pointer type.

Tags: elf s390 update
Changed in mandriva:
importance: Unknown → Low
status: Unknown → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.