common symbols and GNU ld

ali hagigat hagigatali@gmail.com
Wed May 11 10:34:00 GMT 2011


What is the meaning of common symbols? Are they defined by .comm
assembler directive ONLY? If I do not see .comm in the assembly
listing of a program so that program does not have common symbols?
right?

"FORCE_COMMON_ALLOCATION" of ld seems not working! Please consider the
following programs:
asm2.s
.comm dovom, 10
aval:
movl %edx, 32(%edi)

asm3.s
.section .text
.comm dovom, 10
aval:
movl $26, %eax

asm2.ld
FORCE_COMMON_ALLOCATION

as asm2.s -o asm2.o
as asm3.s -o asm3.o
ld asm2.o asm3.o -T asm2.ld -o asm2

The result:
asm2:     file format elf32-i386

SYMBOL TABLE:
00000000 l    d  .text	00000000 .text
00000010 l    d  .bss	00000000 .bss
00000000 l       .text	00000000 aval
00000004 l       .text	00000000 aval
00000010 g     O .bss	0000000a dovom

Why two different spaces are not considered for "dovom"?
The result is the same as 'asm2.ld' is empty!!



More information about the Binutils mailing list