Re: how to use .section command in asm code?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is not a command.
.section is a keyword related to your assembler syntax, probably gas
in your case.
A binary should have a section containing the code.
with gas we declare it with: .section .text with nasm we declare it
with section .text
We write below this tag all the executable code.
A binary could need data of course we create a section containing all
the data with .section .data with gas.
Your asm source file should be like this:
#some headers here
.section .data
    #initialized data here

.section .text
    global _start
    _start:
           #the executable code

regards,

Sofiane Akermoun


2013/3/3 ishare <june.tune.sea@xxxxxxxxx>:
>
> can .section command be used in asm code to define a section ?
>
> is there any examples?
>
>
> thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Sofiane AKERMOUN
akersof@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Linux C Programming]     [Linux for Hams]     [DCCP]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux