|
11 | 11 | # Probe whether the host toolchain can link a PIE; skip if not. |
12 | 12 | $CC -o $t/probe $t/a.o -pie 2> /dev/null || skip |
13 | 13 |
|
14 | | -# Default: standard DT_RELR tags (35/36/37) and SHT_RELR (19). |
| 14 | +# Default: standard DT_RELR tags (35/36/37). |
15 | 15 | $CC -B. -o $t/exe1 $t/a.o -pie -Wl,--pack-dyn-relocs=relr |
16 | | -readelf -SW $t/exe1 | grep -F .relr.dyn | grep -Ew 'RELR' |
| 16 | +readelf -SW $t/exe1 | grep -F .relr.dyn |
17 | 17 | readelf --dynamic $t/exe1 > $t/log1 |
18 | 18 | grep -Ew 'RELR|<unknown>: 24' $t/log1 |
19 | 19 | grep -Ew 'RELRSZ|<unknown>: 23' $t/log1 |
20 | 20 | grep -Ew 'RELRENT|<unknown>: 25' $t/log1 |
21 | 21 |
|
22 | | -# --use-android-relr-tags: legacy DT_ANDROID_RELR* (in the OS-specific |
23 | | -# range) and SHT_ANDROID_RELR section type, for compatibility with |
24 | | -# pre-Android-12 loaders that don't recognize the standard tags. |
| 22 | +# --use-android-relr-tags: legacy DT_ANDROID_RELR* tags (in the |
| 23 | +# OS-specific range), for compatibility with pre-Android-12 loaders |
| 24 | +# that don't recognize the standard tags. Match by raw hex value because |
| 25 | +# older readelf doesn't know the symbolic names. |
25 | 26 | $CC -B. -o $t/exe2 $t/a.o -pie \ |
26 | 27 | -Wl,--pack-dyn-relocs=relr -Wl,--use-android-relr-tags |
27 | | -readelf -SW $t/exe2 | grep -F .relr.dyn | grep -Ev '\bRELR\b' |
| 28 | +readelf -SW $t/exe2 | grep -F .relr.dyn |
28 | 29 | readelf --dynamic $t/exe2 > $t/log2 |
29 | 30 | grep -E '0x0*6fffe000\b' $t/log2 |
30 | 31 | grep -E '0x0*6fffe001\b' $t/log2 |
|
0 commit comments