public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/21738] New: MIPS libsupc++ built with small data
@ 2005-05-24 16:53 jifl-bugzilla at jifvik dot org
  0 siblings, 0 replies; only message in thread
From: jifl-bugzilla at jifvik dot org @ 2005-05-24 16:53 UTC (permalink / raw)
  To: gcc-bugs

MIPS does not yet have relaxation support in binutils. Instead, in line with
MIPS's own compiler, there is support for small data/bss sections, with
appropriate shorter relocations. What size of data goes in those sections is
determined with the MIPS target specific command line option -G.

However libstdc++ and libsupc++ are built with the default -G value of 8. This
means that if a sufficiently large application is built which requires the user
to use a smaller value of -G, they are stuck.

When brought up on the gcc mailing list around 2005-04-18, three solutions were
suggested: 
a) multilibbing with -G 0. However this adds to multilib hell, and doesn't allow
users to have some sdata support with e.g. -G 4.

b) providing a configure time option to set the default -G option. However the
choice of whether that is needed or not is application specific, not compiler
specific. Completely separate compiler builds should not be needed for different
applications.

c) A new -m option to allow the MIPS backend to generate relocations that assume
data is not in the small data section, but still output data into the small data
sections. Then libstdc++ / libsupc++ would be built with this new option. Some
other ports have this option such as PowerPC where this is the default method of
operation (-msdata-data). This would admittedly result in some relocations
within the libraries being larger than necessary. However application references
to the libraries would be unaffected.

No conclusion was reached, but it seemed to me and Zack Weinberg that the latter
seemed a reasonable compromise. The PowerPC precedent is compelling.

However I have looked at the MIPS backend and it requires someone more familiar
with this code than I am to implement this option.

My thoughts now are that I believe the easiest approach is to introduce a new
mips_section_reloc_threshold variable that would default to the same value as
mips_section_threshold (the present -G value). On supplying the new
-mno-sdata-relocs option, mips_section_reloc_threshold would be set to 0. Almost
all existing uses of mips_section_threshold in mips.c would be renamed to
mips_section_reloc_threshold.

But the rest is a bit fuzzier to me: sdata appears easy to handle in
mips_select_rtx_section(), but sbss would require a change to
mips_in_small_data_p, which is also used for TARGET_IN_SMALL_DATA_P.

I would appreciate someone helping fill in the last blank.

-- 
           Summary: MIPS libsupc++ built with small data
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jifl-bugzilla at jifvik dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: mipsisa32-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21738


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-24 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-24 16:53 [Bug target/21738] New: MIPS libsupc++ built with small data jifl-bugzilla at jifvik dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).