Add coverage for RHEL-42954

binutils: Disable separate-code for aarch64
This commit is contained in:
Miloš Prchlík 2024-07-03 15:11:58 +02:00
commit d38c5a7ff5
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,6 @@
summary: Disable separate-code for aarch64
duration: 10m
link+:
- verifies: https://issues.redhat.com/browse/RHEL-42954

View file

@ -0,0 +1,5 @@
extern int printf (const char *, ...);
int i = 42;
const int * j = & i;
int main (void) { return printf ("hello world %d\n", * j); }

View file

@ -0,0 +1,31 @@
#!/bin/bash
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
. "$TMT_TREE/tests/lib.sh" || exit 1
rlJournalStart
rlPhaseStartSetup
buTestHeader
buEnterTmpDir
buCopyReproducers "reproducer.c"
rlPhaseEnd
rlPhaseStartTest
rlRun "gcc -O0 -o reproducer reproducer.c"
rlRun "readelf -lW ./reproducer |& tee output"
rlAssertEquals "only two LOAD sections are expected" "$(grep "LOAD" output | wc -l)" "2"
rlRun "gcc -O0 -o reproducer -Wl,-z,separate-code reproducer.c"
rlRun "readelf -lW ./reproducer |& tee output"
rlAssertEquals "four LOAD sections are expected" "$(grep "LOAD" output | wc -l)" "4"
rlPhaseEnd
rlPhaseStartCleanup
buExitTmpDir
rlPhaseEnd
rlJournalPrintText
rlJournalEnd