/[packages]/updates/5/elfutils/current/SOURCES/elfutils-0.165-mips_backend.patch
ViewVC logotype

Diff of /updates/5/elfutils/current/SOURCES/elfutils-0.165-mips_backend.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

updates/5/elfutils/current/SOURCES/elfutils-0.155-mips_backend.patch revision 1187190 by umeabot, Thu Jun 18 21:56:44 2015 UTC updates/5/elfutils/current/SOURCES/elfutils-0.165-mips_backend.patch revision 1187195 by luigiwalser, Fri Dec 29 17:55:29 2017 UTC
# Line 19  Index: elfutils-0.158/backends/Makefile. Line 19  Index: elfutils-0.158/backends/Makefile.
19  ===================================================================  ===================================================================
20  --- elfutils-0.158.orig/backends/Makefile.am  --- elfutils-0.158.orig/backends/Makefile.am
21  +++ elfutils-0.158/backends/Makefile.am  +++ elfutils-0.158/backends/Makefile.am
22  @@ -33,11 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I  @@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
23    
24    
25   modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \   modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
26  -         tilegx  -         tilegx m68k bpf
27  +         tilegx mips  +         tilegx m68k bpf mips
28   libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \   libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
29               libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \               libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
30               libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \               libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
31  -            libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a               libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
32  +            libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \  -            libebl_m68k_pic.a libebl_bpf_pic.a
33  +            libebl_mips_pic.a  +            libebl_m68k_pic.a libebl_bpf_pic.a libebl_mips_pic.a
34   noinst_LIBRARIES = $(libebl_pic)   noinst_LIBRARIES = $(libebl_pic)
35   noinst_DATA = $(libebl_pic:_pic.a=.so)   noinst_DATA = $(libebl_pic:_pic.a=.so)
36    
37  @@ -103,6 +103,9 @@ tilegx_SRCS = tilegx_init.c tilegx_symbo  @@ -103,6 +103,9 @@ tilegx_SRCS = tilegx_init.c tilegx_symbo
38   libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)   libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
39   am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)   am_libebl_bpf_pic_a_OBJECTS = $(bpf_SRCS:.c=.os)
40    
41  +mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c mips_attrs.c  +mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c mips_attrs.c
42  +libebl_mips_pic_a_SOURCES = $(mips_SRCS)  +libebl_mips_pic_a_SOURCES = $(mips_SRCS)
# Line 44  Index: elfutils-0.158/backends/Makefile. Line 44  Index: elfutils-0.158/backends/Makefile.
44    
45   libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)   libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
46          @rm -f $(@:.so=.map)          @rm -f $(@:.so=.map)
 Index: elfutils-0.155/backends/common-reloc.c  
 ===================================================================  
 --- elfutils-0.155.orig/backends/common-reloc.c  
 +++ elfutils-0.155/backends/common-reloc.c  
 @@ -112,11 +112,13 @@ EBLHOOK(reloc_valid_use) (Elf *elf, int  
  }  
   
   
 +#ifndef NO_COPY_RELOC  
  bool  
  EBLHOOK(copy_reloc_p) (int reloc)  
  {  
    return reloc == R_TYPE (COPY);  
  }  
 +#endif  
   
  bool  
  EBLHOOK(none_reloc_p) (int reloc)  
 @@ -138,7 +140,9 @@ EBLHOOK(init_reloc) (Ebl *ebl)  
    ebl->reloc_type_name = EBLHOOK(reloc_type_name);  
    ebl->reloc_type_check = EBLHOOK(reloc_type_check);  
    ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);  
 +#ifndef NO_COPY_RELOC  
    ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);  
 +#endif  
    ebl->none_reloc_p = EBLHOOK(none_reloc_p);  
  #ifndef NO_RELATIVE_RELOC  
    ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);  
