[LLVMbugs] [Bug 1376] NEW: Section order should be tweaked

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue May 1 08:05:31 PDT 2007


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

           Summary: Section order should be tweaked
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: asl at math.spbu.ru


Consider we have function with jump tables. Currently we're doing something like
this:

        .text
... function body ..
   ret
        .section .rodata
... jump table entries ...
        .size funcname, .-funcname

Note, that .size directive is actually located in rodata section and "." refers
to .rodata section too, so size is definitely incorrect. Ok. This doesn't make
things too much bad.

Consider we have eh enabled. We have:

        .text
eh_func_begin:
... function body ...
   ret
        .section .rodata
... jump table entries ...
        .size funcname, .-funcname
eh_func_end:
        .section eh_frame
....

Note, eh_func_end is in *rodata* section. eh_frame should contain misc. offsets,
involving eh_func_begin and eh_func_end. Surely this information will be
invalid. Even more, as blames, because it cannot compute cross-section offsets.

The solution seems to be easy: just emit JT info in the late end, but I'm little
bit worried, because I saw the following comment in X86ATTAsmPrinter.cpp:

  // Print out jump tables referenced by the function.
  
  // Mac OS X requires that the jump table follow the function, so that the jump
  // table is part of the same atom that the function is in.
  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
  
  if (TAI->hasDotTypeDotSizeDirective())
    O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";

  if (Subtarget->isTargetDarwin() ||
      Subtarget->isTargetELF() ||
      Subtarget->isTargetCygMing()) {
    // Emit post-function debug information.
    DW.EndFunction();
  }

It seems for me, that EmitJumpTableInfo() should be moved to the late end, but
what does that comment mean" What is "atom" for MacOS X?

We really need someone with darwin knowledge to resolve this.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list