[RFH] Fixing -fsection-anchors on powerpc-darwin
Andrew Pinski
pinskia@physics.uc.edu
Sun Feb 19 06:09:00 GMT 2006
Since -fsection-anchors is very useful for PPC-Darwin, I decided to
see what I needed to do to support them.
I started by just doing a bootstrap with them enabled by default
and ran into the first issue of SET_ASM_OP not being set. Next
I ran into the issue of quoting ". + 0" which caused the assembler
to think it is a symbol instead of an addition of . and 0.
The next issue I could not figure out how to fix, it is wrong code
caused by merging constant strings together.
Here is the reduced testcase (reduced from genmodes.c):
int modes;
emit_mode_class (void)
{
int t;
for(t = 0;t<modes;t++)
__builtin_puts ("");
}
int main(void)
{
char a[3] = "-h";
if (!strcmp (a, "-h")) ; else __builtin_abort ();
emit_mode_class ();
}
If someone could look into this, it would be nice, I think the use
of .cstring and anchors are not supported together as .cstring section
can be merged.
There was another issue but I could not get to that issue with a normal
bootstrap but I could get to it with -j3. The problem was I could not
figure out which file was causing the issue.
Thanks,
Andrew Pinski
PS Attached is the patch so far to support -fsection-anchors on
ppc-darwin. I am unhappy about the quoting hack I had to do but it
works.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: anchor.diff.txt
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20060219/d3efb924/attachment.txt>
More information about the Gcc
mailing list