This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
cannot hide (make local) symbols using --version-script
- From: "William J. Schilp, Ph.D." <wschilp at cadence dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 23 Sep 2003 11:17:34 -0400
- Subject: cannot hide (make local) symbols using --version-script
- Organization: Cadence Design Systems, Inc.
- Reply-to: wschilp at cadence dot com
i'm compiling using gcc 2.96 and ld version 2.11. i've tried ld version
2.12 and 2.14. i'm using redhat 7.2.
the problem is trying to make local some symbols. i have a simple testcase:
int main()
{
int count = 0;
for(count=0; count < 4; ++count) {
testcount(count);
testcount2(count);
}
}
int testcount(int mine)
{
if(mine == 1) {
++mine;
}
}
int testcount2(int mine)
{
if(mine == 2) {
--mine;
}
}
my version script file is:
VERS_1.0 {
global:
testcount;
local:
testcount2;
};
i compile the c files as such:
gcc -o test.o test.c
i use ld as such:
ld --version-scipt=mapfile -o stuff.o test.o -r
when i use nm on stuff.o, the output is identical to the output of nm on
test.o:
00000000 t gcc2_compiled.
00000000 T main
00000044 T testcount
00000054 T testcount2
testcount2 is global instead of local as defined in the mapfile, my
version-script file. this is causing problems for me on my real object
code since external symbols are colliding.
any help would be appreciated.
thanks,
bill schilp
--
William J. Schilp, Ph.D.
Member of Consulting Staff
NC-Verilog
Cadence Design Systems, Inc.
270 Billerica Rd.
Chelmsford, MA 01824
Phone: (978)262-6382
wschilp@cadence.com <mailto:wschilp@cadence.com>
www.cadence.com <http://www.cadence.com>
<mailto:wschilp@cadence.com>
--
William J. Schilp, Ph.D.
Member of Consulting Staff
NC-Verilog
Cadence Design Systems, Inc.
270 Billerica Rd.
Chelmsford, MA 01824
Phone: (978)262-6382
wschilp@cadence.com <mailto:wschilp@cadence.com>
www.cadence.com <http://www.cadence.com>
<mailto:wschilp@cadence.com>