diff options
author | Shih-wei Liao <sliao@google.com> | 2012-03-02 12:03:52 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2012-03-02 12:03:52 -0800 |
commit | 59411237b1aacabd1dbe36cb4b073a4ac9caab6d (patch) | |
tree | bafa560d7008ca779db2a8fde6b4cac94327f634 | |
parent | 73a5c6a51848031900df4dd2a9cd2314cac838bc (diff) | |
download | linkloader-59411237b1aacabd1dbe36cb4b073a4ac9caab6d.tar.gz |
Fix R_..._CALL. Add T:testcases.
Change-Id: Icbce6457f903d36ea9b502c179e9179df9b93217
-rw-r--r-- | include/impl/ELFObject.hxx | 5 | ||||
-rwxr-xr-x | tests/images/gen-testcases.sh | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/impl/ELFObject.hxx b/include/impl/ELFObject.hxx index 360739e..06f00d9 100644 --- a/include/impl/ELFObject.hxx +++ b/include/impl/ELFObject.hxx @@ -250,6 +250,8 @@ relocateARM(void *(*find_sym)(void *context, char const *name), *inst = ((result) & 0x00FFFFFF) | (*inst & 0xFF000000); } else { + P &= ~0x3; // Base address align to 4 bytes.(For BLX.) + // Relocate the R_ARM_THM_CALL relocation type uint32_t result = (S + A - P) >> 1; @@ -258,7 +260,8 @@ relocateARM(void *(*find_sym)(void *context, char const *name), abort(); } - // Rewrite instruction to BLX. + //*inst &= 0xF800D000u; + // Rewrite instruction to BLX.(Stub is always ARM.) *inst &= 0xF800C000u; // [31-25][24][23][22][21-12][11-1][0] // 0 s i1 i2 u l 0 diff --git a/tests/images/gen-testcases.sh b/tests/images/gen-testcases.sh index e402d70..820ff58 100755 --- a/tests/images/gen-testcases.sh +++ b/tests/images/gen-testcases.sh @@ -33,6 +33,7 @@ function gen_test_cases { gen_test_cases arm armv7-none-linux-gnueabi gen_test_cases tegra2 armv7-none-linux-gnueabi '-mcpu=cortex-a9 -mattr=+vfp3' +gen_test_cases thumb2 armv7-none-linux-gnueabi '-march=thumb -mattr=+thumb2' gen_test_cases x86_32 i686-none-linux gen_test_cases x86_64 x86_64-none-linux gen_test_cases mipsel mipsel-none-linux-gnueabi |