Sent the email a bit early.

>> That is not what I am seeing with gcc. Given
>>
>> int pr22217_foo;
>> int *b = &pr22217_foo;
>> extern int pr22217_foo __attribute__((section("zed")));
>
> The above works even in c++ and with foo being initialized:
>
> .section zed,"aw",@progbits
> .align 4
> .type pr22217_foo, @object
> .size pr22217_foo, 4
> pr22217_foo:
> .long 42
>
> I tested gcc 4.9.2 and current trunk (r220018).

Which brings the question: should we delay more of codegen?

The argument I have seen for not doing so is that we  get better
locality. The advantages that I know of of delaying *all* of codegen
until EOF are:

* We can get the above cases to match gcc.
* We can support all cases of "typedef struct { ...} foo;"
* We can compute the correct visibility in the case of pr16187.
* We can compute visibility of types only once.

Cheers,
Rafael
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to