cannot hide (make local) symbols using --version-script
William J. Schilp, Ph.D.
wschilp@cadence.com
Tue Sep 23 15:17:00 GMT 2003
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>
More information about the Binutils
mailing list