This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [TEST] Add test case for patching an absolute relocation to a weak undef
ClosedPublic

Authored by bd1976llvm on Sep 29 2021, 7:13 AM.

Details

Summary

I noticed that we had this case in our internal testsuite but couldn't find it in LLD's tests.

This adds that case.

Diff Detail

Event Timeline

bd1976llvm created this revision.Sep 29 2021, 7:13 AM
bd1976llvm requested review of this revision.Sep 29 2021, 7:13 AM
peter.smith accepted this revision.Sep 29 2021, 7:24 AM

Looks good to me, worth waiting to see if MaskRay has any comments first.

This revision is now accepted and ready to land.Sep 29 2021, 7:24 AM

Consider adding --hex-dump test to weak-undef.s or weak-undef-rw.s

Additionally augmented weak-undef.s and weak-undef-rw.s with a --hex-dump test.

MaskRay accepted this revision.EditedOct 6 2021, 7:38 PM

Sorry for the slow response. I was out of town for one week.

It'd be better reorganize the tests further as their filenames are quite confusing now.

bd1976llvm updated this revision to Diff 378632.EditedOct 11 2021, 5:08 AM

Do not test reloc offset as its value isn't important.

Sorry for the slow response. I was out of town for one week.

Thanks. I made one minor change after your review as I realised that I didn't need to check the value of the relocation offset in lld/test/ELF/weak-undef.s.

It'd be better reorganize the tests further as their filenames are quite confusing now.

Agreed. It might help readers to amalgamate all of these weak undef cases into a single test file.

Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2021, 5:19 AM