Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 157853 - Bad adress when using -finstrument-functions
Bad adress when using -finstrument-functions
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc3 (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-05-16 10:35 EDT by Fané Henry
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-16 10:59:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
testcase for -finstrument-functions on ia64 (309 bytes, text/plain)
2005-05-16 10:38 EDT, Fané Henry
no flags Details

  None (edit)
Description Fané Henry 2005-05-16 10:35:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.7.7) Gecko/20050421 Firefox/1.0.3 (Debian package 1.0.3-2)

Description of problem:
I tried to use -finstrument-functions on ia64 itanium processors and adresses seems to be incorrect in functions __cyg_profile_func_enter(...) when I look at nm <my_prog> ouput. The same program works well on ia32.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. gcc -Wall -finstrument-functions -g -o prof prof.c
2. ./prof


Actual Results:  I have an address of a function that I tried to match with the 'nm prof' output.

Expected Results:  Exact matching between the __cyg_profile_func_enter(...) and nm output.

Additional info:
Comment 1 Fané Henry 2005-05-16 10:38:40 EDT
Created attachment 114423 [details]
testcase for -finstrument-functions on ia64

To compile:
gcc -Wall -finstrument-functions -g -o prof prof.c

./prof and try to match with an 'nm prof' output
Comment 2 Jakub Jelinek 2005-05-16 10:59:40 EDT
The arguments are correct.  __cyg_profile_func_{enter,exit}'s first argument
is address of the function that is being entered (resp. exited).
On IA-64, function addresses are function descriptor addresses, so you can
compare them with function addresses in C/C++ code.
If (this_func == (void *) f1) is correct comparison.
If you want to get the .text address of the function body instead, you need
to read it from the function descriptor.  So *(void **)this_func.
Comment 3 Fané Henry 2005-05-17 01:43:30 EDT
Thank you very much.

Note You need to log in before you can comment on or make changes to this bug.