]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Merge branch 'pending' into pending-unwind
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 12 Oct 2012 18:03:13 +0000 (20:03 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 12 Oct 2012 18:03:13 +0000 (20:03 +0200)
Conflicts:
backends/Makefile.am
backends/ppc64_get_func_pc.c
backends/ppc64_init.c
backends/s390_corenote.c
backends/s390_init.c
libdwfl/dwfl_module_addrsym.c
libebl/Makefile.am
libebl/ebl-hooks.h
libebl/eblgetfuncpc.c
libebl/libebl.h

1  2 
backends/Makefile.am
backends/ppc64_init.c
backends/s390_init.c
libebl/Makefile.am
libebl/ebl-hooks.h
libebl/libebl.h
src/readelf.c

index 35da6afcfa70f1a9d7b968ae9477e3d787f519f8,243a95acbd9160108ad4396b0321caab15537c51..ad909dab46e94d20f6c66efd836e1ea6977836af
@@@ -94,13 -91,12 +94,13 @@@ am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRC
  
  ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
             ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
-            ppc_frame_state.c ppc_cfi.c ppc64_get_func_pc.c
 -           ppc64_get_func_pc.c
++           ppc64_get_func_pc.c ppc_frame_state.c ppc_cfi.c
  libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
  am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
  
- s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c s390_cfi.c \
-           s390_frame_state.c s390_corenote.c s390x_corenote.c \
+ s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c \
 -          s390_corenote.c s390x_corenote.c
++          s390_corenote.c s390x_corenote.c s390_cfi.c s390_frame_state.c \
 +          s390_frame_unwind.c
  libebl_s390_pic_a_SOURCES = $(s390_SRCS)
  am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
  
index e7ad82234101e905d80369599b0203fabe2dd92a,da7d02ced0f86c76293f28b2722adc4bd30ab48d..32ca876edcd68c8ddc36e0967645cc821627cba1
@@@ -64,13 -64,8 +64,15 @@@ ppc64_init (elf, machine, eh, ehlen
    HOOK (eh, syscall_abi);
    HOOK (eh, core_note);
    HOOK (eh, auxv_info);
+   HOOK (eh, get_func_pc);
+   HOOK (eh, destr);
 +  /* gcc/config/ #define DWARF_FRAME_REGISTERS.  */
 +  eh->frame_state_nregs = (114 - 1) + 32;
 +  HOOK (eh, frame_state);
 +  HOOK (eh, abi_cfi);
 +  HOOK (eh, frame_dwarf_to_regno);
 +  HOOK (eh, get_func_pc);
 +  HOOK (eh, destr);
  
    return MODVERSION;
  }
index ab6a71863134641c26fc154b17b65a4d125b4319,91fe4b8d15abfb325bd3a01ce55ee7b97653d140..5c9c092b25851992c4a9d4eaa3dd9d09e6eed3af
@@@ -55,22 -57,10 +57,19 @@@ s390_init (elf, machine, eh, ehlen
    HOOK (eh, reloc_simple_type);
    HOOK (eh, register_info);
    HOOK (eh, return_value_location);
-   if (eh->class == ELFCLASS64)
-     {
-       __typeof (s390_core_note) s390x_core_note;
-       eh->core_note = s390x_core_note;
-     }
-   else
-     HOOK (eh, core_note);
+   if (eh->class == ELFCLASS64)
+     eh->core_note = s390x_core_note;
+   else
+     HOOK (eh, core_note);
 +  HOOK (eh, abi_cfi);
 +  /* gcc/config/ #define DWARF_FRAME_REGISTERS 34.
 +     But from the gcc/config/s390/s390.h "Register usage." comment it looks as
 +     if #32 (Argument pointer) and #33 (Condition code) are not used for
 +     unwinding.  */
 +  eh->frame_state_nregs = 32;
 +  HOOK (eh, frame_state);
 +  HOOK (eh, normalize_pc);
 +  HOOK (eh, frame_unwind);
  
    /* Only the 64-bit format uses the incorrect hash table entry size.  */
    if (eh->class == ELFCLASS64)
index 64ae23677d24872fc7e8de72146c885ed1193c06,1ab08e7d573adb2abaff65fcb18e73f1c1a2dca4..580d213e8dec704a9922922d5047a4cafaa7d82a
@@@ -54,8 -54,7 +54,8 @@@ gen_SOURCES = eblopenbackend.c eblclose
              eblreginfo.c eblnonerelocp.c eblrelativerelocp.c \
              eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
              ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \
-             eblstother.c eblframestate.c eblgetfuncpc.c eblnormalizepc.c \
 -            eblstother.c eblgetfuncpc.c
++            eblstother.c eblgetfuncpc.c eblframestate.c eblnormalizepc.c \
 +            eblframeunwind.c eblframedwarftoregno.c
  
  libebl_a_SOURCES = $(gen_SOURCES)
  
index 90682d85df22c7a201d55b552b5a4a4a721ab704,5651dd6af7368bed4ce7289dbb2f744f72ad198e..38ec942c832bf4d20719130cadfba88ffbb102bd
@@@ -159,40 -154,11 +159,40 @@@ int EBLHOOK(disasm) (const uint8_t **st
  /* Supply the machine-specific state of CFI before CIE initial programs.  */
  int EBLHOOK(abi_cfi) (Ebl *ebl, Dwarf_CIE *abi_info);
  
- /* *SYM must be STT_FUNC.  Then if it describes a function descriptor (PPC64)
-    convert in-place its data and return a possibly different new name for it.
-    The name is valid as long as EBL is valid.  */
- const char *EBLHOOK(get_func_pc) (Ebl *ebl, Dwfl_Module *mod, GElf_Sym *sym);
+ /* *SYM must be STT_FUNC.  Then if it describes a function descriptor (PPC64)
+    convert in-place its data and return a possibly different new name for it.
+    The name is valid as long as EBL is valid.  */
+ const char *EBLHOOK(get_func_pc) (Ebl *ebl, struct Dwfl_Module *mod,
+                                 GElf_Sym *sym);
 +/* Fetch process data from STATE->base->pid or STATE->base->core.  */
 +bool EBLHOOK(frame_state) (Dwarf_Frame_State *state);
 +
 +/* Number of Dwarf_Frame_State->regs entries to allocate for frame_state
 +   above.  */
 +size_t EBLHOOKVAR(frame_state_nregs);
 +
 +/* Convert *REGNO as is in DWARF to a lower range suitable for
 +   Dwarf_Frame_State->REGS indexing.  RETURN_ADDRESS_REGISTER should not change
 +   on second call; other registers may map to numbers invalid on input.  */
 +bool EBLHOOK(frame_dwarf_to_regno) (Ebl *ebl, unsigned *regno);
 +
 +/* Optionally modify *PC as fetched from inferior data into valid PC
 +   instruction pointer.  */
 +void EBLHOOK(normalize_pc) (Ebl *ebl, Dwarf_Addr *pc);
 +
 +/* See dwfl_frame_unwind.  */
 +bool
 +  EBLHOOK(frame_unwind) (Ebl *ebl, Dwarf_Frame_State **statep, Dwarf_Addr pc,
 +                       bool
 +                         (*memory_read) (Dwarf_Frame_State_Process *process,
 +                                         Dwarf_Addr addr,
 +                                         Dwarf_Addr *result));
 +
  /* Destructor for ELF backend handle.  */
  void EBLHOOK(destr) (struct ebl *);
 +
 +#ifdef EBLHOOKVAR_STUB
 +# undef EBLHOOKVAR
 +# undef EBLHOOKVAR_STUB
 +#endif
diff --cc libebl/libebl.h
index 70f52047575ea22562916cdcb5c8e561170afe26,34c245efa6e970a23875d9115967646ec040e4b7..a3f695557cedf4625b29efd77d30a2978ca4c8d4
@@@ -376,32 -375,12 +376,34 @@@ extern int ebl_auxv_info (Ebl *ebl, GEl
                          const char **name, const char **format)
    __nonnull_attribute__ (1, 3, 4);
  
- /* Convert function descriptor to the function PC value.  */
- extern const char *ebl_get_func_pc (Ebl *ebl, Dwfl_Module *mod, GElf_Sym *sym)
-   __nonnull_attribute__ (1, 2, 3);
+ /* Convert function descriptor SYM to the function PC value in-place.  */
+ struct Dwfl_Module;
+ extern const char *ebl_get_func_pc (Ebl *ebl, struct Dwfl_Module *mod,
+                                   GElf_Sym *sym)
+   __nonnull_attribute__ (1, 2, 3);
 +/* Fetch process data from STATE->base->pid or STATE->base->core.  */
 +extern bool ebl_frame_state (Dwarf_Frame_State *state)
 +  __nonnull_attribute__ (1);
 +
 +/* Number of registers to allocate for STATE of ebl_frame_state.  */
 +extern size_t ebl_frame_state_nregs (Ebl *ebl)
 +  __nonnull_attribute__ (1);
 +
 +/* Modify PC as fetched from inferior data into valid PC.  */
 +extern void ebl_normalize_pc (Ebl *ebl, Dwarf_Addr *pc)
 +  __nonnull_attribute__ (1, 2);
 +
 +/* Get previous frame state for an existing frame state.  */
 +extern bool
 +  ebl_frame_unwind (Ebl *ebl, Dwarf_Frame_State **statep, Dwarf_Addr pc,
 +                  bool (*memory_read) (Dwarf_Frame_State_Process *process,
 +                                       Dwarf_Addr addr, Dwarf_Addr *result))
 +  __nonnull_attribute__ (1, 2, 4);
 +
 +/* Convert *REGNO as is in DWARF to a lower range.  */
 +extern bool ebl_frame_dwarf_to_regno (Ebl *ebl, unsigned *regno)
 +  __nonnull_attribute__ (1, 2);
  
  #ifdef __cplusplus
  }
diff --cc src/readelf.c
Simple merge