I ported the add_gnu_debuglink and fix_empty_sec_hdr_flags
work arounds from the hotspot repo to the jdk repo. Of course,
the Makefiles for the temporary tools and the Makefile logic
changes to use the temporary tools needed tweaking.
The fix_empty_sec_hdr_flags tool is used before
"$(OBJCOPY) --only-keep-debug" is called to create the
object's .debuginfo file. The fix_empty_sec_hdr_flags
work around prevents $(OBJCOPY) from blowing up on
empty section headers which has been only seen on
Solaris X64. However, fix_empty_sec_hdr_flags is called
on all Solaris platforms just because I've gotten paranoid
The add_gnu_debuglink tool is used instead of
"$(OBJCOPY) --add-gnu-debuglink=..." and it only adds
the .gnu_debuglink section and makes the minimal changes
necessary to add a new section (counter and offset updates).
I built a test JPRT job and ran the test program on
test machine hsdev-mwm-2.us. The test program worked.
I replaced libmanagement.so from my JPRT job with the
libmanagement.so from the latest JDK8 bits and the
test program failed. I restored the libmanagement.so
from the JPRT job and the test program worked again.
I think these experiments confirm that there is yet
another gobjcopy problem. Dean's theory is that the
SUNW_cap section is critical to libmanagement.so and
that got trashed by $(OBJCOPY) --add-gnu-debuglink=..."