From 956dac258797a22ebe970be424cbf77a471a4d54 Mon Sep 17 00:00:00 2001 From: Rahul Chaudhry Date: Wed, 27 Sep 2017 16:33:40 -0700 Subject: assembler_thumb_test: use 'objdump -D -M force-thumb' to disassemble. Newer version of objcopy cannot strip '$d' from an object file, as it is implicitly marked as 'precious'. This is intentional, introduced in the upstream binutils repository by this commit: - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=fca2a38fdb391f810e309a12d5279047d4edac34 Since stripping of '$d' was being done only so we can disassemble the object file with 'objdump -d', switch to using 'objdump -D -M force-thumb' to force disassembly as thumb instructions. Bug: None Test: m test-art-host-gtest-assembler_thumb_test Change-Id: I815f9f3a7949bdc49d872c9b726c87b3199b66ca --- compiler/utils/assembler_thumb_test.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'compiler/utils/assembler_thumb_test.cc') diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index e51b622b81..4dbe71b8c7 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -126,15 +126,8 @@ void DumpAndCheck(std::vector& code, const char* testname, const char* int cmd_result = system(cmd); ASSERT_EQ(cmd_result, 0) << strerror(errno); - // Remove the $d symbols to prevent the disassembler dumping the instructions - // as .word - snprintf(cmd, sizeof(cmd), "%sobjcopy -N '$d' %s.o %s.oo", toolsdir.c_str(), filename, filename); - int cmd_result2 = system(cmd); - ASSERT_EQ(cmd_result2, 0) << strerror(errno); - // Disassemble. - - snprintf(cmd, sizeof(cmd), "%sobjdump -d %s.oo | grep '^ *[0-9a-f][0-9a-f]*:'", + snprintf(cmd, sizeof(cmd), "%sobjdump -D -M force-thumb --section=.text %s.o | grep '^ *[0-9a-f][0-9a-f]*:'", toolsdir.c_str(), filename); if (kPrintResults) { // Print the results only, don't check. This is used to generate new output for inserting @@ -169,9 +162,6 @@ void DumpAndCheck(std::vector& code, const char* testname, const char* char buf[FILENAME_MAX]; snprintf(buf, sizeof(buf), "%s.o", filename); unlink(buf); - - snprintf(buf, sizeof(buf), "%s.oo", filename); - unlink(buf); #endif // ART_TARGET_ANDROID } -- cgit v1.2.3-59-g8ed1b