[8u] RFR: 8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped

Andrew Hughes gnu.andrew at redhat.com
Sun Jul 15 02:11:52 UTC 2018

On 6 July 2018 at 09:26, Severin Gehwolf <sgehwolf at redhat.com> wrote:
> Hi David,
> On Fri, 2018-07-06 at 11:53 +1000, David Holmes wrote:
>> Hi Severin,
>> On 6/07/2018 2:41 AM, Severin Gehwolf wrote:
>> > Hi,
>> >
>> > Please review this 8u-only change. JDK 10+ are not affected.
>> >
>> > For JDK 8 builds which don't perform any debug info stripping no
>> > .gnu_debuglink sections should get generated. The fix is to move the
>> > objcopy --add-gnu-debuglink calls into branches which actually perform
>> > some stripping: all_strip, min_strip. Thoughts?
>> Has anything changed with the tools here? This has been in place since
>> back in 2011 with 7u2 and 8 GA! Why has it only become an issue now?
> I'm doubtful anything has changed with the tools. This is one of those
> patches which we seem to have been carrying downstream for a very long
> time. My archeology seems to suggest it started to show up in Fedora 23
> in November 2016. If anything, we'd be to blame to not push this fix
> upstream earlier.

The issue of 'no_strip' not being respected is a lot older than that
and has been
discussed on these lists at length before (e.g. [0] [1] [2]). The
impression I got
back that was that change was not wanted upstream and we should hack around
the defaults with various environment variables.

This fix only seems to make things more confusing. The .gnu_debuglink section
is now only created when STRIP_POLICY is 'all_strip' or 'min_strip', but the
debuginfo file is created for any value of STRIP_POLICY. The result is that
other values of STRIP_POLICY will create a debuginfo file that is not linked
to the original object. That seems like a regression from what happened

defs.make refers to a 'no_strip' value for STRIP_POLICY, but it is never
checked for elsewhere in the build, as far as I can see. I feel that the clearer
logic in these files would be:

  ifneq ($(STRIP_POLICY),no_strip)
    $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
    $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@

as I first suggested in 2012 [3] and this is how we fixed it in
IcedTea years ago.

[0] http://mail.openjdk.java.net/pipermail/build-dev/2012-September/006680.html
[1] http://mail.openjdk.java.net/pipermail/build-infra-dev/2013-March/003186.html
[2] http://mail.openjdk.java.net/pipermail/build-dev/2014-February/012019.html
[3] http://mail.openjdk.java.net/pipermail/build-dev/2012-September/006695.html
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Web Site: http://fuseyism.com
Twitter: https://twitter.com/gnu_andrew_java
PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222

More information about the hotspot-dev mailing list