This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add -fsection-anchor support for Darwin
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 22 Feb 2006 14:14:54 -0500 (EST)
- Subject: [PATCH] Add -fsection-anchor support for Darwin
This patch implements initial -fsection-anchors support for
Darwin. There are three current problems with turning on
-fsection-anchors defualty. The first problem comes down
to not being able to have symbols in the BSS without using
.lcomm, this is being worked on by Richard Sandiford as far
as I can tell. The second problem comes down to some objc
testcase failures which Richard Sandiford has reported
already on (and I will try to fix this weekend, I would
have done it tomorrow but I have a job interview at Sony
tomorrow). The third and last problem (which I just found
today) is that structs with zero is being recorded as the
wrong size (0) in the anchor for at least Darwin, this is
recorded as PR 26427. There is a nice C testcase which is
derived from some Fortran test failures.
The only difference between this patch and the last one is the
removal of the varasm.c part and the additional patch to
darwin-sections.def to fix couple of the objc testsuite failures.
OK? Bootstrapped and tested on powerpc-darwin with no regressions.
Also tested with a patch which disables blocks for decls which go
into the BSS for targets like Darwin that don't support ".section .bss"
and -fsection-anchors on.
Thanks,
Andrew Pinski
PS I wished there was better documention for Darwin's as about which
sections are merged because I had to figure out that
objc_selector_refs_section was merged via an error I got.
ChangeLog:
* config/darwin-protos.h (darwin_asm_output_anchor):
Declare.
* config/darwin-sections.def (cstring_section):
Add SECTION_MERGE to the flags.
(literal4_section): Likewise.
(literal8_section): Likewise.
(objc_selector_refs_section): Likewise.
* config/darwin.c (darwin_asm_output_anchor): New
function.
* config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Define.