| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | . $(dirnamescip-shell system . . dirname. $0)/common.inc |
| 3 | |
| 4 | catscip-shell system . . cat. <<EOF | $CC -c -o $t/a.o -fPIC -xc - |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | void fn1(); |
| 8 | void fn2(); |
| 9 | |
| 10 | __attribute__((section(".low"))) void fn1() { fn2(); } |
| 11 | __attribute__((section(".high"))) void fn2() { fn1(); } |
| 12 | |
| 13 | int main() { |
| 14 | fn1(); |
| 15 | } |
| 16 | EOF |
| 17 | |
| 18 | $CC -B. -o $t/exe $t/a.o \ |
| 19 | -Wl,--section-start=.low=0x10000000,--section-start=.high=0x20000000 |
| 20 | |
| 21 | $OBJDUMP -dr $t/exe | grepscip-shell system . . grep. -E '<fn1\$thunk[0-9]+>:' |