Purpose of PROLOG_LABEL in function prologue?

I've been building/dumping some x86_64 code and I've noticed that each of the routines has 3 temporary symbols, à la:

  pushq %rbp
  movq %rsp, %rbp
  subq $320, %rsp
  movl %ecx, -276(%rbp)

I've tracked them back to emitPrologue in X86RegisterInfo.cpp. I'm wonder what's their purpose?

They're filling up my symbol table...

Cameron Esfahani

"All that is necessary for the triumph of evil is that good men do nothing."

Edmund Burke

EH ranges for unwind info. If you look later on in the file for the symbols you'll see them.


Oh, though they should be local and not exported at all.


I don't see any references to them, that's why I brought it up...

I'll look at why they're getting exported...

Interesting. Is this COFF? We may not emit the final debug info, but leave the ranges in. If they're filling up your symbol table then we likely need another type of assembler label for "COFF internal".


Yeah, this is for COFF.

Is there any reason why we couldn't skip emitting temporary labels in the COFF writer?

I tried that and everything looks okay...

EH and unwind labels? Probably no reason no.


You probably don't want temporary labels emitted into the symbol
table. This is what Mach-O and ELF do.

- Daniel