0
は、私は、変数があるとします。変数ごとに名前付きセクションを作成しますか?
int global a = 1;
int banana b = 2;
int mango c = 3;
私はGCCは彼らがそのようなことを生成したい:
.global
a .long 1
.banana
b .long 2
.mango
c .long 3
それを行うための最も簡単な方法は何ですか?
更新:
ガット:
target_asm_named_section()`
とともに
__attribute__ ((section ("mmm"))) int a = 432;`
生成する:
.global a: .long 1
素晴らしいですが、2つの問題があります。
リストが異なるセクションに注文されていない限り、リピートセクションが表示されます。
ので
__attribute__ ((section ("mmm"))) int a = 432; __attribute__ ((section ("mmm"))) int b = 432; __attribute__ ((section ("global"))) int c = 432;
は良いですが、.MMMが2回表示されますので、
__attribute__ ((section ("mmm"))) int a = 432; __attribute__ ((section ("global"))) int c = 432; __attribute__ ((section ("mmm"))) int b = 432;
は、悪いです。
第二の問題は、私はすでに私の試みの最高に以前の属性と組み合わせることはできません、
`__attribute__((global))`
を行うには、属性を使用しているということです。
これらの2つの問題のいずれかを解決する簡単な方法はありますか?