[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


http://llvm.org/bugs/show_bug.cgi?id=10951

           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:
__umodsi3:
        .quad .L.__umodsi3,.TOC. at tocbase
        .previous
.L.__umodsi3:
        mflr 0
 [snip]
        mtlr 0
        blr
.Ltmp0:
        .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();
    OutStreamer.EmitLabel(FnEndLabel);

    const MCExpr *SizeExp =
      MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(FnEndLabel, OutContext),
                              MCSymbolRefExpr::Create(CurrentFnSym,
OutContext),
                              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