Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
49fd2386
Commit
49fd2386
authored
Jan 02, 2008
by
Michael Beck
Browse files
added GNU_FLAVOUR_YASM to support the YASM assembler
[r17127]
parent
f454a0e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
ir/be/begnuas.c
View file @
49fd2386
...
...
@@ -76,6 +76,14 @@ static const char *get_section_name(be_gas_section_t section) {
".section
\t
.bss"
,
".section
\t
.tbss,
\"
awT
\"
,@nobits"
,
".section
\t
.ctors,
\"
aw
\"
,@progbits"
},
{
".section
\t
.text"
,
".section
\t
.data"
,
".section
\t
.rodata"
,
".section
\t
.bss"
,
".section
\t
.tbss,
\"
awT
\"
,@nobits"
,
".section
\t
.ctors,
\"
aw
\"
,@progbits"
}
};
...
...
@@ -676,13 +684,18 @@ static void dump_global(be_gas_decl_env_t *env, ir_entity *ent, int emit_commons
}
if
(
variability
==
variability_uninitialized
)
{
if
(
emit_as_common
)
{
if
(
be_gas_flavour
==
GAS_FLAVOUR_NORMAL
)
if
(
emit_as_common
)
{
switch
(
be_gas_flavour
)
{
case
GAS_FLAVOUR_NORMAL
:
case
GAS_FLAVOUR_YASM
:
obstack_printf
(
obst
,
"
\t
.comm %s,%u,%u
\n
"
,
ld_name
,
get_type_size_bytes
(
type
),
align
);
else
break
;
case
GAS_FLAVOUR_MINGW
:
obstack_printf
(
obst
,
"
\t
.comm %s,%u # %u
\n
"
,
ld_name
,
get_type_size_bytes
(
type
),
align
);
break
;
}
}
else
{
obstack_printf
(
obst
,
"
\t
.zero %u
\n
"
,
get_type_size_bytes
(
type
));
}
...
...
ir/be/begnuas.h
View file @
49fd2386
...
...
@@ -49,7 +49,8 @@ typedef enum section_t {
typedef
enum
asm_flavour_t
{
GAS_FLAVOUR_NORMAL
=
0
,
/**< normal gas (ELF) */
GAS_FLAVOUR_MINGW
=
1
,
/**< MinGW variant (no-ELF) */
GAS_FLAVOUR_MAX
=
2
GAS_FLAVOUR_YASM
=
2
,
/**< YASM GNU parser */
GAS_FLAVOUR_MAX
=
3
}
be_gas_flavour_t
;
/** The variable where the GAS dialect is stored. */
...
...
ir/be/ia32/bearch_ia32.c
View file @
49fd2386
...
...
@@ -2085,6 +2085,7 @@ static const backend_params *ia32_get_libfirm_params(void) {
static
const
lc_opt_enum_int_items_t
gas_items
[]
=
{
{
"normal"
,
GAS_FLAVOUR_NORMAL
},
{
"mingw"
,
GAS_FLAVOUR_MINGW
},
{
"yasm"
,
GAS_FLAVOUR_YASM
},
{
NULL
,
0
}
};
...
...
ir/be/ia32/ia32_emitter.c
View file @
49fd2386
...
...
@@ -351,6 +351,8 @@ void ia32_emit_function_object(const char *name)
be_emit_cstring
(
";
\t
.scl
\t
2;
\t
.type
\t
32;
\t
.endef
\n
"
);
be_emit_write_line
();
break
;
case
GAS_FLAVOUR_YASM
:
break
;
default:
break
;
}
...
...
@@ -368,6 +370,9 @@ void ia32_emit_function_size(const char *name)
be_emit_char
(
'\n'
);
be_emit_write_line
();
break
;
case
GAS_FLAVOUR_MINGW
:
case
GAS_FLAVOUR_YASM
:
break
;
default:
break
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment