Menu

#4 profil01.c is not 64-bit safe

System Calls
closed-fixed
Testcases (113)
5
2003-05-20
2003-05-20
No

The test profil01.c fails on powerpc64 because it is not 64-
bit safe. It use the int type for bsize and lotext to compute
the size the profil01's text segment. For 64-bit long int is
required.

Also this code does not acount for the use of function
descriptors. For powerpc64 the address of a function is the
address of the function descriptor (which contains the
function entry point address and the functions TOC
pointer). Function descriptors are data and are allocated in
the data section which follows the text.

So for platforms that use function descriptors the
computation &etext - &_start is not correct. &_start is the
address of the function descriptor (in the data section)
which has a higher address then etext. To get the true
address you must dereference the function descriptor to
obtain the function entry point address.

The attached patch fixes profil01.c for powerpc64 but there
may still be issues for other 64-bit and function descriptor
based ABIs.

Discussion

  • Steven Munroe

    Steven Munroe - 2003-05-20

    PATCH make profil01.c 64-bit safe

     
  • Robert Williamson

    • assigned_to: nobody --> robbiew
     
  • Robert Williamson

    • status: open --> closed
     
  • Robert Williamson

    Logged In: YES
    user_id=236704

    Patch applied to the CVS tree.

     
  • Robert Williamson

    • status: closed --> closed-fixed
     

Log in to post a comment.