Skip to content

Handle x86 MSVC jumptables#195

Open
1superchip wants to merge 14 commits intosimonlindholm:mainfrom
1superchip:x86-msvc-jumptable-fixup
Open

Handle x86 MSVC jumptables#195
1superchip wants to merge 14 commits intosimonlindholm:mainfrom
1superchip:x86-msvc-jumptable-fixup

Conversation

@1superchip
Copy link
Collaborator

@1superchip 1superchip commented Apr 30, 2025

This is a draft pr that implements handling of MSVC jumptables for x86. It currently requires diff function symbols to work properly as that is needed for the labels to be processed but it should not require that in the long run.

A small issue with this is that if there are multiple text sections, arrows will be shown in each text section. There was also an issue with objdump not emitting proper information for jumptables in a 2nd text section if the first section had a jump table.

objdump output of the jumptable:
image

objdump output of the assembly that is referenced from the jumptable:
image

An image of the final result:
image

We need <$Lnum> in the 2nd image to get the location.

# This will have errors for multiple text sections as objdump (at least 2.38) doesn't emit
# the correct labels for sections that are not the first

jump_table_targets: List[str] = [] # target_label
Copy link
Owner

Choose a reason for hiding this comment

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

this seems to be unused

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like it. I have the targets stored to it but they are never read from it.

@simonlindholm
Copy link
Owner

(Should [WIP] be removed from the title?)

1superchip and others added 7 commits February 5, 2026 11:56
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
@1superchip 1superchip changed the title [WIP] Handle x86 MSVC jumptables Handle x86 MSVC jumptables Feb 15, 2026
1superchip and others added 4 commits February 15, 2026 17:48
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
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

Comments