Bug #4296
dtrace -G mistakingly assigns a function type to symbols
0%
Description
From dtrace-discuss:
Linking vm...
ld: warning: symbol `Universe::_narrow_oop' has differing types:
(file universe.o type=OBJT; file dtrace.o type=FUNC);
ld: warning: symbol `UseCompressedOops' has differing types:
(file universe.o type=OBJT; file dtrace.o type=FUNC);
I found out that this problem only appears with newer version of
DTrace and could break it down to the following small 'extern.d'
DTrace program:
extern UseCompressedOops; dtrace:helper: { this->done = ``UseCompressedOops; }
If I compile it with the following command line:
/usr/sbin/dtrace -64 -D_LP64 -C -I. -G -xlazyload -o /tmp/dtrace.o -s extern.d
and look at the generated object file with 'nm', the results are
different for different DTrace versions:
For dtrace: Sun D 1.4.1
[Index] Value Size Type Bind Other Shndx Name [2] | 0| 2009|OBJT |GLOB |0 |2 |___SUNW_dof [1] | 0| 0|FUNC |GLOB |0 |UNDEF |UseCompressedOops
but for dtrace: Sun D 1.1
[Index] Value Size Type Bind Other Shndx Name [2] | 0| 2007|OBJT |GLOB |0 |2 |___SUNW_dof [1] | 0| 0|NOTY |GLOB |0 |UNDEF |UseCompressedOops
As you can see, the external "UseCompressedOops" symbols type is
"NOTY" for the 1.1 version of DTrace and this doesn't seem to conflict
with the 'OBJT' type the symbol has in the actual library. With the
newer 1.4.1 version of DTrace the type generate by DTrace for
"UseCompressedOops" is "FUNC" and this conflicts with the 'OBJT' type
of the symbol in the library.