This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] Support -fsection-anchors on darwin
>>>>> Richard Sandiford writes:
Richard> The main problem is that we still need to refer to data using
Richard> the original symbol names. Weening gcc of that would be a big task.
Richard> But it should be easy to make output_object_blocks treat .lcomm
Richard> specially, and do something like:
Richard> .lcomm LCOMM_BLOCK,size
Richard> x = LCOMM_BLOCK + 0
Richard> y = LCOMM_BLOCK + 0x10
Richard> ...
Richard> Is that the kind of thing you're suggesting? Even if it isn't,
Richard> would it still work for AIX?
Yes, that is what I am suggesting, and LCOMM_BLOCK effectively is
the section anchor. Not just x= and y=, but
.set LANCHOR0, LCOMM_BLOCK + 0
.set LANCHOR1, LCOMM_BLOCK + 32768
And anchors for constants and static initialized data could be emitted
similarly.
Without something like that, use_blocks_for_decl_p() needs to be
updated so that something equivalent to the test for COMMON,
/* Symbols that use .common cannot be put into blocks. */
if (DECL_COMMON (decl) && DECL_INITIAL (decl) == NULL)
return false;
applies to BSS for targets that don't support BSS_DECTION_ASM_OP.
David