47  Index: elfutils-0.155/backends/mips_init.c  Index: elfutils-0.155/backends/mips_init.c
48  ===================================================================  ===================================================================
49  --- /dev/null  --- /dev/null
50  +++ elfutils-0.155/backends/mips_init.c  +++ elfutils-0.155/backends/mips_init.c
51  @@ -0,0 +1,66 @@  @@ -0,0 +1,65 @@
52  +/* Initialization of mips specific backend library.  +/* Initialization of mips specific backend library.
53  +   Copyright (C) 2006 Red Hat, Inc.  +   Copyright (C) 2006 Red Hat, Inc.
54  +   This file is part of Red Hat elfutils.  +   This file is part of Red Hat elfutils.
# Line 114  Index: elfutils-0.155/backends/mips_init Line 86  Index: elfutils-0.155/backends/mips_init
86  +#include "common-reloc.c"  +#include "common-reloc.c"
87  +  +
88  +const char *  +const char *
89  +mips_init (elf, machine, eh, ehlen)  +mips_init (Elf *elf __attribute__ ((unused)),
90  +     Elf *elf __attribute__ ((unused));  +          GElf_Half machine __attribute__ ((unused)),
91  +     GElf_Half machine __attribute__ ((unused));  +          Ebl *eh,
92  +     Ebl *eh;  +          size_t ehlen)
 +     size_t ehlen;  
93  +{  +{
94  +  /* Check whether the Elf_BH object has a sufficent size.  */  +  /* Check whether the Elf_BH object has a sufficent size.  */
95  +  if (ehlen < sizeof (Ebl))  +  if (ehlen < sizeof (Ebl))
# Line 979  Index: elfutils-0.155/libebl/eblopenback Line 950  Index: elfutils-0.155/libebl/eblopenback
950  +  { "mipsel", "elf_mipsel", "mipsel", 6, EM_MIPS_RS3_LE, 0, 0 },  +  { "mipsel", "elf_mipsel", "mipsel", 6, EM_MIPS_RS3_LE, 0, 0 },
951    
952     { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },     { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
953     { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },     { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
954  Index: elfutils-0.155/libebl/eblsectionstripp.c  Index: elfutils-0.155/libebl/eblsectionstripp.c
955  ===================================================================  ===================================================================
956  --- elfutils-0.155.orig/libebl/eblsectionstripp.c  --- elfutils-0.155.orig/libebl/eblsectionstripp.c
# Line 1002  Index: elfutils-0.158/libelf/elf.h Line 973  Index: elfutils-0.158/libelf/elf.h
973  ===================================================================  ===================================================================
974  --- elfutils-0.158.orig/libelf/elf.h  --- elfutils-0.158.orig/libelf/elf.h
975  +++ elfutils-0.158/libelf/elf.h  +++ elfutils-0.158/libelf/elf.h
976  @@ -1345,15 +1345,41 @@ typedef struct  @@ -1384,10 +1384,36 @@ typedef struct
977     #define EF_MIPS_64BIT_WHIRL    16
978   /* Legal values for e_flags field of Elf32_Ehdr.  */   #define EF_MIPS_ABI2           32
979     #define EF_MIPS_ABI_ON32       64
 -#define EF_MIPS_NOREORDER      1     /* A .noreorder directive was used.  */  
 -#define EF_MIPS_PIC            2     /* Contains PIC code.  */  
 -#define EF_MIPS_CPIC           4     /* Uses PIC calling sequence.  */  
 -#define EF_MIPS_XGOT           8  
 -#define EF_MIPS_64BIT_WHIRL    16  
 -#define EF_MIPS_ABI2           32  
 -#define EF_MIPS_ABI_ON32       64  
 +#define EF_MIPS_NOREORDER      1               /* A .noreorder directive was used */  
 +#define EF_MIPS_PIC            2               /* Contains PIC code */  
 +#define EF_MIPS_CPIC           4               /* Uses PIC calling sequence */  
 +#define EF_MIPS_XGOT           8  
 +#define EF_MIPS_64BIT_WHIRL    16  
 +#define EF_MIPS_ABI2           32  
 +#define EF_MIPS_ABI_ON32       64  
980  +#define EF_MIPS_OPTIONS_FIRST  128  +#define EF_MIPS_OPTIONS_FIRST  128
981     #define EF_MIPS_FP64           512  /* Uses FP64 (12 callee-saved).  */
982  +#define EF_MIPS_ABI            0x0000f000  /* ABI of the file */  +#define EF_MIPS_ABI            0x0000f000  /* ABI of the file */
983   #define EF_MIPS_NAN2008        1024  /* Uses IEEE 754-2008 NaN encoding.  */   #define EF_MIPS_NAN2008        1024  /* Uses IEEE 754-2008 NaN encoding.  */
 -#define EF_MIPS_ARCH           0xf0000000 /* MIPS architecture level.  */  
984  +#define EF_MIPS_ARCH_ASE       0x0f000000  /* MIPS architecture extension */  +#define EF_MIPS_ARCH_ASE       0x0f000000  /* MIPS architecture extension */
985  +#define EF_MIPS_ARCH           0xf0000000      /* MIPS architecture level */   #define EF_MIPS_ARCH           0xf0000000 /* MIPS architecture level.  */
986  +  
987  +/* Indicates code compiled for a 64-bit machine in 32-bit mode.  +/* Indicates code compiled for a 64-bit machine in 32-bit mode.
988  + *    (regs are 32-bits wide.) */  + *    (regs are 32-bits wide.) */
989  +#define EF_MIPS_32BITMODE      0x00000100  +#define EF_MIPS_32BITMODE      0x00000100
# Line 1049  Index: elfutils-0.158/libelf/elf.h Line 1006  Index: elfutils-0.158/libelf/elf.h
1006  +  +
1007  +/* Use MIPS-16 ISA extensions */  +/* Use MIPS-16 ISA extensions */
1008  +#define EF_MIPS_ARCH_ASE_M16   0x04000000  +#define EF_MIPS_ARCH_ASE_M16   0x04000000
1009    +
1010   /* Legal values for MIPS architecture level.  */   /* Legal values for MIPS architecture level.  */
1011    
1012     #define EF_MIPS_ARCH_1         0x00000000 /* -mips1 code.  */
1013  Index: elfutils-0.155/src/elflint.c  Index: elfutils-0.155/src/elflint.c
1014  ===================================================================  ===================================================================
1015  --- elfutils-0.155.orig/src/elflint.c  --- elfutils-0.155.orig/src/elflint.c
1016  +++ elfutils-0.155/src/elflint.c  +++ elfutils-0.155/src/elflint.c
1017  @@ -870,9 +870,17 @@ section [%2d] '%s': symbol %zu does not  @@ -896,9 +896,17 @@ section [%2d] '%s': symbol %zu does not
1018              }              }
1019          }          }
1020    
# Line 1075  Index: elfutils-0.155/src/elflint.c Line 1033  Index: elfutils-0.155/src/elflint.c
1033              ERROR (gettext ("\              ERROR (gettext ("\
1034   section [%2d] '%s': symbol %zu: local symbol outside range described in sh_info\n"),   section [%2d] '%s': symbol %zu: local symbol outside range described in sh_info\n"),
1035                     idx, section_name (ebl, idx), cnt);                     idx, section_name (ebl, idx), cnt);
1036  @@ -887,9 +895,21 @@ section [%2d] '%s': symbol %zu: non-loca  @@ -913,9 +921,21 @@ section [%2d] '%s': symbol %zu: non-loca
1037    
1038         if (GELF_ST_TYPE (sym->st_info) == STT_SECTION         if (GELF_ST_TYPE (sym->st_info) == STT_SECTION
1039            && GELF_ST_BIND (sym->st_info) != STB_LOCAL)            && GELF_ST_BIND (sym->st_info) != STB_LOCAL)
# Line 1097  Index: elfutils-0.155/src/elflint.c Line 1055  Index: elfutils-0.155/src/elflint.c
1055    
1056         if (name != NULL)         if (name != NULL)
1057          {          {
1058  @@ -1325,7 +1345,8 @@ check_one_reloc (Ebl *ebl, GElf_Ehdr *eh  @@ -1357,7 +1377,8 @@ check_one_reloc (Ebl *ebl, GElf_Ehdr *eh
1059     if (!ebl_reloc_type_check (ebl, GELF_R_TYPE (r_info)))     if (!ebl_reloc_type_check (ebl, GELF_R_TYPE (r_info)))
1060       ERROR (gettext ("section [%2d] '%s': relocation %zu: invalid type\n"),       ERROR (gettext ("section [%2d] '%s': relocation %zu: invalid type\n"),
1061             idx, section_name (ebl, idx), cnt);             idx, section_name (ebl, idx), cnt);
# Line 1107  Index: elfutils-0.155/src/elflint.c Line 1065  Index: elfutils-0.155/src/elflint.c
1065              /* The executable/DSO can contain relocation sections with              /* The executable/DSO can contain relocation sections with
1066                 all the relocations the linker has applied.  Those sections                 all the relocations the linker has applied.  Those sections
1067                 are marked non-loaded, though.  */                 are marked non-loaded, though.  */
1068  @@ -1707,6 +1728,29 @@ section [%2d] '%s': entry %zu: pointer d  @@ -1746,6 +1767,29 @@ section [%2d] '%s': entry %zu: pointer d
1069              break;              break;
1070            /* FALLTHROUGH */            /* FALLTHROUGH */
1071    
# Line 1137  Index: elfutils-0.155/src/elflint.c Line 1095  Index: elfutils-0.155/src/elflint.c
1095          case DT_AUXILIARY:          case DT_AUXILIARY:
1096          case DT_FILTER:          case DT_FILTER:
1097          case DT_FINI:          case DT_FINI:
1098  @@ -1716,7 +1760,6 @@ section [%2d] '%s': entry %zu: pointer d  @@ -1755,7 +1799,6 @@ section [%2d] '%s': entry %zu: pointer d
1099          case DT_INIT_ARRAY:          case DT_INIT_ARRAY:
1100          case DT_JMPREL:          case DT_JMPREL:
1101          case DT_PLTGOT:          case DT_PLTGOT:
# Line 1145  Index: elfutils-0.155/src/elflint.c Line 1103  Index: elfutils-0.155/src/elflint.c
1103          case DT_RELA:          case DT_RELA:
1104          case DT_SYMBOLIC:          case DT_SYMBOLIC:
1105          case DT_SYMTAB:          case DT_SYMTAB:
1106  @@ -2783,7 +2826,9 @@ section [%2d] '%s': symbol %d: cannot re  @@ -2953,7 +2996,9 @@ section [%2d] '%s': symbol %d: cannot re
1107          {          {
1108            /* Global symbol.  Make sure it is not defined as local.  */            /* Global symbol.  Make sure it is not defined as local.  */
1109            if (GELF_ST_BIND (sym->st_info) == STB_LOCAL)            if (GELF_ST_BIND (sym->st_info) == STB_LOCAL)
# Line 1156  Index: elfutils-0.155/src/elflint.c Line 1114  Index: elfutils-0.155/src/elflint.c
1114   section [%2d] '%s': symbol %d: local symbol with global scope\n"),   section [%2d] '%s': symbol %d: local symbol with global scope\n"),
1115                     idx, section_name (ebl, idx), cnt);                     idx, section_name (ebl, idx), cnt);
1116          }          }
1117  @@ -3521,6 +3566,10 @@ cannot get section header for section [%  @@ -3731,6 +3776,10 @@ cannot get section header for section [%
1118                      && ebl_bss_plt_p (ebl, ehdr))                      && ebl_bss_plt_p (ebl))
1119                    good_type = SHT_NOBITS;                    good_type = SHT_NOBITS;
1120    
1121  +               if ((ehdr->e_machine == EM_MIPS) || (ehdr->e_machine == EM_MIPS_RS3_LE)) {  +               if ((ehdr->e_machine == EM_MIPS) || (ehdr->e_machine == EM_MIPS_RS3_LE)) {
1122  +                 if (strncmp(".debug", special_sections[s].name, strlen(".debug")) == 0)  +                   if (strncmp(".debug", special_sections[s].name, strlen(".debug")) == 0)
1123  +                         good_type = SHT_MIPS_DWARF;  +                       good_type = SHT_MIPS_DWARF;
1124  +               }  +               }
1125                  /* In a debuginfo file, any normal section can be SHT_NOBITS.                  /* In a debuginfo file, any normal section can be SHT_NOBITS.
1126                     This is only invalid for DWARF sections and .shstrtab.  */                     This is only invalid for DWARF sections and .shstrtab.  */
1127                  if (shdr->sh_type != good_type                  if (shdr->sh_type != good_type
1128  @@ -3532,7 +3581,7 @@ cannot get section header for section [%  @@ -3742,7 +3791,7 @@ cannot get section header for section [%
1129                    ERROR (gettext ("\                    ERROR (gettext ("\
1130   section [%2d] '%s' has wrong type: expected %s, is %s\n"),   section [%2d] '%s' has wrong type: expected %s, is %s\n"),
1131                           (int) cnt, scnname,                           (int) cnt, scnname,
# Line 1176  Index: elfutils-0.155/src/elflint.c Line 1134  Index: elfutils-0.155/src/elflint.c
1134                                                  stbuf1, sizeof (stbuf1)),                                                  stbuf1, sizeof (stbuf1)),
1135                           ebl_section_type_name (ebl, shdr->sh_type,                           ebl_section_type_name (ebl, shdr->sh_type,
1136                                                  stbuf2, sizeof (stbuf2)));                                                  stbuf2, sizeof (stbuf2)));
1137  @@ -3663,7 +3712,10 @@ section [%2zu] '%s': size not multiple o  @@ -3877,7 +3926,9 @@ section [%2zu] '%s': size not multiple o
   
1138   #define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \   #define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \
1139                        | SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \                        | SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \
1140  -                     | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS)                        | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS \
1141  +                     | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS \  -                     | SHF_COMPRESSED)
1142  +                     | SHF_MIPS_GPREL | SHF_MIPS_MERGE | SHF_MIPS_ADDR \  +                     | SHF_COMPRESSED | SHF_MIPS_GPREL | SHF_MIPS_MERGE \
1143  +                     | SHF_MIPS_STRINGS | SHF_MIPS_NOSTRIP | SHF_MIPS_LOCAL \  +                     | SHF_MIPS_ADDR | SHF_MIPS_STRINGS | SHF_MIPS_NOSTRIP \
1144  +                     | SHF_MIPS_NAMES | SHF_MIPS_NODUPE)  +                     | SHF_MIPS_LOCAL | SHF_MIPS_NAMES | SHF_MIPS_NODUPE)
1145         if (shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS)         if (shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS)
1146          {          {
1147            GElf_Xword sh_flags = shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS;            GElf_Xword sh_flags = shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS;
# Line 1206  Index: elfutils-0.155/backends/mips_attr Line 1163  Index: elfutils-0.155/backends/mips_attr
1163  ===================================================================  ===================================================================
1164  --- /dev/null  --- /dev/null
1165  +++ elfutils-0.155/backends/mips_attrs.c  +++ elfutils-0.155/backends/mips_attrs.c
1166  @@ -0,0 +1,65 @@  @@ -0,0 +1,61 @@
1167  +/* Object attribute tags for PowerPC.  +/* Object attribute tags for PowerPC.
1168  +   Copyright (C) 2008, 2009 Red Hat, Inc.  +   Copyright (C) 2008, 2009 Red Hat, Inc.
1169  +   This file is part of Red Hat elfutils.  +   This file is part of Red Hat elfutils.
# Line 1243  Index: elfutils-0.155/backends/mips_attr Line 1200  Index: elfutils-0.155/backends/mips_attr
1200  +#include "libebl_CPU.h"  +#include "libebl_CPU.h"
1201  +  +
1202  +bool  +bool
1203  +mips_check_object_attribute (ebl, vendor, tag, value, tag_name, value_name)  +mips_check_object_attribute (Ebl *ebl __attribute__ ((unused)),
1204  +     Ebl *ebl __attribute__ ((unused));  +                            const char *vendor, int tag, uint64_t value,
1205  +     const char *vendor;  +                            const char **tag_name, const char **value_name)
 +     int tag;  
 +     uint64_t value;  
 +     const char **tag_name;  
 +     const char **value_name;  
1206  +{  +{
1207  +  if (!strcmp (vendor, "gnu"))  +  if (!strcmp (vendor, "gnu"))
1208  +    switch (tag)  +    switch (tag)

Legend:
Removed from v.1187190  
changed lines
  Added in v.1187195

  ViewVC Help
Powered by ViewVC 1.1.30