[LLVMbugs] [Bug 10951] New: The .size directive is incorrect for Linux PPC64.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 17 14:16:09 PDT 2011


           Summary: The .size directive is incorrect for Linux PPC64.
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rich at pennware.com
                CC: llvmbugs at cs.uiuc.edu

The latest binutils (2.21.2) assembler for the PPC64 complains about the .size
directive emitted by LLVM as not containing an absolute expression.

An example:
        .quad .L.__umodsi3,.TOC. at tocbase
        mflr 0
        mtlr 0
        .size   __umodsi3, .Ltmp0-__umodsi3

The correct size expression should be .Ltmp0-.L.__umodsi3

The code which does this is in AsmPrinter.cpp:

  // If the target wants a .size directive for the size of the function, emit
  // it.
  if (MAI->hasDotTypeDotSizeDirective()) {
    // Create a symbol for the end of function, so we can get the size as
    // difference between the function label and the temp label.
    MCSymbol *FnEndLabel = OutContext.CreateTempSymbol();

    const MCExpr *SizeExp =
      MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(FnEndLabel, OutContext),
    OutStreamer.EmitELFSize(CurrentFnSym, SizeExp);

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list