Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8206425

.gnu_debuglink sections added unconditionally when no debuginfo is stripped

    XMLWordPrintable

Details

    • b02

    Backports

      Description

        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

        Attachments

          Issue Links

            Activity

              People

                sgehwolf Severin Gehwolf
                sgehwolf Severin Gehwolf
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: