Skip to content

Add MSVC $L local label prefix to is_local_label - #405

Open
punpckhdq wants to merge 1 commit into
encounter:mainfrom
punpckhdq:msvc-local-label
Open

Add MSVC $L local label prefix to is_local_label#405
punpckhdq wants to merge 1 commit into
encounter:mainfrom
punpckhdq:msvc-local-label

Conversation

@punpckhdq

Copy link
Copy Markdown

MSVC uses an $L prefix when naming branch target labels. These can be emitted as static symbols, here is the output of DUMPBIN /ALL on one of my objects:

    Section length    8, #relocs    0, #linenums    0, checksum D0085986, selection    2 (pick any)
201 00000000 SECT93 notype       External     | __real@3fefd70a40000000
202 000000F2 SECT8E notype       Label        | $L10839
203 000000DB SECT8E notype       Label        | $L10837
204 000000BA SECT8E notype       Label        | $L10835
205 00000094 SECT8E notype       Label        | $L10834
206 00000087 SECT8E notype       Label        | $L10833
207 0000007A SECT8E notype       Label        | $L10832
208 0000006D SECT8E notype       Label        | $L10831
209 000001C8 SECT8E notype       Static       | $L12876
20A 000001E8 SECT8E notype       Static       | $L12863
20B 00000000 SECT94 notype       Static       | .text

This requires a prefix match in is_local_label to handle correctly. Without that, the branch targets are shown as separate local functions in objdiff.

image

The PR fixes this by adding "$L" to LABEL_PREFIXES. With the patch applied, the same function is shown as matching with the base, because its branch target label is now being merged with the rest of the function:

image

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.

1 participant