-
Bug
-
Resolution: Fixed
-
P4
-
7u181, 8u172
-
b02
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8208919 | 8u201 | Severin Gehwolf | P4 | Resolved | Fixed | b01 |
JDK-8216739 | emb-8u201 | Severin Gehwolf | P4 | Resolved | Fixed | master |
This is a JDK 8-only bug. In JDK 10+ this is solved with configure option --with-native-debug-symbols=internal which seems to behave correctly.
On JDK 8u, however, the hotspot build adds .gnu_debuglink sections to libjvm.so, libsaproc.so and libjsig.so even in cases where *nothing* is being stripped from files. In such a case adding .gnu_debuglink sections with pointers to files that will never exist is wrong.
One needs to build JDK 8 with no native debug info stripping like this:
$ make [...] POST_STRIP_CMD="" STRIP_POLICY=no_strip
The "no_strip" policy is supposed to instruct the hotspot build to not do any stripping[1].
Then in a resulting build .gnu_debuginfo sections are there:
$ for i in $(find build/linux-x86_64-normal-server-release/images/j2sdk-image/ | grep -E 'libjvm.so|libsaproc.so|libjsig.so'); do echo $i; readelf --sections $i | grep gnu_debuglink; done
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjsig.so
[30] .gnu_debuglink PROGBITS 0000000000000000 00003cbc
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libsaproc.so
[33] .gnu_debuglink PROGBITS 0000000000000000 000212cc
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/server/libjsig.so
[30] .gnu_debuglink PROGBITS 0000000000000000 00003cbc
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/server/libjvm.so
[36] .gnu_debuglink PROGBITS 0000000000000000 13856998
It's expected that libraries don't contain any .gnu_debuglink sections.
[1] http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/ad057f2e3211/make/linux/makefiles/defs.make#l211
On JDK 8u, however, the hotspot build adds .gnu_debuglink sections to libjvm.so, libsaproc.so and libjsig.so even in cases where *nothing* is being stripped from files. In such a case adding .gnu_debuglink sections with pointers to files that will never exist is wrong.
One needs to build JDK 8 with no native debug info stripping like this:
$ make [...] POST_STRIP_CMD="" STRIP_POLICY=no_strip
The "no_strip" policy is supposed to instruct the hotspot build to not do any stripping[1].
Then in a resulting build .gnu_debuginfo sections are there:
$ for i in $(find build/linux-x86_64-normal-server-release/images/j2sdk-image/ | grep -E 'libjvm.so|libsaproc.so|libjsig.so'); do echo $i; readelf --sections $i | grep gnu_debuglink; done
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjsig.so
[30] .gnu_debuglink PROGBITS 0000000000000000 00003cbc
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libsaproc.so
[33] .gnu_debuglink PROGBITS 0000000000000000 000212cc
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/server/libjsig.so
[30] .gnu_debuglink PROGBITS 0000000000000000 00003cbc
build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/server/libjvm.so
[36] .gnu_debuglink PROGBITS 0000000000000000 13856998
It's expected that libraries don't contain any .gnu_debuglink sections.
[1] http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/ad057f2e3211/make/linux/makefiles/defs.make#l211
- backported by
-
JDK-8208919 .gnu_debuglink sections added unconditionally when no debuginfo is stripped
-
- Resolved
-
-
JDK-8216739 .gnu_debuglink sections added unconditionally when no debuginfo is stripped
-
- Resolved
-
- relates to
-
JDK-8207402 Stray *.debuginfo files when not stripping debug info
-
- Resolved
-
-
JDK-8207234 More libraries with .gnu_debuglink sections added unconditionally
-
- Closed
-
-
JDK-7071904 HotSpot: Full Debug Symbols
-
- Closed
-