This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, objc] maintenance, make Obj{C,C++} LTO-friendly.



On 3 Jul 2010, at 19:07, IainS wrote:
UOBJC_SYMBOLS_decl = start_var_decl (objc_symtab_template, "_OBJC_SYMBOLS");
+ TREE_CONSTANT (UOBJC_SYMBOLS_decl) = 1;
+ if (flag_next_runtime)
+ {
+ tree sect = my_build_string (16, "__OBJC,__symbols");
+ DECL_SECTION_NAME (UOBJC_SYMBOLS_decl) = sect;
+ }


? This is overly darwin specific, and yet, this file isn't a darwin file. This shouldn't be necessary, as machopic_select_section should already select the right section based upon the name:

NeXT is darwin-specific - we should not need objc-specific stuff in the backend to try and guess the section based on the variable names.

Maybe that's not wholly achievable, some output is clearly dependent on what the FE requires...


so (a) attaching the section names in the meta-data generator (FE takes responsibility).
(b) attaching an attribute that allows the backend to do the same (at least variable names don't need to be parsed)..
(c) keeping with the choice of section based on var names (we know this mostly*** works).


... attaching an attribute ("objc_class_ref/objc_class_def") is also an intention for the two cases where we have ASM_xxx in the FE
so that varasm can output the appropriate thing (depending on what the assembler supports) and the FE doesn't need to do something different depending on what target macros are defined.


and, of course, the section ID strings should be #define'd ..

cheers,
Iain

*** it fails in the case that varasm intercepts all-zero items an sticks them in lcomm or comm before the darwin section chooser gets a look-in.
... all-zero meta-data is possibly only found in test-suites, so perhaps this is not an issue (except of tidiness).





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]