diff --git a/tests/bugs/binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.ppc64le.ko b/tests/bugs/binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.ppc64le.ko new file mode 100644 index 0000000..862fae3 Binary files /dev/null and b/tests/bugs/binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.ppc64le.ko differ diff --git a/tests/bugs/binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.x86_64.ko b/tests/bugs/binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.x86_64.ko new file mode 100644 index 0000000..c68d3c4 Binary files /dev/null and b/tests/bugs/binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.x86_64.ko differ diff --git a/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf b/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf new file mode 100644 index 0000000..ea13ad8 --- /dev/null +++ b/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf @@ -0,0 +1,20 @@ +summary: Test for BZ#1785294 (binutils support secondary relocation sections) +description: | + Bug summary: binutils: support secondary relocation sections [rhel 7.9] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1785294 +contact: + - Milos Prchlik + - Edjunior Machado +duration: 10m + +# Configurable fields +require+: + - grep + - gawk + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1785294 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1804151 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1804149 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1804148 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1801879 diff --git a/tests/bugs/binutils-support-secondary-relocation-sections/test.sh b/tests/bugs/binutils-support-secondary-relocation-sections/test.sh new file mode 100755 index 0000000..e87aa18 --- /dev/null +++ b/tests/bugs/binutils-support-secondary-relocation-sections/test.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1785294-binutils-support-secondary-relocation-sections +# Description: Test for BZ#1785294 (binutils support secondary relocation sections) +# Author: Edjunior Machado +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + rlRun "SOURCE_DIR=$(pwd)" + + buEnterTmpDir + rlPhaseEnd + + rlPhaseStart FAIL "Check support" + rlRun "ARCH=$(arch)" + case "$ARCH" in + x86_64 | ppc64le) + KO_FILE="${SOURCE_DIR}/kpatch-3_10_0-1062-1-15.${ARCH}.ko" + rlLogInfo "KO_FILE=$KO_FILE" + HAS_SUPPORT=1 + ;; + *) + rlLogWarning "Feature not supported on $ARCH" + HAS_SUPPORT=0 + ;; + esac + rlPhaseEnd + +if [ $HAS_SUPPORT = 1 ]; then + rlPhaseStartTest + rlAssertExists $KO_FILE + rlRun "set -o pipefail" 0 "Conserve the non-zero return value through the pipe" + + # As suggested by nickc@redhat.com: + rlRun "objcopy $KO_FILE copy.ko" + rlRun "readelf --wide --section-headers copy.ko |& tee readelf_headers.out" + rlRun -l "grep \".klp.rela.vmlinux.*\ RELA\ \" readelf_headers.out" + + # And as suggested by joe.lawrence@redhat.com: + rlRun "readelf --wide --relocs $KO_FILE |& tee readelf_relocs.out" + rlRun -l "awk \"/^Relocation section '.klp/\" RS='\n\n' ORS='\n\n' readelf_relocs.out" + rlRun -l "grep \"^Relocation section '.klp\" readelf_relocs.out" + + rlRun "readelf --wide --symbols $KO_FILE |& tee readelf_symbols.out" + # Section index for these symbols must be SHN_LIVEPATCH (0xff20) + rlRun -l "grep '\[0xff20\]\ \.klp\.sym' readelf_symbols.out" + + rlRun "tar czvf readelf_outputs.tar.gz readelf_headers.out readelf_relocs.out readelf_symbols.out" + rlFileSubmit readelf_outputs.tar.gz "${PACKAGES}-readelf_outputs.tar.gz" + rlPhaseEnd +fi + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/main.fmf b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/main.fmf new file mode 100644 index 0000000..f39121e --- /dev/null +++ b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/main.fmf @@ -0,0 +1,9 @@ +summary: Tests -pie + -fpie with __thread +contact: + - Milos Prchlik + - Michal Nowak +duration: 5m + +# Configurable fields +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=755872 diff --git a/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh new file mode 100755 index 0000000..b56df29 --- /dev/null +++ b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz755872-fpie-pie-does-not-appear-to-work-with-__thread-variables +# Description: Tests -pie + -fpie with __thread +# Author: Michal Nowak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + testdir="$(pwd)" + buEnterTmpDir + + rlRun "cp -v $testdir/w.c $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -o w -g -O2 -pie -fpie w.c" 0 "Compile __thread with -fpie -pie" + rlAssertExists "w" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/w.c b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/w.c new file mode 100644 index 0000000..7b9bb73 --- /dev/null +++ b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/w.c @@ -0,0 +1,7 @@ +__thread int a; + +int +main(void) +{ + return a; +} diff --git a/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/foo.c b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/foo.c new file mode 100644 index 0000000..cbce2f9 --- /dev/null +++ b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/foo.c @@ -0,0 +1,4 @@ +int __attribute__ ((noinline)) foo(int x, int y) +{ + return x & y; +} diff --git a/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/main.c b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/main.c new file mode 100644 index 0000000..3662069 --- /dev/null +++ b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/main.c @@ -0,0 +1,8 @@ +#include +extern int foo(int, int); + +int main() +{ + printf("%d\n", foo(1, 3)); + return 0; +} diff --git a/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/main.fmf b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/main.fmf new file mode 100644 index 0000000..0d40870 --- /dev/null +++ b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/main.fmf @@ -0,0 +1,11 @@ +summary: RHEL8 gold does not resolve the address of main() +description: | + rhel8 gold does not resolve the address of main() when it is in a shared library in aarch64 +contact: + - Milos Prchlik + - Edjunior Machado +duration: 5m + +# Configurable fields +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1693661 diff --git a/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh new file mode 100755 index 0000000..11bcd11 --- /dev/null +++ b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main +# Description: Test for BZ#1693661 (rhel8 gold does not resolve the address of main()) +# Author: Edjunior Machado +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + testdir="$(pwd)" + buEnterTmpDir + + rlRun "cp -v $testdir/main.c $testdir/foo.c $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -o main.o -fPIC -c main.c" + rlRun "gcc -shared -o libmain.so main.o" + rlRun "gcc -o foo.o -c foo.c" + + rlLogInfo "Linking with gold..." + rlRun "gcc -fuse-ld=gold -o gold.out -lmain -L$PWD -Wl,-v,-rpath=$PWD foo.o" + rlAssertExists "gold.out" + rlRun "./gold.out" # On bz#1693661, it segfaults + + rlLogInfo "Linking with bfd..." + rlRun "gcc -fuse-ld=bfd -o bfd.out -lmain -L$PWD -Wl,-v,-rpath=$PWD foo.o" + rlAssertExists "bfd.out" + rlRun "./bfd.out" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/supported-targets/6_i686_arch b/tests/supported-targets/6_i686_arch new file mode 100644 index 0000000..35f9702 --- /dev/null +++ b/tests/supported-targets/6_i686_arch @@ -0,0 +1,7 @@ +i386 +i386:x86-64 +i8086 +i386:intel +i386:x86-64:intel +l1om +l1om:intel diff --git a/tests/supported-targets/6_i686_tgt b/tests/supported-targets/6_i686_tgt new file mode 100644 index 0000000..8963709 --- /dev/null +++ b/tests/supported-targets/6_i686_tgt @@ -0,0 +1,16 @@ +elf32-i386 +a.out-i386-linux +pei-i386 +elf64-x86-64 +elf64-l1om +elf64-little +elf64-big +elf32-little +elf32-big +srec +symbolsrec +verilog +tekhex +binary +ihex +trad-core diff --git a/tests/supported-targets/6_ppc64_arch b/tests/supported-targets/6_ppc64_arch new file mode 100644 index 0000000..fd3791a --- /dev/null +++ b/tests/supported-targets/6_ppc64_arch @@ -0,0 +1,22 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:MPC8XX +powerpc:750 +spu:256K diff --git a/tests/supported-targets/6_ppc64_tgt b/tests/supported-targets/6_ppc64_tgt new file mode 100644 index 0000000..f15f28b --- /dev/null +++ b/tests/supported-targets/6_ppc64_tgt @@ -0,0 +1,17 @@ +elf64-powerpc +elf64-powerpcle +elf32-powerpc +elf32-powerpcle +aixcoff-rs6000 +aixcoff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +elf32-spu +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/6_s390x_arch b/tests/supported-targets/6_s390x_arch new file mode 100644 index 0000000..9be7e80 --- /dev/null +++ b/tests/supported-targets/6_s390x_arch @@ -0,0 +1,2 @@ +s390:31-bit +s390:64-bit diff --git a/tests/supported-targets/6_s390x_tgt b/tests/supported-targets/6_s390x_tgt new file mode 100644 index 0000000..9007a13 --- /dev/null +++ b/tests/supported-targets/6_s390x_tgt @@ -0,0 +1,13 @@ +elf64-s390 +elf32-s390 +elf64-little +elf64-big +elf32-little +elf32-big +srec +symbolsrec +verilog +tekhex +binary +ihex +trad-core diff --git a/tests/supported-targets/6_x86_64_arch b/tests/supported-targets/6_x86_64_arch new file mode 100644 index 0000000..d306659 --- /dev/null +++ b/tests/supported-targets/6_x86_64_arch @@ -0,0 +1,6 @@ +i386:x86-64 +i8086 +i386:intel +i386:x86-64:intel +l1om +l1om:intel diff --git a/tests/supported-targets/6_x86_64_tgt b/tests/supported-targets/6_x86_64_tgt new file mode 100644 index 0000000..776de6e --- /dev/null +++ b/tests/supported-targets/6_x86_64_tgt @@ -0,0 +1,16 @@ +elf64-x86-64 +elf32-i386 +a.out-i386-linux +pei-i386 +pei-x86-64 +elf64-l1om +elf64-little +elf64-big +elf32-little +elf32-big +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/7_aarch64_arch b/tests/supported-targets/7_aarch64_arch new file mode 100644 index 0000000..40eb53d --- /dev/null +++ b/tests/supported-targets/7_aarch64_arch @@ -0,0 +1,16 @@ +aarch64 +arm +armv2 +armv2a +armv3 +armv3m +armv4 +armv4t +armv5 +armv5t +armv5te +xscale +ep9312 +iwmmxt +iwmmxt2 +plugin diff --git a/tests/supported-targets/7_aarch64_tgt b/tests/supported-targets/7_aarch64_tgt new file mode 100644 index 0000000..f587143 --- /dev/null +++ b/tests/supported-targets/7_aarch64_tgt @@ -0,0 +1,15 @@ +elf64-littleaarch64 +elf64-bigaarch64 +elf32-littlearm +elf32-bigarm +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/7_ppc64_arch b/tests/supported-targets/7_ppc64_arch new file mode 100644 index 0000000..cf3789b --- /dev/null +++ b/tests/supported-targets/7_ppc64_arch @@ -0,0 +1,27 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:e500mc64 +powerpc:MPC8XX +powerpc:750 +powerpc:titan +powerpc:vle +powerpc:e5500 +powerpc:e6500 +plugin diff --git a/tests/supported-targets/7_ppc64_tgt b/tests/supported-targets/7_ppc64_tgt new file mode 100644 index 0000000..19faa60 --- /dev/null +++ b/tests/supported-targets/7_ppc64_tgt @@ -0,0 +1,18 @@ +elf64-powerpc +elf64-powerpcle +elf32-powerpc +elf32-powerpcle +aixcoff-rs6000 +aixcoff64-rs6000 +aix5coff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/7_ppc64le_arch b/tests/supported-targets/7_ppc64le_arch new file mode 100644 index 0000000..cf3789b --- /dev/null +++ b/tests/supported-targets/7_ppc64le_arch @@ -0,0 +1,27 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:e500mc64 +powerpc:MPC8XX +powerpc:750 +powerpc:titan +powerpc:vle +powerpc:e5500 +powerpc:e6500 +plugin diff --git a/tests/supported-targets/7_ppc64le_tgt b/tests/supported-targets/7_ppc64le_tgt new file mode 100644 index 0000000..40dd3f9 --- /dev/null +++ b/tests/supported-targets/7_ppc64le_tgt @@ -0,0 +1,19 @@ +elf64-powerpcle +elf64-powerpc +elf32-powerpcle +elf32-powerpc +aixcoff-rs6000 +aixcoff64-rs6000 +aix5coff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +ppcboot +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/7_s390x_arch b/tests/supported-targets/7_s390x_arch new file mode 100644 index 0000000..1dcd6fa --- /dev/null +++ b/tests/supported-targets/7_s390x_arch @@ -0,0 +1,3 @@ +s390:31-bit +s390:64-bit +plugin diff --git a/tests/supported-targets/7_s390x_tgt b/tests/supported-targets/7_s390x_tgt new file mode 100644 index 0000000..34a9dfd --- /dev/null +++ b/tests/supported-targets/7_s390x_tgt @@ -0,0 +1,14 @@ +elf64-s390 +elf32-s390 +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex +trad-core diff --git a/tests/supported-targets/7_x86_64_arch b/tests/supported-targets/7_x86_64_arch new file mode 100644 index 0000000..b2cf7d6 --- /dev/null +++ b/tests/supported-targets/7_x86_64_arch @@ -0,0 +1,12 @@ +i386 +i386:x86-64 +i386:x64-32 +i8086 +i386:intel +i386:x86-64:intel +i386:x64-32:intel +l1om +l1om:intel +k1om +k1om:intel +plugin diff --git a/tests/supported-targets/7_x86_64_tgt b/tests/supported-targets/7_x86_64_tgt new file mode 100644 index 0000000..76f6081 --- /dev/null +++ b/tests/supported-targets/7_x86_64_tgt @@ -0,0 +1,19 @@ +elf64-x86-64 +elf32-i386 +elf32-x86-64 +a.out-i386-linux +pei-i386 +pei-x86-64 +elf64-l1om +elf64-k1om +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/8_aarch64_arch b/tests/supported-targets/8_aarch64_arch new file mode 100644 index 0000000..40eb53d --- /dev/null +++ b/tests/supported-targets/8_aarch64_arch @@ -0,0 +1,16 @@ +aarch64 +arm +armv2 +armv2a +armv3 +armv3m +armv4 +armv4t +armv5 +armv5t +armv5te +xscale +ep9312 +iwmmxt +iwmmxt2 +plugin diff --git a/tests/supported-targets/8_aarch64_tgt b/tests/supported-targets/8_aarch64_tgt new file mode 100644 index 0000000..f587143 --- /dev/null +++ b/tests/supported-targets/8_aarch64_tgt @@ -0,0 +1,15 @@ +elf64-littleaarch64 +elf64-bigaarch64 +elf32-littlearm +elf32-bigarm +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/8_ppc64_arch b/tests/supported-targets/8_ppc64_arch new file mode 100644 index 0000000..cf3789b --- /dev/null +++ b/tests/supported-targets/8_ppc64_arch @@ -0,0 +1,27 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:e500mc64 +powerpc:MPC8XX +powerpc:750 +powerpc:titan +powerpc:vle +powerpc:e5500 +powerpc:e6500 +plugin diff --git a/tests/supported-targets/8_ppc64_tgt b/tests/supported-targets/8_ppc64_tgt new file mode 100644 index 0000000..19faa60 --- /dev/null +++ b/tests/supported-targets/8_ppc64_tgt @@ -0,0 +1,18 @@ +elf64-powerpc +elf64-powerpcle +elf32-powerpc +elf32-powerpcle +aixcoff-rs6000 +aixcoff64-rs6000 +aix5coff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/8_ppc64le_arch b/tests/supported-targets/8_ppc64le_arch new file mode 100644 index 0000000..cf3789b --- /dev/null +++ b/tests/supported-targets/8_ppc64le_arch @@ -0,0 +1,27 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:e500mc64 +powerpc:MPC8XX +powerpc:750 +powerpc:titan +powerpc:vle +powerpc:e5500 +powerpc:e6500 +plugin diff --git a/tests/supported-targets/8_ppc64le_tgt b/tests/supported-targets/8_ppc64le_tgt new file mode 100644 index 0000000..40dd3f9 --- /dev/null +++ b/tests/supported-targets/8_ppc64le_tgt @@ -0,0 +1,19 @@ +elf64-powerpcle +elf64-powerpc +elf32-powerpcle +elf32-powerpc +aixcoff-rs6000 +aixcoff64-rs6000 +aix5coff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +ppcboot +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/8_s390x_arch b/tests/supported-targets/8_s390x_arch new file mode 100644 index 0000000..1dcd6fa --- /dev/null +++ b/tests/supported-targets/8_s390x_arch @@ -0,0 +1,3 @@ +s390:31-bit +s390:64-bit +plugin diff --git a/tests/supported-targets/8_s390x_tgt b/tests/supported-targets/8_s390x_tgt new file mode 100644 index 0000000..34a9dfd --- /dev/null +++ b/tests/supported-targets/8_s390x_tgt @@ -0,0 +1,14 @@ +elf64-s390 +elf32-s390 +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex +trad-core diff --git a/tests/supported-targets/8_x86_64_arch b/tests/supported-targets/8_x86_64_arch new file mode 100644 index 0000000..b2cf7d6 --- /dev/null +++ b/tests/supported-targets/8_x86_64_arch @@ -0,0 +1,12 @@ +i386 +i386:x86-64 +i386:x64-32 +i8086 +i386:intel +i386:x86-64:intel +i386:x64-32:intel +l1om +l1om:intel +k1om +k1om:intel +plugin diff --git a/tests/supported-targets/8_x86_64_tgt b/tests/supported-targets/8_x86_64_tgt new file mode 100644 index 0000000..76f6081 --- /dev/null +++ b/tests/supported-targets/8_x86_64_tgt @@ -0,0 +1,19 @@ +elf64-x86-64 +elf32-i386 +elf32-x86-64 +a.out-i386-linux +pei-i386 +pei-x86-64 +elf64-l1om +elf64-k1om +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/9_aarch64_arch b/tests/supported-targets/9_aarch64_arch new file mode 100644 index 0000000..40eb53d --- /dev/null +++ b/tests/supported-targets/9_aarch64_arch @@ -0,0 +1,16 @@ +aarch64 +arm +armv2 +armv2a +armv3 +armv3m +armv4 +armv4t +armv5 +armv5t +armv5te +xscale +ep9312 +iwmmxt +iwmmxt2 +plugin diff --git a/tests/supported-targets/9_aarch64_tgt b/tests/supported-targets/9_aarch64_tgt new file mode 100644 index 0000000..f587143 --- /dev/null +++ b/tests/supported-targets/9_aarch64_tgt @@ -0,0 +1,15 @@ +elf64-littleaarch64 +elf64-bigaarch64 +elf32-littlearm +elf32-bigarm +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/9_ppc64_arch b/tests/supported-targets/9_ppc64_arch new file mode 100644 index 0000000..cf3789b --- /dev/null +++ b/tests/supported-targets/9_ppc64_arch @@ -0,0 +1,27 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:e500mc64 +powerpc:MPC8XX +powerpc:750 +powerpc:titan +powerpc:vle +powerpc:e5500 +powerpc:e6500 +plugin diff --git a/tests/supported-targets/9_ppc64_tgt b/tests/supported-targets/9_ppc64_tgt new file mode 100644 index 0000000..19faa60 --- /dev/null +++ b/tests/supported-targets/9_ppc64_tgt @@ -0,0 +1,18 @@ +elf64-powerpc +elf64-powerpcle +elf32-powerpc +elf32-powerpcle +aixcoff-rs6000 +aixcoff64-rs6000 +aix5coff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/9_ppc64le_arch b/tests/supported-targets/9_ppc64le_arch new file mode 100644 index 0000000..cf3789b --- /dev/null +++ b/tests/supported-targets/9_ppc64le_arch @@ -0,0 +1,27 @@ +rs6000:6000 +rs6000:rs1 +rs6000:rsc +rs6000:rs2 +powerpc:common64 +powerpc:common +powerpc:603 +powerpc:EC603e +powerpc:604 +powerpc:403 +powerpc:601 +powerpc:620 +powerpc:630 +powerpc:a35 +powerpc:rs64ii +powerpc:rs64iii +powerpc:7400 +powerpc:e500 +powerpc:e500mc +powerpc:e500mc64 +powerpc:MPC8XX +powerpc:750 +powerpc:titan +powerpc:vle +powerpc:e5500 +powerpc:e6500 +plugin diff --git a/tests/supported-targets/9_ppc64le_tgt b/tests/supported-targets/9_ppc64le_tgt new file mode 100644 index 0000000..40dd3f9 --- /dev/null +++ b/tests/supported-targets/9_ppc64le_tgt @@ -0,0 +1,19 @@ +elf64-powerpcle +elf64-powerpc +elf32-powerpcle +elf32-powerpc +aixcoff-rs6000 +aixcoff64-rs6000 +aix5coff64-rs6000 +elf64-little +elf64-big +elf32-little +elf32-big +ppcboot +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/9_s390x_arch b/tests/supported-targets/9_s390x_arch new file mode 100644 index 0000000..1dcd6fa --- /dev/null +++ b/tests/supported-targets/9_s390x_arch @@ -0,0 +1,3 @@ +s390:31-bit +s390:64-bit +plugin diff --git a/tests/supported-targets/9_s390x_tgt b/tests/supported-targets/9_s390x_tgt new file mode 100644 index 0000000..34a9dfd --- /dev/null +++ b/tests/supported-targets/9_s390x_tgt @@ -0,0 +1,14 @@ +elf64-s390 +elf32-s390 +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex +trad-core diff --git a/tests/supported-targets/9_x86_64_arch b/tests/supported-targets/9_x86_64_arch new file mode 100644 index 0000000..b2cf7d6 --- /dev/null +++ b/tests/supported-targets/9_x86_64_arch @@ -0,0 +1,12 @@ +i386 +i386:x86-64 +i386:x64-32 +i8086 +i386:intel +i386:x86-64:intel +i386:x64-32:intel +l1om +l1om:intel +k1om +k1om:intel +plugin diff --git a/tests/supported-targets/9_x86_64_tgt b/tests/supported-targets/9_x86_64_tgt new file mode 100644 index 0000000..76f6081 --- /dev/null +++ b/tests/supported-targets/9_x86_64_tgt @@ -0,0 +1,19 @@ +elf64-x86-64 +elf32-i386 +elf32-x86-64 +a.out-i386-linux +pei-i386 +pei-x86-64 +elf64-l1om +elf64-k1om +elf64-little +elf64-big +elf32-little +elf32-big +plugin +srec +symbolsrec +verilog +tekhex +binary +ihex diff --git a/tests/supported-targets/main.fmf b/tests/supported-targets/main.fmf new file mode 100644 index 0000000..e89c440 --- /dev/null +++ b/tests/supported-targets/main.fmf @@ -0,0 +1,6 @@ +summary: Tests that binutils target support matrix does not regress. + +contact: + - Milos Prchlik + - Arjun Shankar +duration: 10m diff --git a/tests/supported-targets/test.sh b/tests/supported-targets/test.sh new file mode 100755 index 0000000..cd3e753 --- /dev/null +++ b/tests/supported-targets/test.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/supported-targets +# Description: Tests that binutils target support matrix does not regress. +# Author: Arjun Shankar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + if rlIsRHEL "=6"; then + release=6 + elif rlIsRHEL "=7"; then + release=7 + elif rlIsRHEL "=8"; then + release=8 + elif rlIsRHEL "=9"; then + release=9 + else + rlLog "$(cat /etc/redhat-release)" + rlFail "No Baseline available for this major release; using RHEL-7 as baseline" + release=7 + fi + + rlLogInfo "Selected release: ${release}" + + arch=$(uname -m) + + expected_tgt_file="$(pwd)/${release}_${arch}_tgt" + expected_arch_file="$(pwd)/${release}_${arch}_arch" + + baseline_tgt=($(cat "${release}_${arch}_tgt")) + baseline_arch=($(cat "${release}_${arch}_arch")) + + buEnterTmpDir + rlPhaseEnd + + rlPhaseStartTest + rlRun "objdump --help | grep 'supported targets' | sed 's/objdump: supported targets: //' | tr ' ' '\n' > actual_tgt" + rlRun "objdump --help | grep 'supported architectures' | sed 's/objdump: supported architectures: //' | tr ' ' '\n' > actual_arch" + + rlLog "expected targets:" + rlLog "$(cat $expected_tgt_file)" + rlLog "expected architectures:" + rlLog "$(cat $expected_arch_file)" + rlLog "actual targets:" + rlLog "$(cat actual_tgt)" + rlLog "actual architectures:" + rlLog "$(cat actual_arch)" + + for bt in ${baseline_tgt[@]}; do + rlAssertGrep "^$bt$" actual_tgt + done + + for ba in ${baseline_arch[@]}; do + rlAssertGrep "^$ba$" actual_arch + done + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd + +rlJournalPrintText +rlJournalEnd