From owner-freebsd-ia64 Thu Feb 6 18:10:16 2003 Delivered-To: freebsd-ia64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8238F37B401 for ; Thu, 6 Feb 2003 18:10:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A023443F85 for ; Thu, 6 Feb 2003 18:10:10 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h172AANS099251 for ; Thu, 6 Feb 2003 18:10:10 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h172AAER099250; Thu, 6 Feb 2003 18:10:10 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90D8437B401 for ; Thu, 6 Feb 2003 18:04:50 -0800 (PST) Received: from caduceus.sc.intel.com (fmr04.intel.com [143.183.121.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A03043F85 for ; Thu, 6 Feb 2003 18:04:50 -0800 (PST) (envelope-from adsharma@unix-os.sc.intel.com) Received: from talaria.sc.intel.com (talaria.sc.intel.com [10.3.253.5]) by caduceus.sc.intel.com (8.11.6/8.11.6/d: outer.mc,v 1.51 2002/09/23 20:43:23 dmccart Exp $) with ESMTP id h1723o518071 for ; Fri, 7 Feb 2003 02:03:50 GMT Received: from unix-os.sc.intel.com (unix-os.sc.intel.com [143.183.96.244]) by talaria.sc.intel.com (8.11.6/8.11.6/d: inner.mc,v 1.28 2003/01/13 19:44:39 dmccart Exp $) with ESMTP id h1720mR27637 for ; Fri, 7 Feb 2003 02:00:48 GMT Received: (from adsharma@localhost) by unix-os.sc.intel.com (8.11.6/8.11.2) id h1724nZ09232 for FreeBSD-gnats-submit@freebsd.org; Thu, 6 Feb 2003 18:04:49 -0800 Message-Id: <20030206180449.A9223@unix-os.sc.intel.com> Date: Thu, 6 Feb 2003 18:04:49 -0800 From: Arun Sharma To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ia64/48024: function pointer has different values in libraries vs main program Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 48024 >Category: ia64 >Synopsis: function pointer has different values in libraries vs main program >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-ia64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 06 18:10:10 PST 2003 >Closed-Date: >Last-Modified: >Originator: Arun Sharma >Release: FreeBSD 5.0-CURRENT ia64 >Organization: Myself >Environment: System: FreeBSD adsharma-ia64 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Wed Jan 22 12:40:09 GMT 2003 adsharma@adsharma-ia64:/usr/src/sys/ia64/compile/bigsur ia64 >Description: The program below prints different values for the value of &foo1, when called from a shared lib vs main program. >How-To-Repeat: unshar make ./main >Fix: Not known yet. # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # test # test/foo.c # test/main.c # test/Makefile # echo c - test mkdir -p test > /dev/null 2>&1 echo x - test/foo.c sed 's/^X//' >test/foo.c << 'END-of-test/foo.c' X#include X Xint Xfoo1() X{ X} X Xint Xfoo() X{ X int (*fptr)(); X X fptr = &foo1; X X printf("foo1 is at %lx: \n", foo1); X} END-of-test/foo.c echo x - test/main.c sed 's/^X//' >test/main.c << 'END-of-test/main.c' X#include X X Xextern int foo1(); X Xmain() X{ X int (*fptr)(); X X foo(); X fptr = &foo1; X printf("foo1 is at %lx: \n", foo1); X} END-of-test/main.c echo x - test/Makefile sed 's/^X//' >test/Makefile << 'END-of-test/Makefile' Xall: X gcc -c -fPIC foo.c -o foo.o X gcc -shared foo.o -o libfoo.so X gcc main.c -L. -lfoo -o main X END-of-test/Makefile exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message