Thu, 05 Jul 2018 18:27:02 +0200
8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped
Summary: Only add .gnu_debuglink sections when there is some stripping done.
Reviewed-by: erikj, dholmes
johnc@4855 | 1 | /* |
johnc@4855 | 2 | * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
johnc@4855 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
johnc@4855 | 4 | * |
johnc@4855 | 5 | * This code is free software; you can redistribute it and/or modify it |
johnc@4855 | 6 | * under the terms of the GNU General Public License version 2 only, as |
johnc@4855 | 7 | * published by the Free Software Foundation. |
johnc@4855 | 8 | * |
johnc@4855 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
johnc@4855 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
johnc@4855 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
johnc@4855 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
johnc@4855 | 13 | * accompanied this code). |
johnc@4855 | 14 | * |
johnc@4855 | 15 | * You should have received a copy of the GNU General Public License version |
johnc@4855 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
johnc@4855 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
johnc@4855 | 18 | * |
johnc@4855 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
johnc@4855 | 20 | * or visit www.oracle.com if you need additional information or have any |
johnc@4855 | 21 | * questions. |
johnc@4855 | 22 | */ |
johnc@4855 | 23 | |
johnc@4899 | 24 | /* @test TestVerifyDuringStartup.java |
johnc@4855 | 25 | * @key gc |
johnc@5021 | 26 | * @bug 8010463 8011343 8011898 |
johnc@4899 | 27 | * @summary Simple test run with -XX:+VerifyDuringStartup -XX:-UseTLAB to verify 8010463 |
johnc@4855 | 28 | * @library /testlibrary |
johnc@4855 | 29 | */ |
johnc@4855 | 30 | |
johnc@5021 | 31 | import com.oracle.java.testlibrary.JDKToolFinder; |
johnc@4855 | 32 | import com.oracle.java.testlibrary.OutputAnalyzer; |
johnc@4855 | 33 | import com.oracle.java.testlibrary.ProcessTools; |
johnc@5021 | 34 | import java.util.ArrayList; |
johnc@5021 | 35 | import java.util.Collections; |
johnc@4855 | 36 | |
johnc@4899 | 37 | public class TestVerifyDuringStartup { |
johnc@4855 | 38 | public static void main(String args[]) throws Exception { |
johnc@5021 | 39 | ArrayList<String> vmOpts = new ArrayList(); |
johnc@5021 | 40 | |
johnc@5021 | 41 | String testVmOptsStr = System.getProperty("test.java.opts"); |
johnc@5021 | 42 | if (!testVmOptsStr.isEmpty()) { |
johnc@5021 | 43 | String[] testVmOpts = testVmOptsStr.split(" "); |
johnc@5021 | 44 | Collections.addAll(vmOpts, testVmOpts); |
johnc@5021 | 45 | } |
johnc@5021 | 46 | Collections.addAll(vmOpts, new String[] {"-XX:-UseTLAB", |
johnc@5021 | 47 | "-XX:+UnlockDiagnosticVMOptions", |
johnc@5021 | 48 | "-XX:+VerifyDuringStartup", |
johnc@5021 | 49 | "-version"}); |
johnc@5021 | 50 | |
ctornqvi@5728 | 51 | System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java")); |
johnc@5021 | 52 | for (int i = 0; i < vmOpts.size(); i += 1) { |
johnc@5021 | 53 | System.out.print(" " + vmOpts.get(i)); |
johnc@5021 | 54 | } |
johnc@5021 | 55 | System.out.println(); |
johnc@5021 | 56 | |
johnc@4855 | 57 | ProcessBuilder pb = |
johnc@5021 | 58 | ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); |
johnc@4855 | 59 | OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
johnc@5021 | 60 | |
johnc@5021 | 61 | System.out.println("Output:\n" + output.getOutput()); |
johnc@5021 | 62 | |
johnc@4855 | 63 | output.shouldContain("[Verifying"); |
johnc@4855 | 64 | output.shouldHaveExitValue(0); |
johnc@4855 | 65 | } |
johnc@4855 | 66 | } |