Skip to content

Commit a3c5a32

Browse files
committed
test: add scenario
1 parent 4d826e4 commit a3c5a32

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

linker-diff/src/header_diff.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ fn read_dynamic_fields(obj: &Binary) -> Result<FieldValues> {
554554
continue;
555555
}
556556
DT_RELRENT => (Cow::Borrowed("DT_RELRENT"), Converter::None),
557+
DT_ANDROID_RELR => (Cow::Borrowed("DT_ANDROID_RELR"), Converter::SectionAddress),
558+
DT_ANDROID_RELRSZ => {
559+
continue;
560+
}
561+
DT_ANDROID_RELRENT => (Cow::Borrowed("DT_ANDROID_RELRENT"), Converter::None),
557562
DT_STRSZ => {
558563
// Ignore sizes for now.
559564
continue;

wild/tests/integration_tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,9 @@ fn dynamic_tag_name(tag: i64) -> Option<&'static str> {
32933293
DT_RELR => "DT_RELR",
32943294
DT_RELRSZ => "DT_RELRSZ",
32953295
DT_RELRENT => "DT_RELRENT",
3296+
DT_ANDROID_RELR => "DT_ANDROID_RELR",
3297+
DT_ANDROID_RELRSZ => "DT_ANDROID_RELRSZ",
3298+
DT_ANDROID_RELRENT => "DT_ANDROID_RELRENT",
32963299
DT_STRSZ => "DT_STRSZ",
32973300
DT_SYMENT => "DT_SYMENT",
32983301
DT_INIT => "DT_INIT",

wild/tests/sources/elf/pack-relative-relocs/pack-relative-relocs.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,37 @@
1313
//#DiffIgnore:dynsym.__global_pointer$.section
1414
//#DiffIgnore:section.got.plt.entsize
1515
//#Mode:dynamic
16-
//#ExpectDynamic:DT_RELR
17-
//#ExpectDynamic:DT_RELRSZ
18-
//#ExpectDynamic:DT_RELRENT
1916
//#Contains:.relr.dyn
2017
//#DoesNotContain:GLIBC_ABI_DT_RELR
2118

2219
//#Config:z-pack-relative-relocs:default
2320
//#LinkArgs:-pie -z now -z pack-relative-relocs --pack-dyn-relocs=none
21+
//#ExpectDynamic:DT_RELR
22+
//#ExpectDynamic:DT_RELRSZ
23+
//#ExpectDynamic:DT_RELRENT
2424
// GNU ld ignores `-z pack-relative-relocs` on RISC-V.
2525
//#EnableLinker:lld
2626
//#SkipLinker:ld
2727

2828
//#Config:pack-dyn-relocs-relr:default
2929
//#LinkArgs:-pie -z now --pack-dyn-relocs=relr -z nopack-relative-relocs
30-
// GNU ld doesn't support `--pack-dyn-relocs.
30+
//#ExpectDynamic:DT_RELR
31+
//#ExpectDynamic:DT_RELRSZ
32+
//#ExpectDynamic:DT_RELRENT
33+
// GNU ld doesn't support `--pack-dyn-relocs`.
34+
//#EnableLinker:lld
35+
//#SkipLinker:ld
36+
37+
//#Config:android-relr:default
38+
//#LinkArgs:-pie -z now --pack-dyn-relocs=relr --use-android-relr-tags
39+
//#ExpectDynamic:DT_ANDROID_RELR
40+
//#ExpectDynamic:DT_ANDROID_RELRSZ
41+
//#ExpectDynamic:DT_ANDROID_RELRENT
42+
//#NoDynamic:DT_RELR
43+
//#NoDynamic:DT_RELRSZ
44+
//#NoDynamic:DT_RELRENT
45+
//#RunEnabled:false
46+
// GNU ld doesn't support `--use-android-relr-tags`.
3147
//#EnableLinker:lld
3248
//#SkipLinker:ld
3349

0 commit comments

Comments
 (0)