Al Smith
Al Smith

Reputation: 253

What is the difference between .global and .globl?

For example, I've seen _start as .global _start and .globl _start. It seems like I can just use them interchangeably. Is there any difference between the two?

Upvotes: 17

Views: 5183

Answers (1)

Olsonist
Olsonist

Reputation: 2403

They are the same. In fact, the LLVM assembler in MCParser/AsmParser.cpp lexes them as DK_GLOBL and DK_GLOBAL

DirectiveKindMap[".globl"] = DK_GLOBL;
DirectiveKindMap[".global"] = DK_GLOBAL;

but then parses them as the same attribute.

case DK_GLOBL:
case DK_GLOBAL:
    return parseDirectiveSymbolAttribute(MCSA_Global);

Upvotes: 7

Related Questions