source: patches/gcc-3.4.3-linkonce-1.patch@ b15e4602

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b15e4602 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100644
File size: 12.2 KB
  • gcc/config/alpha/alpha.c

    Submitted By: Jim Gifford (patches at jg555 dot com)
    Date: 2004-11-05
    Initial Package Version: 3.4.3
    Origin: Jim Gifford
    Upstream Status: Delayed till 3.4.4
    Description: Fixes linkone/comdat issue
     
    diff -Naur gcc-3.4.3.orig/gcc/config/alpha/alpha.c gcc-3.4.3/gcc/config/alpha/alpha.c
    old new  
    1016910169# define TARGET_SECTION_TYPE_FLAGS unicosmk_section_type_flags
    1017010170# undef TARGET_ASM_UNIQUE_SECTION
    1017110171# define TARGET_ASM_UNIQUE_SECTION unicosmk_unique_section
     10172#undef TARGET_ASM_FUNCTION_RODATA_SECTION
     10173#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    1017210174# undef TARGET_ASM_GLOBALIZE_LABEL
    1017310175# define TARGET_ASM_GLOBALIZE_LABEL hook_void_FILEptr_constcharptr
    1017410176#endif
  • gcc/config/arm/pe.h

    diff -Naur gcc-3.4.3.orig/gcc/config/arm/pe.h gcc-3.4.3/gcc/config/arm/pe.h
    old new  
    9797#define MULTIPLE_SYMBOL_SPACES
    9898
    9999#define TARGET_ASM_UNIQUE_SECTION arm_pe_unique_section
     100#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    100101
    101102#define SUPPORTS_ONE_ONLY 1
    102103
  • gcc/config/avr/avr.c

    diff -Naur gcc-3.4.3.orig/gcc/config/avr/avr.c gcc-3.4.3/gcc/config/avr/avr.c
    old new  
    229229#define TARGET_ASM_FUNCTION_EPILOGUE avr_output_function_epilogue
    230230#undef TARGET_ATTRIBUTE_TABLE
    231231#define TARGET_ATTRIBUTE_TABLE avr_attribute_table
     232#undef TARGET_ASM_FUNCTION_RODATA_SECTION
     233#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    232234#undef TARGET_INSERT_ATTRIBUTES
    233235#define TARGET_INSERT_ATTRIBUTES avr_insert_attributes
    234236#undef TARGET_SECTION_TYPE_FLAGS
  • gcc/config/darwin.h

    diff -Naur gcc-3.4.3.orig/gcc/config/darwin.h gcc-3.4.3/gcc/config/darwin.h
    old new  
    686686#undef  TARGET_ASM_SELECT_RTX_SECTION
    687687#define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
    688688
     689#undef  TARGET_ASM_FUNCTION_RODATA_SECTION
     690#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
     691
    689692#define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME)                     \
    690693    do {                                                                \
    691694         if (FILE) {                                                    \
  • gcc/config/i386/cygming.h

    diff -Naur gcc-3.4.3.orig/gcc/config/i386/cygming.h gcc-3.4.3/gcc/config/i386/cygming.h
    old new  
    255255
    256256extern void i386_pe_unique_section (TREE, int);
    257257#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
     258#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    258259
    259260#define SUPPORTS_ONE_ONLY 1
    260261
  • gcc/config/i386/i386-interix.h

    diff -Naur gcc-3.4.3.orig/gcc/config/i386/i386-interix.h gcc-3.4.3/gcc/config/i386/i386-interix.h
    old new  
    344344
    345345extern void i386_pe_unique_section (tree, int);
    346346#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
     347#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    347348
    348349#define SUPPORTS_ONE_ONLY 1
    349350#endif /* 0 */
  • gcc/config/ip2k/ip2k.c

    diff -Naur gcc-3.4.3.orig/gcc/config/ip2k/ip2k.c gcc-3.4.3/gcc/config/ip2k/ip2k.c
    old new  
    9898#undef TARGET_ASM_UNIQUE_SECTION
    9999#define TARGET_ASM_UNIQUE_SECTION unique_section
    100100
     101#undef TARGET_ASM_FUNCTION_RODATA_SECTION
     102#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
     103
    101104#undef TARGET_ATTRIBUTE_TABLE
    102105#define TARGET_ATTRIBUTE_TABLE ip2k_attribute_table
    103106
  • gcc/config/mcore/mcore.c

    diff -Naur gcc-3.4.3.orig/gcc/config/mcore/mcore.c gcc-3.4.3/gcc/config/mcore/mcore.c
    old new  
    165165#define TARGET_ATTRIBUTE_TABLE          mcore_attribute_table
    166166#undef  TARGET_ASM_UNIQUE_SECTION
    167167#define TARGET_ASM_UNIQUE_SECTION       mcore_unique_section
     168#undef  TARGET_ASM_FUNCTION_RODATA_SECTION
     169#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    168170#undef  TARGET_ENCODE_SECTION_INFO
    169171#define TARGET_ENCODE_SECTION_INFO      mcore_encode_section_info
    170172#undef  TARGET_STRIP_NAME_ENCODING
  • gcc/config/rs6000/xcoff.h

    diff -Naur gcc-3.4.3.orig/gcc/config/rs6000/xcoff.h gcc-3.4.3/gcc/config/rs6000/xcoff.h
    old new  
    172172#define TARGET_ASM_SELECT_SECTION  rs6000_xcoff_select_section
    173173#define TARGET_ASM_SELECT_RTX_SECTION  rs6000_xcoff_select_rtx_section
    174174#define TARGET_ASM_UNIQUE_SECTION  rs6000_xcoff_unique_section
     175#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
    175176#define TARGET_STRIP_NAME_ENCODING  rs6000_xcoff_strip_name_encoding
    176177#define TARGET_SECTION_TYPE_FLAGS  rs6000_xcoff_section_type_flags
    177178
  • gcc/doc/tm.texi

    diff -Naur gcc-3.4.3.orig/gcc/doc/tm.texi gcc-3.4.3/gcc/doc/tm.texi
    old new  
    60036003Whatever the actual target object format, this is often good enough.
    60046004@end deftypefn
    60056005
     6006@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_RODATA_SECTION (tree @var{decl})
     6007Switches to a readonly data section associated with
     6008@samp{DECL_SECTION_NAME (@var{decl})}.
     6009The default version of this function switches to @code{.gnu.linkonce.r.name}
     6010section if function's section is @code{.gnu.linkonce.t.name}, to
     6011@code{.rodata.name} if function is in @code{.text.name} section
     6012and otherwise switches to the normal readonly data section.
     6013@end deftypefn
     6014
    60066015@deftypefn {Target Hook} void TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
    60076016Switches to the appropriate section for output of constant pool entry
    60086017@var{x} in @var{mode}.  You can assume that @var{x} is some kind of
  • gcc/final.c

    diff -Naur gcc-3.4.3.orig/gcc/final.c gcc-3.4.3/gcc/final.c
    old new  
    18811881                {
    18821882                  int log_align;
    18831883
    1884                   readonly_data_section ();
     1884                  targetm.asm_out.function_rodata_section (current_function_decl);
    18851885
    18861886#ifdef ADDR_VEC_ALIGN
    18871887                  log_align = ADDR_VEC_ALIGN (NEXT_INSN (insn));
  • gcc/output.h

    diff -Naur gcc-3.4.3.orig/gcc/output.h gcc-3.4.3/gcc/output.h
    old new  
    500500                                          unsigned HOST_WIDE_INT, int);
    501501extern void default_unique_section (tree, int);
    502502extern void default_unique_section_1 (tree, int, int);
     503extern void default_function_rodata_section (tree);
     504extern void default_no_function_rodata_section (tree);
    503505extern void default_select_rtx_section (enum machine_mode, rtx,
    504506                                        unsigned HOST_WIDE_INT);
    505507extern void default_elf_select_rtx_section (enum machine_mode, rtx,
  • gcc/target-def.h

    diff -Naur gcc-3.4.3.orig/gcc/target-def.h gcc-3.4.3/gcc/target-def.h
    old new  
    7878#define TARGET_ASM_UNIQUE_SECTION default_unique_section
    7979#endif
    8080
     81#ifndef TARGET_ASM_FUNCTION_RODATA_SECTION
     82#define TARGET_ASM_FUNCTION_RODATA_SECTION default_function_rodata_section
     83#endif
     84
    8185#ifndef TARGET_ASM_SELECT_RTX_SECTION
    8286#define TARGET_ASM_SELECT_RTX_SECTION default_select_rtx_section
    8387#endif
     
    201205                        TARGET_ASM_SELECT_SECTION,              \
    202206                        TARGET_ASM_SELECT_RTX_SECTION,          \
    203207                        TARGET_ASM_UNIQUE_SECTION,              \
     208                        TARGET_ASM_FUNCTION_RODATA_SECTION,     \
    204209                        TARGET_ASM_CONSTRUCTOR,                 \
    205210                        TARGET_ASM_DESTRUCTOR,                  \
    206211                        TARGET_ASM_OUTPUT_MI_THUNK,             \
  • gcc/target.h

    diff -Naur gcc-3.4.3.orig/gcc/target.h gcc-3.4.3/gcc/target.h
    old new  
    118118       for SELECT_SECTION.  */
    119119    void (* unique_section) (tree, int);
    120120
     121    /* Tell assembler to switch to the readonly data section associated
     122       with function DECL.  */
     123    void (* function_rodata_section) (tree);
     124
    121125    /* Output a constructor for a symbol with a given priority.  */
    122126    void (* constructor) (rtx, int);
    123127
  • gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc

    diff -Naur gcc-3.4.3.orig/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc gcc-3.4.3/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc
    old new  
     1extern void
     2bar (int x);
     3
     4inline void
     5foo (int i)
     6{
     7  switch (i)
     8    {
     9    case 3:
     10    case 5:
     11    case 6:
     12    case 9:
     13    case 15:
     14      bar (1);
     15      break;
     16    case 2:
     17    case 4:
     18    case 7:
     19    case 10:
     20    case 11:
     21    case 12:
     22      bar (2);
     23      break;
     24    case 0:
     25    case 1:
     26    case 8:
     27    case 13:
     28    case 16:
     29      bar (3);
     30      break;
     31    case 14:
     32      bar (4);
     33      break;
     34    default:
     35      bar (5);
     36      break;
     37    }
     38}
     39
     40void *fooaddr2 = (void *) foo;
  • gcc/testsuite/g++.old-deja/g++.other/comdat4.C

    diff -Naur gcc-3.4.3.orig/gcc/testsuite/g++.old-deja/g++.other/comdat4.C gcc-3.4.3/gcc/testsuite/g++.old-deja/g++.other/comdat4.C
    old new  
     1// PR c++/16276
     2// { dg-do link }
     3// { dg-additional-sources " comdat4-aux.cc" }
     4// { dg-options "-O2" }
     5
     6extern void
     7bar (int x);
     8
     9inline void
     10foo (int i)
     11{
     12  switch (i)
     13    {
     14    case 3:
     15    case 5:
     16    case 6:
     17    case 9:
     18    case 15:
     19      bar (1);
     20      break;
     21    case 2:
     22    case 4:
     23    case 7:
     24    case 10:
     25    case 11:
     26    case 12:
     27      bar (2);
     28      break;
     29    case 0:
     30    case 1:
     31    case 8:
     32    case 13:
     33    case 16:
     34      bar (3);
     35      break;
     36    case 14:
     37      bar (4);
     38      break;
     39    default:
     40      bar (5);
     41      break;
     42    }
     43}
     44
     45void *fooaddr = (void *) foo;
     46
     47void
     48bar (int x)
     49{
     50  __asm __volatile ("" : : "r" (x));
     51}
     52
     53int
     54main (void)
     55{
     56  return 0;
     57}
  • gcc/varasm.c

    diff -Naur gcc-3.4.3.orig/gcc/varasm.c gcc-3.4.3/gcc/varasm.c
    old new  
    535535    text_section ();
    536536}
    537537
     538/* Switch to read-only data section associated with function DECL.  */
     539
     540void
     541default_function_rodata_section (tree decl)
     542{
     543  if (decl != NULL_TREE && DECL_SECTION_NAME (decl))
     544    {
     545      const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
     546
     547      /* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo.  */
     548      if (DECL_ONE_ONLY (decl) && strncmp (name, ".gnu.linkonce.t.", 16) == 0)
     549        {
     550          size_t len = strlen (name) + 1;
     551          char *rname = alloca (len);
     552
     553          memcpy (rname, name, len);
     554          rname[14] = 'r';
     555          named_section_flags (rname, SECTION_LINKONCE);
     556          return;
     557        }
     558      /* For .text.foo we want to use .rodata.foo.  */
     559      else if (flag_function_sections && flag_data_sections
     560               && strncmp (name, ".text.", 6) == 0)
     561        {
     562          size_t len = strlen (name) + 1;
     563          char *rname = alloca (len + 2);
     564
     565          memcpy (rname, ".rodata", 7);
     566          memcpy (rname + 7, name + 5, len - 5);
     567          named_section_flags (rname, 0);
     568          return;
     569        }
     570    }
     571
     572  readonly_data_section ();
     573}
     574
     575/* Switch to read-only data section associated with function DECL
     576   for targets where that section should be always the single
     577   readonly data section.  */
     578
     579void
     580default_no_function_rodata_section (tree decl ATTRIBUTE_UNUSED)
     581{
     582  readonly_data_section ();
     583}
     584
    538585/* Switch to section for variable DECL.  RELOC is the same as the
    539586   argument to SELECT_SECTION.  */
    540587
Note: See TracBrowser for help on using the repository browser.