Revert "Explicitly set entry point arch when it's thumb"
Backing out because SymbolFile/Breakpad/symtab.test is failing and it seems to be a legit issue. Will investigate. This reverts commit 72153f95ee4c1b52d2f4f483f0ea4f650ec863be. llvm-svn: 373687
This commit is contained in:
@@ -172,129 +172,3 @@ TEST_F(ObjectFileELFTest, GetModuleSpecifications_EarlySectionHeaders) {
|
||||
Uuid.SetFromStringRef("1b8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9", 20);
|
||||
EXPECT_EQ(Spec.GetUUID(), Uuid);
|
||||
}
|
||||
|
||||
TEST_F(ObjectFileELFTest, GetSymtab_NoSymEntryPointArmThumbAddressClass) {
|
||||
/*
|
||||
// nosym-entrypoint-arm-thumb.s
|
||||
.thumb_func
|
||||
_start:
|
||||
mov r0, #42
|
||||
mov r7, #1
|
||||
svc #0
|
||||
// arm-linux-androideabi-as nosym-entrypoint-arm-thumb.s
|
||||
// -o nosym-entrypoint-arm-thumb.o
|
||||
// arm-linux-androideabi-ld nosym-entrypoint-arm-thumb.o
|
||||
// -o nosym-entrypoint-arm-thumb -e 0x8075 -s
|
||||
*/
|
||||
auto ExpectedFile = TestFile::fromYaml(R"(
|
||||
--- !ELF
|
||||
FileHeader:
|
||||
Class: ELFCLASS32
|
||||
Data: ELFDATA2LSB
|
||||
Type: ET_EXEC
|
||||
Machine: EM_ARM
|
||||
Flags: [ EF_ARM_SOFT_FLOAT, EF_ARM_EABI_VER5 ]
|
||||
Entry: 0x0000000000008075
|
||||
Sections:
|
||||
- Name: .text
|
||||
Type: SHT_PROGBITS
|
||||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
||||
Address: 0x0000000000008074
|
||||
AddressAlign: 0x0000000000000002
|
||||
Content: 2A20012700DF
|
||||
- Name: .data
|
||||
Type: SHT_PROGBITS
|
||||
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
||||
Address: 0x0000000000009000
|
||||
AddressAlign: 0x0000000000000001
|
||||
Content: ''
|
||||
- Name: .bss
|
||||
Type: SHT_NOBITS
|
||||
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
||||
Address: 0x0000000000009000
|
||||
AddressAlign: 0x0000000000000001
|
||||
- Name: .note.gnu.gold-version
|
||||
Type: SHT_NOTE
|
||||
AddressAlign: 0x0000000000000004
|
||||
Content: 040000000900000004000000474E5500676F6C6420312E3131000000
|
||||
- Name: .ARM.attributes
|
||||
Type: SHT_ARM_ATTRIBUTES
|
||||
AddressAlign: 0x0000000000000001
|
||||
Content: '4113000000616561626900010900000006020901'
|
||||
...
|
||||
)");
|
||||
ASSERT_THAT_EXPECTED(ExpectedFile, llvm::Succeeded());
|
||||
|
||||
ModuleSpec spec{FileSpec(ExpectedFile->name())};
|
||||
spec.GetSymbolFileSpec().SetFile(ExpectedFile->name(),
|
||||
FileSpec::Style::native);
|
||||
auto module_sp = std::make_shared<Module>(spec);
|
||||
|
||||
auto entry_point_addr = module_sp->GetObjectFile()->GetEntryPointAddress();
|
||||
ASSERT_TRUE(entry_point_addr.GetOffset() & 1);
|
||||
// Decrease the offsite by 1 to make it into a breakable address since this
|
||||
// is Thumb.
|
||||
entry_point_addr.SetOffset(entry_point_addr.GetOffset() - 1);
|
||||
ASSERT_EQ(entry_point_addr.GetAddressClass(),
|
||||
AddressClass::eCodeAlternateISA);
|
||||
}
|
||||
|
||||
TEST_F(ObjectFileELFTest, GetSymtab_NoSymEntryPointArmAddressClass) {
|
||||
/*
|
||||
// nosym-entrypoint-arm.s
|
||||
_start:
|
||||
movs r0, #42
|
||||
movs r7, #1
|
||||
svc #0
|
||||
// arm-linux-androideabi-as nosym-entrypoint-arm.s
|
||||
// -o nosym-entrypoint-arm.o
|
||||
// arm-linux-androideabi-ld nosym-entrypoint-arm.o
|
||||
// -o nosym-entrypoint-arm -e 0x8074 -s
|
||||
*/
|
||||
auto ExpectedFile = TestFile::fromYaml(R"(
|
||||
--- !ELF
|
||||
FileHeader:
|
||||
Class: ELFCLASS32
|
||||
Data: ELFDATA2LSB
|
||||
Type: ET_EXEC
|
||||
Machine: EM_ARM
|
||||
Flags: [ EF_ARM_SOFT_FLOAT, EF_ARM_EABI_VER5 ]
|
||||
Entry: 0x0000000000008074
|
||||
Sections:
|
||||
- Name: .text
|
||||
Type: SHT_PROGBITS
|
||||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
||||
Address: 0x0000000000008074
|
||||
AddressAlign: 0x0000000000000004
|
||||
Content: 2A00A0E30170A0E3000000EF
|
||||
- Name: .data
|
||||
Type: SHT_PROGBITS
|
||||
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
||||
Address: 0x0000000000009000
|
||||
AddressAlign: 0x0000000000000001
|
||||
Content: ''
|
||||
- Name: .bss
|
||||
Type: SHT_NOBITS
|
||||
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
||||
Address: 0x0000000000009000
|
||||
AddressAlign: 0x0000000000000001
|
||||
- Name: .note.gnu.gold-version
|
||||
Type: SHT_NOTE
|
||||
AddressAlign: 0x0000000000000004
|
||||
Content: 040000000900000004000000474E5500676F6C6420312E3131000000
|
||||
- Name: .ARM.attributes
|
||||
Type: SHT_ARM_ATTRIBUTES
|
||||
AddressAlign: 0x0000000000000001
|
||||
Content: '4113000000616561626900010900000006010801'
|
||||
...
|
||||
)");
|
||||
ASSERT_THAT_EXPECTED(ExpectedFile, llvm::Succeeded());
|
||||
|
||||
ModuleSpec spec{FileSpec(ExpectedFile->name())};
|
||||
spec.GetSymbolFileSpec().SetFile(ExpectedFile->name(),
|
||||
FileSpec::Style::native);
|
||||
auto module_sp = std::make_shared<Module>(spec);
|
||||
|
||||
auto entry_point_addr = module_sp->GetObjectFile()->GetEntryPointAddress();
|
||||
ASSERT_EQ(entry_point_addr.GetAddressClass(), AddressClass::eCode);
|
||||
}
|
||||
Reference in New Issue
Block a user