Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove object format #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

iksteen
Copy link
Contributor

@iksteen iksteen commented May 23, 2016

Remove code for COFF/MachO code, remove the now unneeded ObjectFormat from Triple and remove the Darwin exceptions in PPCAsmParser. Refs #31

@aquynh
Copy link
Member

aquynh commented May 24, 2016

This will take more time to review. Will get back to you asap, thanks!

@@ -159,8 +155,6 @@ MCSymbol *MCContext::createSymbolImpl(const StringMapEntry<bool> *Name,
switch (MOFI->getObjectFileType()) {
case MCObjectFileInfo::IsELF:
return new (Name, *this) MCSymbolELF(Name, IsTemporary);
case MCObjectFileInfo::IsMachO:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this switch now has only one case, so can be removed

@aquynh
Copy link
Member

aquynh commented May 27, 2016

very nice work. i just saw a minor issue. please fix that, and then we can merge this, thanks!

@aquynh
Copy link
Member

aquynh commented May 27, 2016

i fixed that switch, merged & pushed to a new branch "cleanup" at https://github.com/keystone-engine/beta/tree/cleanup.

there is an issue however: now suite/regress/regress.py crashes with below message. can you look at that?

$ ./regress.py

...
#34 - Adding x86_special_insn
#35 - Adding x86_ss_default
...............Assertion failed: (isImm() && "This is not an immediate"), function getImm, file /Users/me/projects/beta-keystone.git/tmp/beta.git/llvm/include/llvm/MC/MCInst.h, line 74.
[1]    39950 abort      ./regress.py

$

@iksteen
Copy link
Contributor Author

iksteen commented May 28, 2016

Actually, I'm also getting that assertion on the 'master' branch, these changes weren't merged in master yet right?

@iksteen
Copy link
Contributor Author

iksteen commented May 28, 2016

git bisect tells me the assertion error happens because of this commit:

commit 3cfac68fd408682a370d1d64bfa1bc2ef2c1f8cb
Author: Nguyen Anh Quynh <[email protected]>
Date:   Tue May 24 13:50:04 2016 +0800

    x86: support immediate-only RIP-relative encoding for x64. this fixes multiple issues in #9

The check I used was: kstool x64nasm $'default rel\nlea rax, fs:[__data]\n__data:'

@aquynh
Copy link
Member

aquynh commented May 29, 2016 via email

@iksteen
Copy link
Contributor Author

iksteen commented May 29, 2016

I think cmake is getting confused somewhere, if I remove my build/ directory and do a full rebuild it works without triggering the assertion. Both in the master and cleanup branches.

Update: The assertion happens in both master and cleanup branch, but only when making a debug build (which makes sense as assert is a nop without NDEBUG).

@aquynh
Copy link
Member

aquynh commented May 30, 2016

i syned "cleanup" with "master", but now it fails to compile. the error is from llvm/lib/MC/MCParser/DarwinAsmParser.cpp, and it happens when it links to /usr/local/include/llvm/MC/MCSectionMachO.h. this is a big problem, since it is supposed to link to local file MCSectionMachO.h, not the one from /usr/. could you take a look at this?

@aquynh
Copy link
Member

aquynh commented May 30, 2016

fixed so x64_nasm_default_rel.py passed in "master" now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants