[PATCH - darwin] PR target/25376

Josh Conner jconner@apple.com
Mon Feb 6 18:11:00 GMT 2006


Daniel Jacobowitz wrote:
> On Mon, Feb 06, 2006 at 09:49:24AM -0800, Josh Conner wrote:
>> Roger Sayle wrote:
>>> Hi Josh,
>>>
>>> On Fri, 3 Feb 2006, Josh Conner wrote:
>>>> target-supports.exp was incorrectly identifying darwin compilers as not
>>>> supporting named sections because they didn't compile this code:
>>>>
>>>>   int __attribute__ ((section("whatever"))) foo;
>>>>
>>>> In fact, named sections are supported by the darwin compiler, but
>>>> because "whatever" isn't a valid section identifier, the assembler was
>>>> rejecting it.
>>> I'm just trying to understand some of the issues...  So I was
>>> wondering why "whatever" isn't a valid section identifier on darwin,
>>> and which identifiers are valid?
>> The darwin assembler requires a section specification in the form:
>>
>> 	.section segname, sectname
>>
>> Such as:
>>
>> 	.section __TEXT, __foobar
> 
> So, you are saying that you need section("__TEXT, __foobar")?

Yes, that would be correct syntax for darwin.

>> I wouldn't say that Darwin has diminished functionality, any more than I
>> would say that another platform has diminished functionality for not
>> accepting:
>>
>> 	.section __TEXT, __foobar
>>
>> They simply have different syntaxes.  While making a distinction in the
>> test suite may some day become necessary, right now we can accomplish
>> the same level of compiler testing without making that distinction --
>> none of the current tests that use section attributes are compromised by
>> stopping at assembly code.
> 
> To the contrary, I would say that Darwin has diminished functionality
> because __attribute__((section("__foobar"))) is insufficient.  Can the
> compiler meaningfully supply a segment name?  Should it be
> section("seg","sec") instead?

I see your point, although I can't say that I agree with you.  And, I
don't know of any reason why either approach (having the compiler supply
a default segment name or changing the section attribute syntax) would
not be possible.  Unless I'm misunderstanding the issues here, it seems
to me that either change is beyond the scope of my patch, which is
intending to restore support for named function sections in a manner
that is consistent with named variable sections, and that appears to
have been unintentionally removed.

- Josh



More information about the Gcc-patches mailing list