forked from cirosantilli/x86-assembly-cheat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsection.S
45 lines (29 loc) · 804 Bytes
/
section.S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
# .section
Create ELF sections.
# .segment
Same as `.section`.
So don't use, since what we actually create are sections,
not segments, which are created by the linker.
# .text
TODO vs `.section .text`
# .data
Creates a data section.
TODO vs `.section .data`
http://stackoverflow.com/questions/21606690/whats-difference-between-section-data-and-just-data-in-gas-coding
Actually looks like the exact same: even with `.section .data`,
the section is treated magically, e.g. gets W flag.
# Section flags
Specified as:
.section .custom, "awx"
This would be an Allocatable Writable and eXecutable section.
*/
#include "lib/asm_io_s.h"
.section .data
i: .long 1
.data
j: .long 1
ENTRY
mov i, %eax
ASSERT_EQ($1)
EXIT