Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asm - what is a local common area and difference between .lcomm and .comm?

I'm still a beginner in assembly language, and I want to understand what do the directives .lcomm and .comm mean in fact ?

I did a search in google, and found that .lcomm stands for local common, but I really don't understand what is that. Can someone clarify it please ?

like image 678
Michael Heidelberg Avatar asked Dec 08 '15 14:12

Michael Heidelberg


1 Answers

When a Unix process is run, it has an area called bss which is usually initialized to zero. Both .comm and .lcomm locations are allocated in bss. A .comm symbol is marked as global while a .lcomm symbol isn't.

If you have two files with the same symbols marked as .lcomm they will refer to different memory locations in bss. On the other hand, if you have two files with the same symbol marked as .comm they will refer to the same memory location in bss.

like image 68
Olsonist Avatar answered Oct 01 '22 05:10

Olsonist