Debian Codegraph @

test/arch-riscv64-reloc-overflow.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 . $(dirnamescip-shell system . . dirname. $0)/common.inc
3
4 catscip-shell system . . cat. <<EOF | $CC -o $t/a.o -c -x assembler -
5 .section .foo, "ax"
6 foo:
7 call bar
8 EOF
9
10 catscip-shell system . . cat. <<EOF | $CC -o $t/b.o -c -x assembler -
11 .globl bar
12 .section .bar, "ax"
13 bar:
14 ret
15 EOF
16
17 catscip-shell system . . cat. <<EOF | $CC -o $t/c.o -c -xc -
18 int main() {}
19 EOF
20
21 $CC -B. -o $t/exe1 $t/a.o $t/b.o $t/c.o -Wl,--section-start=.foo=0x10000 \
22 -Wl,--section-start=.bar=0x8000f000
23
24 not $CC -B. -o $t/exe2 $t/a.o $t/b.o $t/c.o -Wl,--section-start=.foo=0x10000 \
25 -Wl,--section-start=.bar=0x8000f800 |&
26 grepscip-shell system . . grep. -F 'relocation R_RISCV_CALL_PLT against bar out of range'