Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Keystone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
Keystone
Commits
ad519f81
Commit
ad519f81
authored
8 years ago
by
Nguyen Anh Quynh
Browse files
Options
Downloads
Patches
Plain Diff
x86: fix the testcase 9, 10, 11 (JMP short with non-zero offset) of #issue 9
parent
1838aece
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
llvm/lib/MC/MCAssembler.cpp
+5
-4
5 additions, 4 deletions
llvm/lib/MC/MCAssembler.cpp
llvm/lib/MC/MCObjectStreamer.cpp
+2
-1
2 additions, 1 deletion
llvm/lib/MC/MCObjectStreamer.cpp
suite/regress/x86_issue9.py
+3
-0
3 additions, 0 deletions
suite/regress/x86_issue9.py
with
10 additions
and
5 deletions
llvm/lib/MC/MCAssembler.cpp
+
5
−
4
View file @
ad519f81
...
...
@@ -207,14 +207,13 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
Value
-=
Layout
.
getSymbolOffset
(
Sym
);
}
bool
ShouldAlignPC
=
Backend
.
getFixupKindInfo
(
Fixup
.
getKind
()).
Flags
&
MCFixupKindInfo
::
FKF_IsAlignedDownTo32Bits
;
assert
((
ShouldAlignPC
?
IsPCRel
:
true
)
&&
"FKF_IsAlignedDownTo32Bits is only allowed on PC-relative fixups!"
);
if
(
IsPCRel
)
{
uint
32
_t
Offset
=
Layout
.
getFragmentOffset
(
DF
)
+
Fixup
.
getOffset
();
uint
64
_t
Offset
=
Layout
.
getFragmentOffset
(
DF
)
+
Fixup
.
getOffset
();
// A number of ARM fixups in Thumb mode require that the effective PC
// address be determined as the 32-bit aligned version of the actual offset.
...
...
@@ -773,7 +772,8 @@ bool MCAssembler::relaxDwarfCallFrameFragment(MCAsmLayout &Layout,
return
false
;
}
bool
MCAssembler
::
layoutSectionOnce
(
MCAsmLayout
&
Layout
,
MCSection
&
Sec
)
{
bool
MCAssembler
::
layoutSectionOnce
(
MCAsmLayout
&
Layout
,
MCSection
&
Sec
)
{
// Holds the first fragment which needed relaxing during this layout. It will
// remain NULL if none were relaxed.
// When a fragment is relaxed, all the fragments following it should get
...
...
@@ -815,7 +815,8 @@ bool MCAssembler::layoutSectionOnce(MCAsmLayout &Layout, MCSection &Sec) {
return
false
;
}
bool
MCAssembler
::
layoutOnce
(
MCAsmLayout
&
Layout
)
{
bool
MCAssembler
::
layoutOnce
(
MCAsmLayout
&
Layout
)
{
bool
WasRelaxed
=
false
;
for
(
iterator
it
=
begin
(),
ie
=
end
();
it
!=
ie
;
++
it
)
{
MCSection
&
Sec
=
*
it
;
...
...
This diff is collapsed.
Click to expand it.
llvm/lib/MC/MCObjectStreamer.cpp
+
2
−
1
View file @
ad519f81
...
...
@@ -278,7 +278,8 @@ void MCObjectStreamer::EmitInstruction(MCInst &Inst,
}
void
MCObjectStreamer
::
EmitInstToFragment
(
MCInst
&
Inst
,
const
MCSubtargetInfo
&
STI
)
{
const
MCSubtargetInfo
&
STI
)
{
if
(
getAssembler
().
getRelaxAll
()
&&
getAssembler
().
isBundlingEnabled
())
llvm_unreachable
(
"All instructions should have already been relaxed"
);
...
...
This diff is collapsed.
Click to expand it.
suite/regress/x86_issue9.py
+
3
−
0
View file @
ad519f81
...
...
@@ -26,6 +26,9 @@ class TestX86(regress.RegressTest):
encoding
,
_
=
ks
.
asm
(
b
"
MOV DWORD PTR [ESP-0x218],0x2080000
"
)
self
.
assertEqual
(
encoding
,
[
0xC7
,
0x84
,
0x24
,
0xE8
,
0xFD
,
0xFF
,
0xFF
,
0x00
,
0x00
,
0x08
,
0x02
])
encoding
,
_
=
ks
.
asm
(
b
"
JMP 0x7FFCAA022104
"
,
0x7FFCAA022104
)
self
.
assertEqual
(
encoding
,
[
0xeb
,
0xfe
])
if
__name__
==
'
__main__
'
:
regress
.
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment