Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157853 - Bad adress when using -finstrument-functions
Summary: Bad adress when using -finstrument-functions
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc3
Version: 4.0
Hardware: ia64
OS: Linux
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-16 14:35 UTC by Fané Henry
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-05-16 14:59:40 UTC
Target Upstream Version:

Attachments (Terms of Use)
testcase for -finstrument-functions on ia64 (deleted)
2005-05-16 14:38 UTC, Fané Henry
no flags Details

Description Fané Henry 2005-05-16 14:35:50 UTC
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 14:38:40 UTC
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 14:59:40 UTC
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 05:43:30 UTC
Thank you very much.

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