LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 17967 - Temporary symbol is public
Summary: Temporary symbol is public
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P release blocker
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-17 11:02 PST by Kai Nacke
Modified: 2013-11-19 05:46 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Assembler file to reproduce problem (1.81 KB, text/plain)
2013-11-17 11:02 PST, Kai Nacke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Nacke 2013-11-17 11:02:14 PST
Created attachment 11560 [details]
Assembler file to reproduce problem

If Dwarf exception code is emitted into a COFF file on Windows 64, then the temporary labels used for calculating the difference between function start and landingpad are defined as public.

The labels are created in AsmPrinter.cpp as follows (method EmitLabelDifference):

  // Otherwise, emit with .set (aka assignment).
  MCSymbol *SetLabel = GetTempSymbol("set", SetCounter++);
  OutStreamer.EmitAssignment(SetLabel, Diff);
  OutStreamer.EmitSymbolValue(SetLabel, Size);

The resulting .Lset0, .Lset1, ... labels are public despite being a temporary symbol. This also happens with assembler files. Just assemble the attached file and disassemble to check visibility of .LsetN labels.
Comment 1 Kai Nacke 2013-11-17 23:48:30 PST
Additional info:

If I set HasSetDirective = false; in class X86MCAsmInfoMicrosoft then the
generated assembler changes from

.Lset0 = .Ltmp19-.Leh_func_begin4
    .long   .Lset0

to

    .long .Ltmp19-.Leh_func_begin4

and the bug does not occur. But I am unsure if this is really the solution or
just curing the symptoms.
Comment 2 Reid Kleckner 2013-11-18 16:33:11 PST
This was surely caused by r190888, but I hadn't been able to figure out the cause until you pinned this down.  Thanks, taking a look now.
Comment 3 Reid Kleckner 2013-11-18 17:08:27 PST
Should be fixed by r195053.
Comment 4 Kai Nacke 2013-11-19 05:46:47 PST
Yes, it works for me now. Thanks.