Richard Sandiford wrote: > DJ Delorie <[EMAIL PROTECTED]> writes: >> How about this? Tested under mipsisa64-elf with no regressions. The >> other two I found by inspection; they're the only other two that have >> .sdata and use -G 0. > > Looks good to me FWIW, although I can't approve it. I wonder if... > >> +#if defined(__mips__) || defined(__iq2000__) || defined(__m32r__) >> +extern void *__dso_handle __attribute__ ((__section__ (".sdata"))); >> +#endif > > ...this should be handled by some tm.h macro though, like the other > conditional stuff in crtstuff.c. I'm not sure there's any precedent > for hard-coding the architectures in crtstuff.c itself. (Not insisting, > just raising the question.)
Yes, I think we should have a target macro (a) to document what's going on here, and (b) because this is a property of the ABI, not the machine architecture. Perhaps TARGET_LIBGCC_SDATA_SECTION, which if defined, would be the name of the appropriate small-data section, and then: #ifdef TARGET_LIBGCC_SDATA_SECTION #define SDATA_ATTR __attribute__ ((__section ((TARGET_LIBGCC_SDATA_SECTION)) #else #define SDATA_ATTR /* empty */ #endif extern void *__dso_handle SDATA_ATTR; with appropriate documentation in docs/tm.texi, of course. I'll pre-approve that change, but I'll also defer to any other maintainer who has a solution they prefer. -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713