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]

[Darwin] Patch: don't omit coalesced symbols from static archive's table of contents


Darwin allows symbols to be flagged in a special way so that, if the object file is put into a static archive, a symbol so flagged will not appear in the archive's table of contents. In the past, because of a linker limitation, we had to use that flag for C++ symbols with vague linkage. That limitation has been removed, so it's time to get rid of that workaround. (The workaround occasionally caused obscure problems.) This is a very small patch to do that.

Bootstrapped on Darwin, no regressions in the C or C++ test suites. I didn't test Java (it isn't building on Darwin right now), but I don't expect any problems. This change should have no effect on anything but the table of contents of a .a file.

This does not introduce any version-lock issues. This linker limitation was removed some time ago, and we already require a linker more recent than the one that had the fix.

OK to commit to mainline?

--Matt

Index: gcc/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.5564
diff -p -r2.5564 ChangeLog
*** gcc/ChangeLog 22 Sep 2004 16:58:13 -0000 2.5564
--- gcc/ChangeLog 22 Sep 2004 17:52:24 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2004-09-22 Matt Austern <austern@apple.com>
+
+ * config/darwin.c (darwin_make_decl_one_only)
+ Allow coalesced symbol to appear in static archive's table of contents
+
2004-09-22 David Edelsohn <edelsohn@gnu.org>


        * dbxout.c (get_lang_number): Do not define if
Index: gcc/config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.91
diff -p -r1.91 darwin.c
*** gcc/config/darwin.c 15 Sep 2004 17:02:58 -0000      1.91
--- gcc/config/darwin.c 22 Sep 2004 17:52:27 -0000
*************** darwin_make_decl_one_only (tree decl)
*** 998,1005 ****
    tree sec = 0;
    if (textcoal_section == 0)
      {
!       static const char *ts = "__TEXT,__textcoal_nt,coalesced,no_toc";
!       static const char *ds = "__DATA,__datacoal_nt,coalesced,no_toc";
        textcoal_section = build_string (strlen (ts), ts);
        datacoal_section = build_string (strlen (ds), ds);
      }
--- 998,1005 ----
    tree sec = 0;
    if (textcoal_section == 0)
      {
!       static const char *ts = "__TEXT,__textcoal_nt,coalesced";
!       static const char *ds = "__DATA,__datacoal_nt,coalesced";
        textcoal_section = build_string (strlen (ts), ts);
        datacoal_section = build_string (strlen (ds), ds);
      }


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