diff options
author | Ben Cheng <bccheng@google.com> | 2012-03-07 23:04:02 -0800 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2012-03-08 17:00:54 -0800 |
commit | cc6695e2684ce93cdf8bd2da63d55d2cf49ff076 (patch) | |
tree | 58f9941f89a1bde4e068610a507f86c6cb02eadf /libebl | |
parent | 669e96ff41a1b72aa034a26563d90b4768d51482 (diff) | |
download | android_external_elfutils-cc6695e2684ce93cdf8bd2da63d55d2cf49ff076.tar.gz android_external_elfutils-cc6695e2684ce93cdf8bd2da63d55d2cf49ff076.tar.bz2 android_external_elfutils-cc6695e2684ce93cdf8bd2da63d55d2cf49ff076.zip |
Upgrade elfutils from version 0.97 to 0.138
This upgrade is in preparation for adding perf to the Android tree, where
perf needs newer version of elfutils.
This particular snapshot also cleans up the current makefile where only
the host version of libelf.a (needed by elftree). Additional build
targets for libebl.a, libebl_arm.a, and libebl_sh.a are eliminated since
they are not used in the tree at all.
Changes that build other target modules and associated modifications to
work with bionic will be added later.
Change-Id: Ifa808ba5ad2881ccb2c0cf44d134931faad801e1
Diffstat (limited to 'libebl')
103 files changed, 4331 insertions, 4826 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog index e749c226..51b3b705 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,700 @@ +2008-08-01 Roland McGrath <roland@redhat.com> + + * eblcorenotetypename.c: Handle NT_386_IOPERM. + +2008-07-28 Roland McGrath <roland@redhat.com> + + * eblauxvinfo.c (AUXV_TYPES): Add EXECFN. + + * eblauxvinfo.c (ebl_auxv_info): Handle missing elements of standard + table. + +2008-07-04 Roland McGrath <roland@redhat.com> + + * libebl.h: Declare ebl_syscall_abi. + * ebl_syscall_abi.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * ebl-hooks.h: New hook syscall_abi. + * eblopenbackend.c (default_syscall_abi): New function. + (fill_defaults): Use it. + +2008-03-31 Roland McGrath <roland@redhat.com> + + * ebldynamictagname.c (ebl_dynamic_tag_name): Use hex for unknown tag. + + * ebl-hooks.h: Add check_special_section hook. + * eblopenbackend.c (fill_defaults): Set new hook to ... + (default_check_special_section): ... this, new function. + * ebl_check_special_section.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * libebl.h: Declare it. + +2008-02-20 Roland McGrath <roland@redhat.com> + + * libebl.h: Declare ebl_check_object_attribute. + * eblcheckobjattr.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * ebl-hooks.h: Add check_object_attribute hook. + * eblopenbackend.c (default_check_object_attribute): New function. + (fill_defaults): Initialize pointer to it. + +2008-02-19 Roland McGrath <roland@redhat.com> + + * eblsectiontypename.c (ebl_section_type_name): + Handle SHT_GNU_ATTRIBUTES. + +2008-02-08 Roland McGrath <roland@redhat.com> + + * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PPC_SPE. + +2008-01-30 Roland McGrath <roland@redhat.com> + + * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_386_TLS. + +2007-10-18 Roland McGrath <roland@redhat.com> + + * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PPC_VMX. + +2007-10-11 Roland McGrath <roland@redhat.com> + + * eblobjnote.c (ebl_object_note): Translate target format (byte-swap) + for NT_GNU_ABI_TAG contents. + +2007-08-22 Roland McGrath <roland@redhat.com> + + * libebl.h (Ebl_Core_Item): New member `group'. + +2007-08-19 Roland McGrath <roland@redhat.com> + + * ebl-hooks.h: Add new hook auxv_info. + * eblopenbackend.c (default_auxv_info): New function. + (fill_defaults): Initialize auxv_info hook. + * eblauxvinfo.c : New file. + * Makefile.am (gen_SOURCES): Add it. + * libebl.h: Declare ebl_auxv_info. + + * eblcorenote.c: Rewritten with new signature. + * Makefile.am (gen_SOURCES): Add it. + * libebl.h (Ebl_Register_Location, Ebl_Core_Item): New types. + (ebl_core_note_info): Completely revamp signature. + * ebl-hooks.h: Update decl. + * eblopenbackend.c (default_core_note): Update signature. + +2007-07-09 Roland McGrath <roland@redhat.com> + + * eblobjnotetypename.c (ebl_object_note_type_name): Handle + NT_GNU_HWCAP, NT_GNU_BUILD_ID. + + * eblobjnote.c (ebl_object_note): Handle NT_GNU_BUILD_ID. + +2007-04-22 Roland McGrath <roland@redhat.com> + + * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PRXFPREG. + +2007-03-10 Roland McGrath <roland@redhat.com> + + * eblcorenote.c (ebl_core_note): For normally-zero types, + print in hex if not zero. + +2007-01-11 Roland McGrath <roland@redhat.com> + + * ebl-hooks.h (machine_section_flag_check): New hook. + * libebl.h: Declare ebl_machine_section_flag_check. + * eblmachinesectionflagcheck.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * eblopenbackend.c (default_machine_section_flag_check): New function. + (fill_defaults): Use it. + +2006-09-04 Roland McGrath <roland@redhat.com> + + * ebl-hooks.h: Replace register_name hook with register_info. + Also yield natural bit width and base type encoding. + * eblopenbackend.c (default_register_name): Renamed + default_register_info, new args added. + (fill_defaults): Update initialization. + * eblregname.c: File renamed ... + * eblreginfo.c: ... to this. + (ebl_register_name): Renamed to ebl_register_info, new args added. + * libebl.h: Update decl. + + * Makefile.am (gen_SOURCES): Update list. + +2006-07-06 Ulrich Drepper <drepper@redhat.com> + + * ebldynamictagname.c: Add support for DT_GNU_HASH. + * ebldynamictagcheck.c: Likewise. + * eblsectiontypename.c: Add support for SHT_GNU_HASH. + +2006-07-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (gen_SOURCES): Add eblsysvhashentrysize.c. + * libeblP.h (struct ebl): Add sysvhash_entrysize element. + * eblopenbackend.c (fill_defaults): Initialize sysvhash_entrysize. + + * eblopenbackend.c (openbackend): If possible, fill machine, class, + and data values in from the ELF file. + +2006-07-04 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (gen_SOURCES): Add eblrelativerelocp.c. + * eblrelativerelocp.c: New file. + * ebl-hooks.c: Add relative_reloc_p. + * eblopenbackend.c (default_relative_reloc_p): New function. + (fill_defaults): Hook it up. + * libebl.h: Declare ebl_relative_reloc_p. + +2006-06-12 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (gen_SOURCES): Add eblnonerelocp.c. + * eblnonerelocp.c: New file. + * ebl-hooks.c: Add none_reloc_p. + * eblopenbackend.c (default_none_reloc_p): New function. + (fill_defaults): Hook it up. + * libebl.h: Declare ebl_none_reloc_p. + +2006-05-27 Ulrich Drepper <drepper@redhat.com> + + * libebl.h: Add extern "C". + +2005-11-25 Roland McGrath <roland@redhat.com> + + * eblregname.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * ebl-hooks.h: Declare register_name hook. + * libebl.h: Declare ebl_register_name. + * eblopenbackend.c (default_register_name): New function. + (fill_defaults): Use it. + +2005-11-16 Roland McGrath <roland@redhat.com> + + * libebl.h: Use "" for elf-knowledge.h, not <>. + +2005-11-15 Roland McGrath <roland@redhat.com> + + * Makefile.am: Removed everything for building libebl_*.so modules, + now in ../backends/Makefile.am instead. + * alpha_init.c: Moved to ../backends. + * alpha_reloc.def: Likewise. + * alpha_retval.c: Likewise. + * alpha_symbol.c: Likewise. + * arm_init.c: Likewise. + * arm_reloc.def: Likewise. + * arm_symbol.c: Likewise. + * common-reloc.c: Likewise. + * i386_corenote.c: Likewise. + * i386_init.c: Likewise. + * i386_reloc.def: Likewise. + * i386_retval.c: Likewise. + * i386_symbol.c: Likewise. + * ia64_init.c: Likewise. + * ia64_reloc.def: Likewise. + * ia64_symbol.c: Likewise. + * libebl_CPU.h: Likewise. + * ppc64_init.c: Likewise. + * ppc64_reloc.def: Likewise. + * ppc64_retval.c: Likewise. + * ppc64_symbol.c: Likewise. + * ppc_init.c: Likewise. + * ppc_reloc.def: Likewise. + * ppc_retval.c: Likewise. + * ppc_symbol.c: Likewise. + * s390_init.c: Likewise. + * s390_reloc.def: Likewise. + * s390_symbol.c: Likewise. + * sh_init.c: Likewise. + * sh_reloc.def: Likewise. + * sh_symbol.c: Likewise. + * sparc_init.c: Likewise. + * sparc_reloc.def: Likewise. + * sparc_symbol.c: Likewise. + * x86_64_corenote.c: Likewise. + * x86_64_init.c: Likewise. + * x86_64_reloc.def: Likewise. + * x86_64_retval.c: Likewise. + * x86_64_symbol.c: Likewise. + + * libebl.h: Comment fixes. + + * alpha_retval.c: New file. + * Makefile.am (alpha_SRCS): Add it. + * alpha_init.c (alpha_init): Initialize return_value_location hook. + + * ppc64_retval.c: New file. + * Makefile.am (ppc64_SRCS): Add it. + * ppc64_init.c (ppc64_init): Initialize return_value_location hook. + + * ppc_retval.c: New file. + * Makefile.am (ppc_SRCS): Add it. + * ppc_init.c (ppc_init): Initialize return_value_location hook. + +2005-11-14 Roland McGrath <roland@redhat.com> + + * ia64_init.c (ia64_init): Initialize EH->reloc_simple_type. + * sh_init.c (sh_init): Likewise. + * x86_64_init.c (x86_64_init): Likewise. + + * sparc_symbol.c (sparc_reloc_simple_type): New function. + * sparc_init.c (sparc_init): Use it. + + * arm_symbol.c (arm_reloc_simple_type): New function. + * arm_init.c (arm_init): Use it. + + * alpha_symbol.c (alpha_reloc_simple_type): New function. + * alpha_init.c (alpha_init): Use it. + + * ia64_reloc.def: Update bits per H. J. Lu <hjl@lucon.org>. + + * arm_reloc.def: Update bits per Daniel Jacobowitz <drow@false.org>. + + * alpha_reloc.def: Update bits per Richard Henderson <rth@redhat.com>. + +2005-11-13 Roland McGrath <roland@redhat.com> + + * x86_64_retval.c: New file. + * Makefile.am (x86_64_SRCS): Add it. + * x86_64_init.c (x86_64_init): Use x86_64_return_value_location. + + * i386_retval.c: New file. + * Makefile.am (i386_SRCS): Add it. + (libdw): New variable. + (libebl_%.so): Use $(libdw) in link; use --as-needed. + * i386_init.c (i386_init): Use i386_return_value_location. + + * eblretval.c: New file. + * Makefile.am (gen_SOURCES): Add it. + (INCLUDES): Search in libdw. + * libebl.h: Include <libdw.h>. Declare ebl_return_value_location. + * ebl-hooks.h: Declare return_value_location hook. + * eblopenbackend.c (default_return_value_location): New function. + (fill_defaults): Use it. + +2005-11-10 Roland McGrath <roland@redhat.com> + + * s390_init.c: New file. + * s390_reloc.def: New file. + * s390_symbol.c: New file. + * Makefile.am (modules, libebl_pic): Add s390. + (s390_SRCS, libebl_s390_pic_a_SOURCES): New variables. + (am_libebl_s390_pic_a_OBJECTS): New variable. + + * ppc64_init.c: Use common-reloc.c. + * ppc64_symbol.c (ppc64_backend_name): Removed. + (ppc64_reloc_type_check, ppc64_reloc_type_name): Likewise. + (ppc64_copy_reloc_p, ppc64_reloc_valid_use): Likewise. + + * ppc_init.c: Use common-reloc.c. + * ppc_symbol.c (ppc_backend_name): Removed. + (ppc_reloc_type_name, ppc_reloc_type_check): Likewise. + (ppc_reloc_valid_use, ppc_copy_reloc_p): Likewise. + + * sparc_init.c: Use common-reloc.c. + * sparc_symbol.c (sparc_backend_name): Removed. + (sparc_reloc_type_name, sparc_reloc_type_check): Likewise. + (sparc_copy_reloc_p): Likewise. + + * arm_init.c: Use common-reloc.c. + * arm_symbol.c (arm_backend_name): Removed. + (arm_reloc_type_name, arm_reloc_type_check, arm_copy_reloc_p): Removed. + + * alpha_init.c: Use common-reloc.c. + * alpha_symbol.c (alpha_backend_name): Removed. + (alpha_reloc_type_name, alpha_reloc_type_check): Likewise. + (alpha_copy_reloc_p): Likewise. + + * ia64_symbol.c (ia64_backend_name): Removed. + (ia64_reloc_type_name, ia64_reloc_type_check): Likewise. + (ia64_copy_reloc_p): Likewise. + + * x86_64_init.c: Use common-reloc.c. + * x86_64_symbol.c (x86_64_backend_name): Removed. + (x86_64_copy_reloc_p, x86_64_reloc_valid_use): Likewise. + (x86_64_reloc_type_check, x86_64_reloc_type_name): Likewise. + + * sh_init.c: Use common-reloc.c. + * sh_symbol.c: All functions removed. + (sh_reloc_simple_type): New function. + (sh_gotpc_reloc_check): New function. + + * common-reloc.c: New file. + * Makefile.am (noinst_HEADERS): Add it. + * i386_init.c: Include it. + + * sh_reloc.def: New file. + * i386_reloc.def: New file. + * alpha_reloc.def: New file. + * arm_reloc.def: New file. + * i386_reloc.def: New file. + * ia64_reloc.def: New file. + * ppc64_reloc.def: New file. + * ppc_reloc.def: New file. + * sh_reloc.def: New file. + * sparc_reloc.def: New file. + * x86_64_reloc.def: New file. + * Makefile.am (EXTRA_DIST): Add $(modules:=_reloc.def). + + * libebl_alpha.map: Removed. + * libebl_ia64.map: Removed. + * libebl_ppc.map: Removed. + * libebl_sparc.map: Removed. + * libebl_arm.map: Removed. + * libebl_i386.map: Removed. + * libebl_ppc64.map: Removed. + * libebl_sh.map: Removed. + * libebl_x86_64.map: Removed. + * Makefile.am (EXTRA_DIST): Remove them. + (libebl_%.map, libebl_%.so): New pattern rules. + + * libebl_alpha.h: Removed. + * libebl_ia64.h: Removed. + * libebl_ppc.h: Removed. + * libebl_sparc.h: Removed. + * libebl_arm.h: Removed. + * libebl_i386.h: Removed. + * libebl_ppc64.h: Removed. + * libebl_sh.h: Removed. + * libebl_x86_64.h: Removed. + * Makefile.am (noinst_HEADERS): Remove them. + + * x86_64_corenote.c: Use libebl_CPU.h instead. + * x86_64_symbol.c: Likewise. + * i386_corenote.c: Likewise. + +2005-11-09 Roland McGrath <roland@redhat.com> + + * ia64_symbol.c (ia64_reloc_simple_type): New function. + + * ebl-hooks.h (reloc_simple_type): Take the Ebl handle, not Elf handle. + * eblrelocsimpletype.c (ebl_reloc_simple_type): Update caller. + * eblopenbackend.c (default_reloc_simple_type): Update signature. + * i386_symbol.c (i386_reloc_simple_type): Likewise. + * ppc64_symbol.c (ppc64_reloc_simple_type): Likewise. + * ppc_symbol.c (ppc_reloc_simple_type): Likewise. + * x86_64_symbol.c (x86_64_reloc_simple_type): Likewise. + + * i386_symbol.c (i386_backend_name): Removed. + (i386_reloc_type_name, i386_reloc_type_check): Likewise. + (i386_reloc_valid_use): Removed. + (i386_copy_reloc_p): Removed. + + * alpha_destr.c: Removed. + * arm_destr.c: Removed. + * i386_destr.c: Removed. + * ia64_destr.c: Removed. + * ppc64_destr.c: Removed. + * ppc_destr.c: Removed. + * sh_destr.c: Removed. + * sparc_destr.c: Removed. + * x86_64_destr.c: Removed. + + * ebl-hooks.h: New file, broken out of ... + * libeblP.h (struct ebl): ... here. #include that for hook + declarations, after defining EBLHOOK macro. + * libebl_CPU.h: New file. + * Makefile.am (noinst_HEADERS): Add them. + + * libeblP.h (struct ebl): Use uint_fast16_t for machine, + and uint_fast8_t for class and data. + +2005-08-14 Roland McGrath <roland@redhat.com> + + * ia64_symbol.c (ia64_section_type_name): New function. + (ia64_dynamic_tag_check): New function. + (ia64_reloc_valid_use): New function. + * libebl_ia64.h: Declare them. + * ia64_init.c (ia64_init): Use them. + * Makefile.am (libebl_ia64.so): Link with libelf. + +2005-08-28 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Use $(LINK) not $(CC) when creating DSOs. + +2005-08-13 Roland McGrath <roland@redhat.com> + + * ia64_symbol.c (ia64_machine_flag_check): New function. + * libebl_ia64.h: Declare it. + * ia64_init.c (ia64_init): Use it. + +2005-08-13 Ulrich Drepper <drepper@redhat.com> + + * libebl.h: Add ehdr parameter to ebl_bss_plt_p and + ebl_check_special_symbol. + * libeblP.h (struct ebl): Adjust callback functions. + * eblopenbackend.c: Adjust dummy functions. + * ebl_check_special_symbol.c: Add parameter and pass it on. + * eblbsspltp.c: Likewise. + * ppc_symbol.c (find_dyn_got): With ehdr passed, simplify search for + the dynamic section entry. + (ppc_check_special_symbol): Add ehdr parameter. + (ppc_bss_plt_p): Likewise. + * libebl_ppc.h: Adjust prototypes. + * ppc64_symbol.c (ppc_check_special_symbol): Add ehdr parameter. + (ppc_bss_plt_p): Likewise. + * libebl_ppc64.h: Adjust prototypes. + +2005-08-12 Roland McGrath <roland@redhat.com> + + * ppc_symbol.c (find_dyn_got): New function, broken out of ... + (ppc_bss_plt_p): ... here. Call that. + (ppc_check_special_symbol): Use find_dyn_got to fetch value to check + against _GLOBAL_OFFSET_TABLE_. + + * libeblP.h (struct ebl): Add bss_plt_p hook. + * eblopenbackend.c (default_bss_plt_p): New function. + (fill_defaults): Use it. + * eblbsspltp.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * libebl.h: Declare ebl_bss_plt_p. + * ppc_symbol.c (ppc_bss_plt_p): New function. + * libebl_ppc.h: Declare it. + * ppc_init.c (ppc_init): Use it. + * ppc64_symbol.c (ppc64_bss_plt_p): New function. + * libebl_ppc64.h: Declare it. + * ppc64_init.c (ppc64_init): Use it. + + * ebl_check_special_symbol.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * libebl.h: Declare ebl_check_special_symbol. + * libeblP.h (struct ebl): Add check_special_symbol hook. + * eblopenbackend.c (default_check_special_symbol): New function. + (fill_defaults): Use it. + * ppc_symbol.c (ppc_check_special_symbol): New function. + * libebl_ppc.h: Add prototype. + * ppc_init.c (ppc_init): Use it. + * ppc64_symbol.c (ppc64_check_special_symbol): New function. + * libebl_ppc64.h: Add prototype. + * ppc64_init.c (ppc64_init): Use it. + +2005-08-07 Ulrich Drepper <drepper@redhat.com> + + * ppc_init.c: Add support for new DT_PPC_* and R_PPC_* values. + * ppc_symbol.c: Likewise. + * libebl_ppc.h: Likewise. + * ppc64_init.c: There is now also a dynamic_tag_check functions + * ppc64_symbol.c: Add dynamic_tag_check. + * libebl_ppc64.h: Add prototype. + * alpha_init.c: Add support for new DT_ALPHA_* value. + * alpha_symbol.c: Likewise. + * libebl_alpha.h: Likewise. + +2005-08-03 Ulrich Drepper <drepper@redhat.com> + + * libebl_alpha.map: Remove unnecessary exports. + * libebl_arm.map: Likewise. + * libebl_i386.map: Likewise. + * libebl_ia64.map: Likewise. + * libebl_ppc.map: Likewise. + * libebl_ppc64.map: Likewise. + * libebl_sh.map: Likewise. + * libebl_sparc.map: Likewise. + * libebl_x86_64.map: Likewise. + +2005-08-02 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (libebl_a_SOURCES): Add eblelfclass.c, eblelfdata.c, + and eblelfmachine.c. + * elbopenbackend.c (machines): Add class and data fields. Initialize + them. + (ebl_openbackend): Initialize machine, class, data fields in result. + * libebl.h: Declare Add eblelfclass, eblelfdata, and eblelfmachine. + * libeblP.h (Ebl): Add machine, class, data fields. + +2005-07-23 Ulrich Drepper <drepper@redhat.com> + + * eblsectionstripp.c: New file. + * Makefile.am (gen_SOURCES): Add eblsectionstripp.c. + * i386_init.c (i386_init): Install specific debugscn_p callback. + * i386_symbol.c (i386_debugscn_p): New function. + * libebl.h: Declare ebl_section_strip_p. + * libebl_i386.h: Declare i386_debugscn_p. + + * libebl.h: Move Ebl definition to... + * libeblP.h: ...here. + +2005-07-21 Roland McGrath <roland@redhat.com> + + * Makefile.am (install-ebl-modules): New target, commands from ... + (install): ... here. Make this depend on it. + (LIBEBL_SUBDIR): New variable, substituted by configure. + (install-ebl-modules): Install in $(libdir)/$(LIBEBL_SUBDIR). + * eblopenbackend.c (openbackend): Use LIBEBL_SUBDIR in module name. + +2005-07-21 Ulrich Drepper <drepper@redhat.com> + + * eblcopyrelocp.c: New file. + * Makefile.am (gen_SOURCES): Add eblcopyrelocp.c. + * libebl.h: Declare ebl_copy_reloc_p. + * eblopenbackend.c (fill_defaults): Fill in copy_reloc_p. + (default_copy_reloc_p): New function. + * alpha_init.c: Define and use arch-specific copy_reloc_p function. + * alpha_symbol.c: Likewise. + * arm_init.c: Likewise. + * arm_symbol.c: Likewise. + * i386_init.c: Likewise. + * i386_symbol.c: Likewise. + * ia64_init.c: Likewise. + * ia64_symbol.c: Likewise. + * ppc64_init.c: Likewise. + * ppc64_symbol.c: Likewise. + * ppc_init.c: Likewise. + * ppc_symbol.c: Likewise. + * sh_init.c: Likewise. + * sh_symbol.c: Likewise. + * sparc_init.c: Likewise. + * sparc_symbol.c: Likewise. + * x86_64_init.c: Likewise. + * x86_64_symbol.c: Likewise. + * libebl_alpha.h: Declare the copy_reloc_p function. + * libebl_arm.h: Likewise. + * libebl_i386.h: Likewise. + * libebl_ia64.h: Likewise. + * libebl_ppc.h: Likewise. + * libebl_ppc64.h: Likewise. + * libebl_sh.h: Likewise. + * libebl_sparc.h: Likewise. + * libebl_x86_64.h: Likewise. + +2005-05-31 Roland McGrath <roland@redhat.com> + + * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency + tracking works right. + +2005-05-21 Ulrich Drepper <drepper@redhat.com> + + * libebl_x86_64.map: Add x86_64_core_note. + +2005-05-19 Roland McGrath <roland@redhat.com> + + * libebl_i386.map: Add i386_reloc_valid_use, i386_reloc_simple_type. + * libebl_ppc.map: Add ppc_reloc_simple_type. + * libebl_ppc64.map: Add ppc64_reloc_simple_type. + * libebl_x86_64.map: Add x86_64_reloc_simple_type. + +2005-05-11 Ulrich Drepper <drepper@redhat.com> + + * eblcorenote.c: Handle new AT_* values and files with different + endianess. + * Makefile.am (x86_64_SRCS): Add x86_64_corenote.c. + * x86-64_corenote.c: New file. + * x86_64_init.c: Hook in x86_64_corenote. + * i386_corenote.c: Make file usable on 64-bit platforms. + + * eblopenbackend.c: If modules version comparison fails, reinitialize + hooks. + +2005-05-10 Ulrich Drepper <drepper@redhat.com> + + * eblopenbackend.c: Require the init function to return a string. + Compare it with MODVERSION from config.h. + * alpha_init.c: Change return type. Return MODVERSION or NULL. + * arm_init.c: Likewise. + * eblopenbackend.c: Likewise. + * i386_init.c: Likewise. + * ia64_init.c: Likewise. + * ppc64_init.c: Likewise. + * ppc_init.c: Likewise. + * sh_init.c: Likewise. + * sparc_init.c: Likewise. + * x86_64_init.c: Likewise. + * libeblP.h: Adjust ebl_bhinit_t. + * libebl_alpha.h: Adjust init function prototype. + * libebl_arm.h: Likewise. + * libebl_i386.h: Likewise. + * libebl_ia64.h: Likewise. + * libebl_ppc.h: Likewise. + * libebl_ppc64.h: Likewise. + * libebl_sh.h: Likewise. + * libebl_sparc.h: Likewise. + * libebl_x86_64.h: Likewise. + + * mips_destr.c: Removed. + * mips_init.c: Removed. + * mips_symbol.c: Removed. + * libebl_mips.h: Removed. + * libebl_mips.map: Removed. + +2005-05-03 Roland McGrath <roland@redhat.com> + + * libebl.h (Ebl): Add `reloc_simple_type' member. + * eblopenbackend.c (default_reloc_simple_type): New function. + (openbackend): Use that as default reloc_simple_type callback. + * eblrelocsimpletype.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * i386_symbol.c (i386_reloc_simple_type): New function. + * libebl_i386.h: Declare it. + * i386_init.c (i386_init): Use it. + * x86_64_symbol.c (x86_64_reloc_simple_type): New function. + * libebl_x86_64.h: Declare it. + * x86_64_init.c (x86_64_init): Use it. + * ppc_symbol.c (ppc_reloc_simple_type): New function. + * libebl_ppc.h: Declare it. + * ppc_init.c (ppc_init): Use it. + * ppc64_symbol.c (ppc64_reloc_simple_type): New function. + * libebl_ppc64.h: Declare it. + * ppc64_init.c (ppc64_init): Use it. + +2005-03-17 Ulrich Drepper <drepper@redhat.com> + + * eblcorenote.c (ebl_core_note): Add support for AT_SECURE. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (AM_CFLAGS): Add -Wformat=2. + +2005-02-14 Ulrich Drepper <drepper@redhat.com> + + * alpha_destr.c: Add __attribute__((unused)) where needed. + * alpha_init.c: Likewise. + * alpha_symbol.c: Likewise. + * arm_destr.c: Likewise. + * arm_init.c: Likewise. + * arm_symbol.c: Likewise. + * i386_corenote.c: Likewise. + * i386_destr.c: Likewise. + * i386_init.c: Likewise. + * i386_symbol.c: Likewise. + * ia64_destr.c: Likewise. + * ia64_init.c: Likewise. + * ia64_symbol.c: Likewise. + * mips_destr.c: Likewise. + * mips_init.c: Likewise. + * mips_symbol.c: Likewise. + * ppc64_destr.c: Likewise. + * ppc64_init.c: Likewise. + * ppc64_symbol.c: Likewise. + * ppc_destr.c: Likewise. + * ppc_init.c: Likewise. + * ppc_symbol.c: Likewise. + * sh_destr.c: Likewise. + * sh_init.c: Likewise. + * sh_symbol.c: Likewise. + * sparc_destr.c: Likewise. + * sparc_init.c: Likewise. + * sparc_symbol.c: Likewise. + * x86_64_destr.c: Likewise. + * x86_64_init.c: Likewise. + * x86_64_symbol.c: Likewise. + + * x86_64_symbol.c (reloc_map_table): Fix entries for R_X86_64_64 + and R_X86_64_32.. + +2005-02-06 Ulrich Drepper <drepper@redhat.com> + + * eblstrtab.c: A few cleanups. + + * eblopenbackend.c: Mark unused parameters. + + * eblgstrtab.c: Cleanups a few printf format strings. + + * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Check for text relocations in constructed DSOs. + + * eblstrtab.c: Minor cleanups. + + * Makefile.am (AM_CFLAGS): Add -std=gnu99 and -fmudflap for MUDFLAP. + 2004-08-16 Ulrich Drepper <drepper@redhat.com> * Makefile.am (AM_CFLAGS): Add LIBSTR definition with base name of diff --git a/libebl/Makefile b/libebl/Makefile deleted file mode 100644 index a425eb04..00000000 --- a/libebl/Makefile +++ /dev/null @@ -1,787 +0,0 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. -# libebl/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - - -SOURCES = $(libebl_a_SOURCES) $(libebl_alpha_pic_a_SOURCES) $(libebl_arm_pic_a_SOURCES) $(libebl_i386_pic_a_SOURCES) $(libebl_ia64_pic_a_SOURCES) $(libebl_mips_pic_a_SOURCES) $(libebl_ppc64_pic_a_SOURCES) $(libebl_ppc_pic_a_SOURCES) $(libebl_sh_pic_a_SOURCES) $(libebl_sparc_pic_a_SOURCES) $(libebl_x86_64_pic_a_SOURCES) $(libebl_alpha_so_SOURCES) $(libebl_arm_so_SOURCES) $(libebl_i386_so_SOURCES) $(libebl_ia64_so_SOURCES) $(libebl_mips_so_SOURCES) $(libebl_ppc_so_SOURCES) $(libebl_ppc64_so_SOURCES) $(libebl_sh_so_SOURCES) $(libebl_sparc_so_SOURCES) $(libebl_x86_64_so_SOURCES) - -srcdir = . -top_srcdir = .. - -pkgdatadir = $(datadir)/elfutils -pkglibdir = $(libdir)/elfutils -pkgincludedir = $(includedir)/elfutils -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = i686-pc-linux-gnu -host_triplet = i686-pc-linux-gnu -noinst_PROGRAMS = $(am__EXEEXT_1) -subdir = libebl -DIST_COMMON = $(euinclude_HEADERS) $(noinst_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)" -libLIBRARIES_INSTALL = $(INSTALL_DATA) -LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libebl_a_AR = $(AR) $(ARFLAGS) -libebl_a_LIBADD = -am__objects_1 = eblopenbackend.$(OBJEXT) eblclosebackend.$(OBJEXT) \ - eblstrtab.$(OBJEXT) eblreloctypename.$(OBJEXT) \ - eblsegmenttypename.$(OBJEXT) eblsectiontypename.$(OBJEXT) \ - eblmachineflagname.$(OBJEXT) eblsymboltypename.$(OBJEXT) \ - ebldynamictagname.$(OBJEXT) eblsectionname.$(OBJEXT) \ - eblobjecttypename.$(OBJEXT) eblsymbolbindingname.$(OBJEXT) \ - eblbackendname.$(OBJEXT) eblshflagscombine.$(OBJEXT) \ - eblwstrtab.$(OBJEXT) eblgstrtab.$(OBJEXT) \ - eblosabiname.$(OBJEXT) eblmachineflagcheck.$(OBJEXT) \ - eblreloctypecheck.$(OBJEXT) eblrelocvaliduse.$(OBJEXT) \ - ebldynamictagcheck.$(OBJEXT) eblcorenotetypename.$(OBJEXT) \ - eblobjnotetypename.$(OBJEXT) eblcorenote.$(OBJEXT) \ - eblobjnote.$(OBJEXT) ebldebugscnp.$(OBJEXT) \ - eblgotpcreloccheck.$(OBJEXT) -am_libebl_a_OBJECTS = $(am__objects_1) -libebl_a_OBJECTS = $(am_libebl_a_OBJECTS) -libebl_alpha_pic_a_AR = $(AR) $(ARFLAGS) -libebl_alpha_pic_a_LIBADD = -libebl_alpha_pic_a_OBJECTS = $(am_libebl_alpha_pic_a_OBJECTS) -libebl_arm_pic_a_AR = $(AR) $(ARFLAGS) -libebl_arm_pic_a_LIBADD = -libebl_arm_pic_a_OBJECTS = $(am_libebl_arm_pic_a_OBJECTS) -libebl_i386_pic_a_AR = $(AR) $(ARFLAGS) -libebl_i386_pic_a_LIBADD = -libebl_i386_pic_a_OBJECTS = $(am_libebl_i386_pic_a_OBJECTS) -libebl_ia64_pic_a_AR = $(AR) $(ARFLAGS) -libebl_ia64_pic_a_LIBADD = -libebl_ia64_pic_a_OBJECTS = $(am_libebl_ia64_pic_a_OBJECTS) -libebl_mips_pic_a_AR = $(AR) $(ARFLAGS) -libebl_mips_pic_a_LIBADD = -libebl_mips_pic_a_OBJECTS = $(am_libebl_mips_pic_a_OBJECTS) -libebl_ppc64_pic_a_AR = $(AR) $(ARFLAGS) -libebl_ppc64_pic_a_LIBADD = -libebl_ppc64_pic_a_OBJECTS = $(am_libebl_ppc64_pic_a_OBJECTS) -libebl_ppc_pic_a_AR = $(AR) $(ARFLAGS) -libebl_ppc_pic_a_LIBADD = -libebl_ppc_pic_a_OBJECTS = $(am_libebl_ppc_pic_a_OBJECTS) -libebl_sh_pic_a_AR = $(AR) $(ARFLAGS) -libebl_sh_pic_a_LIBADD = -libebl_sh_pic_a_OBJECTS = $(am_libebl_sh_pic_a_OBJECTS) -libebl_sparc_pic_a_AR = $(AR) $(ARFLAGS) -libebl_sparc_pic_a_LIBADD = -libebl_sparc_pic_a_OBJECTS = $(am_libebl_sparc_pic_a_OBJECTS) -libebl_x86_64_pic_a_AR = $(AR) $(ARFLAGS) -libebl_x86_64_pic_a_LIBADD = -libebl_x86_64_pic_a_OBJECTS = $(am_libebl_x86_64_pic_a_OBJECTS) -am__EXEEXT_1 = libebl_i386.so$(EXEEXT) libebl_sh.so$(EXEEXT) \ - libebl_mips.so$(EXEEXT) libebl_x86_64.so$(EXEEXT) \ - libebl_ia64.so$(EXEEXT) libebl_alpha.so$(EXEEXT) \ - libebl_arm.so$(EXEEXT) libebl_sparc.so$(EXEEXT) \ - libebl_ppc.so$(EXEEXT) libebl_ppc64.so$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) -am_libebl_alpha_so_OBJECTS = -libebl_alpha_so_OBJECTS = $(am_libebl_alpha_so_OBJECTS) -libebl_alpha_so_LDADD = $(LDADD) -am_libebl_arm_so_OBJECTS = -libebl_arm_so_OBJECTS = $(am_libebl_arm_so_OBJECTS) -libebl_arm_so_LDADD = $(LDADD) -am_libebl_i386_so_OBJECTS = -libebl_i386_so_OBJECTS = $(am_libebl_i386_so_OBJECTS) -libebl_i386_so_LDADD = $(LDADD) -am_libebl_ia64_so_OBJECTS = -libebl_ia64_so_OBJECTS = $(am_libebl_ia64_so_OBJECTS) -libebl_ia64_so_LDADD = $(LDADD) -am_libebl_mips_so_OBJECTS = -libebl_mips_so_OBJECTS = $(am_libebl_mips_so_OBJECTS) -libebl_mips_so_LDADD = $(LDADD) -am_libebl_ppc_so_OBJECTS = -libebl_ppc_so_OBJECTS = $(am_libebl_ppc_so_OBJECTS) -libebl_ppc_so_LDADD = $(LDADD) -am_libebl_ppc64_so_OBJECTS = -libebl_ppc64_so_OBJECTS = $(am_libebl_ppc64_so_OBJECTS) -libebl_ppc64_so_LDADD = $(LDADD) -am_libebl_sh_so_OBJECTS = -libebl_sh_so_OBJECTS = $(am_libebl_sh_so_OBJECTS) -libebl_sh_so_LDADD = $(LDADD) -am_libebl_sparc_so_OBJECTS = -libebl_sparc_so_OBJECTS = $(am_libebl_sparc_so_OBJECTS) -libebl_sparc_so_LDADD = $(LDADD) -am_libebl_x86_64_so_OBJECTS = -libebl_x86_64_so_OBJECTS = $(am_libebl_x86_64_so_OBJECTS) -libebl_x86_64_so_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libebl_a_SOURCES) $(libebl_alpha_pic_a_SOURCES) \ - $(libebl_arm_pic_a_SOURCES) $(libebl_i386_pic_a_SOURCES) \ - $(libebl_ia64_pic_a_SOURCES) $(libebl_mips_pic_a_SOURCES) \ - $(libebl_ppc64_pic_a_SOURCES) $(libebl_ppc_pic_a_SOURCES) \ - $(libebl_sh_pic_a_SOURCES) $(libebl_sparc_pic_a_SOURCES) \ - $(libebl_x86_64_pic_a_SOURCES) $(libebl_alpha_so_SOURCES) \ - $(libebl_arm_so_SOURCES) $(libebl_i386_so_SOURCES) \ - $(libebl_ia64_so_SOURCES) $(libebl_mips_so_SOURCES) \ - $(libebl_ppc_so_SOURCES) $(libebl_ppc64_so_SOURCES) \ - $(libebl_sh_so_SOURCES) $(libebl_sparc_so_SOURCES) \ - $(libebl_x86_64_so_SOURCES) -DIST_SOURCES = $(libebl_a_SOURCES) $(libebl_alpha_pic_a_SOURCES) \ - $(libebl_arm_pic_a_SOURCES) $(libebl_i386_pic_a_SOURCES) \ - $(libebl_ia64_pic_a_SOURCES) $(libebl_mips_pic_a_SOURCES) \ - $(libebl_ppc64_pic_a_SOURCES) $(libebl_ppc_pic_a_SOURCES) \ - $(libebl_sh_pic_a_SOURCES) $(libebl_sparc_pic_a_SOURCES) \ - $(libebl_x86_64_pic_a_SOURCES) $(libebl_alpha_so_SOURCES) \ - $(libebl_arm_so_SOURCES) $(libebl_i386_so_SOURCES) \ - $(libebl_ia64_so_SOURCES) $(libebl_mips_so_SOURCES) \ - $(libebl_ppc_so_SOURCES) $(libebl_ppc64_so_SOURCES) \ - $(libebl_sh_so_SOURCES) $(libebl_sparc_so_SOURCES) \ - $(libebl_x86_64_so_SOURCES) -euincludeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(euinclude_HEADERS) $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run aclocal-1.9 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run tar -AUTOCONF = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run autoconf -AUTOHEADER = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run autoheader -AUTOMAKE = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run automake-1.9 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = -CYGPATH_W = echo -DATADIRNAME = ${prefix}/share -DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" -DEPDIR = .deps -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -GMSGFMT = /usr/bin/msgfmt -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -INTLLIBS = -LDFLAGS = -LEX = flex -LEXLIB = -lfl -LEX_OUTPUT_ROOT = lex.yy -LIBICONV = -liconv -LIBINTL = -LIBOBJS = -LIBS = -LOCALEDIR = ${prefix}/share -LTLIBICONV = -liconv -LTLIBINTL = -LTLIBOBJS = -MAKEINFO = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run makeinfo -MKINSTALLDIRS = config/mkinstalldirs -MSGFMT = /usr/bin/msgfmt -MSGMERGE = /usr/bin/msgmerge -MUDFLAP_FALSE = -MUDFLAP_TRUE = # -NATIVE_LD_FALSE = -NATIVE_LD_TRUE = # -OBJEXT = o -PACKAGE = elfutils -PACKAGE_BUGREPORT = http://bugzilla.redhat.com/bugzilla/ -PACKAGE_NAME = Red Hat elfutils -PACKAGE_STRING = Red Hat elfutils 0.97 -PACKAGE_TARNAME = elfutils -PACKAGE_VERSION = 0.97 -PATH_SEPARATOR = : -POSUB = po -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -STRIP = -USE_NLS = yes -VERSION = 1 -XGETTEXT = /usr/bin/xgettext -YACC = bison -y -ac_ct_CC = gcc -ac_ct_RANLIB = ranlib -ac_ct_STRIP = -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__include = include -am__leading_dot = . -am__quote = -am__tar = ${AMTAR} chof - "$$tardir" -am__untar = ${AMTAR} xf - -base_cpu = none -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -datadir = ${prefix}/share -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /work/elfutils/stock/elfutils-0.97/config/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mkdir_p = mkdir -p -- -oldincludedir = /usr/include -prefix = /work/elfutils/google/linux-install-elfutils-0.97/ -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target_alias = -AM_CFLAGS = -Wall -Werror -Wshadow -fpic \ - -DLIBSTR=\"$$(basename $(libdir))\" -#AM_CFLAGS = -Wall -Wshadow -fpic -DLIBSTR=\"$$(basename \ -# $(libdir))\" -INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. -lib_LIBRARIES = libebl.a -modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64 -noinst_LIBRARIES = libebl_i386_pic.a libebl_sh_pic.a libebl_mips_pic.a \ - libebl_x86_64_pic.a libebl_ia64_pic.a libebl_alpha_pic.a \ - libebl_arm_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ - libebl_ppc64_pic.a - -euincludedir = $(includedir)/elfutils -euinclude_HEADERS = libebl.h -gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ - eblreloctypename.c eblsegmenttypename.c \ - eblsectiontypename.c eblmachineflagname.c \ - eblsymboltypename.c ebldynamictagname.c eblsectionname.c \ - eblobjecttypename.c eblsymbolbindingname.c \ - eblbackendname.c eblshflagscombine.c eblwstrtab.c \ - eblgstrtab.c eblosabiname.c eblmachineflagcheck.c \ - eblreloctypecheck.c eblrelocvaliduse.c ebldynamictagcheck.c \ - eblcorenotetypename.c eblobjnotetypename.c \ - eblcorenote.c eblobjnote.c ebldebugscnp.c \ - eblgotpcreloccheck.c - -libebl_a_SOURCES = $(gen_SOURCES) - -# -# XXX Use --enable-new-dtags as soon as ld.so handles DT_RUNPATH when -# using dlopen correctly. -# -Wl,--rpath,\$$ORIGIN/elfutils \ -# -i386_SRCS = i386_init.c i386_destr.c i386_symbol.c i386_corenote.c -libebl_i386_pic_a_SOURCES = -am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) -libelf = ../libelf/libelf.so -#libelf = ../libelf/libelf.a -libmudflap = -#libmudflap = -lmudflap -libebl_i386_so_SOURCES = -sh_SRCS = sh_init.c sh_destr.c sh_symbol.c -libebl_sh_pic_a_SOURCES = -am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) -libebl_sh_so_SOURCES = -mips_SRCS = mips_init.c mips_destr.c mips_symbol.c -libebl_mips_pic_a_SOURCES = -am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) -libebl_mips_so_SOURCES = -x86_64_SRCS = x86_64_init.c x86_64_destr.c x86_64_symbol.c -libebl_x86_64_pic_a_SOURCES = -am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) -libebl_x86_64_so_SOURCES = -ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c -libebl_ia64_pic_a_SOURCES = -am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) -libebl_ia64_so_SOURCES = -alpha_SRCS = alpha_init.c alpha_destr.c alpha_symbol.c -libebl_alpha_pic_a_SOURCES = -am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) -libebl_alpha_so_SOURCES = -arm_SRCS = arm_init.c arm_destr.c arm_symbol.c -libebl_arm_pic_a_SOURCES = -am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os) -libebl_arm_so_SOURCES = -sparc_SRCS = sparc_init.c sparc_destr.c sparc_symbol.c -libebl_sparc_pic_a_SOURCES = -am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) -libebl_sparc_so_SOURCES = -ppc_SRCS = ppc_init.c ppc_destr.c ppc_symbol.c -libebl_ppc_pic_a_SOURCES = -am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) -libebl_ppc_so_SOURCES = -ppc64_SRCS = ppc64_init.c ppc64_destr.c ppc64_symbol.c -libebl_ppc64_pic_a_SOURCES = -am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) -libebl_ppc64_so_SOURCES = -noinst_HEADERS = libeblP.h $(noinst_LIBRARIES:%_pic.a=%.h) -EXTRA_DIST = $(noinst_LIBRARIES:%_pic.a=%.map) \ - $(foreach m,$(modules),$($(m)_SRCS)) - -CLEANFILES = $(am_libebl_pic_a_OBJECTS) \ - $(foreach m,$(modules),$(am_libebl_$(m)_pic_a_OBJECTS)) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits libebl/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits libebl/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLIBRARIES: $(lib_LIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - @$(POST_INSTALL) - @list='$(lib_LIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - p=$(am__strip_dir) \ - echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ - $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ - else :; fi; \ - done - -uninstall-libLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLIBRARIES: - -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libebl.a: $(libebl_a_OBJECTS) $(libebl_a_DEPENDENCIES) - -rm -f libebl.a - $(libebl_a_AR) libebl.a $(libebl_a_OBJECTS) $(libebl_a_LIBADD) - $(RANLIB) libebl.a -libebl_alpha_pic.a: $(libebl_alpha_pic_a_OBJECTS) $(libebl_alpha_pic_a_DEPENDENCIES) - -rm -f libebl_alpha_pic.a - $(libebl_alpha_pic_a_AR) libebl_alpha_pic.a $(libebl_alpha_pic_a_OBJECTS) $(libebl_alpha_pic_a_LIBADD) - $(RANLIB) libebl_alpha_pic.a -libebl_arm_pic.a: $(libebl_arm_pic_a_OBJECTS) $(libebl_arm_pic_a_DEPENDENCIES) - -rm -f libebl_arm_pic.a - $(libebl_arm_pic_a_AR) libebl_arm_pic.a $(libebl_arm_pic_a_OBJECTS) $(libebl_arm_pic_a_LIBADD) - $(RANLIB) libebl_arm_pic.a -libebl_i386_pic.a: $(libebl_i386_pic_a_OBJECTS) $(libebl_i386_pic_a_DEPENDENCIES) - -rm -f libebl_i386_pic.a - $(libebl_i386_pic_a_AR) libebl_i386_pic.a $(libebl_i386_pic_a_OBJECTS) $(libebl_i386_pic_a_LIBADD) - $(RANLIB) libebl_i386_pic.a -libebl_ia64_pic.a: $(libebl_ia64_pic_a_OBJECTS) $(libebl_ia64_pic_a_DEPENDENCIES) - -rm -f libebl_ia64_pic.a - $(libebl_ia64_pic_a_AR) libebl_ia64_pic.a $(libebl_ia64_pic_a_OBJECTS) $(libebl_ia64_pic_a_LIBADD) - $(RANLIB) libebl_ia64_pic.a -libebl_mips_pic.a: $(libebl_mips_pic_a_OBJECTS) $(libebl_mips_pic_a_DEPENDENCIES) - -rm -f libebl_mips_pic.a - $(libebl_mips_pic_a_AR) libebl_mips_pic.a $(libebl_mips_pic_a_OBJECTS) $(libebl_mips_pic_a_LIBADD) - $(RANLIB) libebl_mips_pic.a -libebl_ppc64_pic.a: $(libebl_ppc64_pic_a_OBJECTS) $(libebl_ppc64_pic_a_DEPENDENCIES) - -rm -f libebl_ppc64_pic.a - $(libebl_ppc64_pic_a_AR) libebl_ppc64_pic.a $(libebl_ppc64_pic_a_OBJECTS) $(libebl_ppc64_pic_a_LIBADD) - $(RANLIB) libebl_ppc64_pic.a -libebl_ppc_pic.a: $(libebl_ppc_pic_a_OBJECTS) $(libebl_ppc_pic_a_DEPENDENCIES) - -rm -f libebl_ppc_pic.a - $(libebl_ppc_pic_a_AR) libebl_ppc_pic.a $(libebl_ppc_pic_a_OBJECTS) $(libebl_ppc_pic_a_LIBADD) - $(RANLIB) libebl_ppc_pic.a -libebl_sh_pic.a: $(libebl_sh_pic_a_OBJECTS) $(libebl_sh_pic_a_DEPENDENCIES) - -rm -f libebl_sh_pic.a - $(libebl_sh_pic_a_AR) libebl_sh_pic.a $(libebl_sh_pic_a_OBJECTS) $(libebl_sh_pic_a_LIBADD) - $(RANLIB) libebl_sh_pic.a -libebl_sparc_pic.a: $(libebl_sparc_pic_a_OBJECTS) $(libebl_sparc_pic_a_DEPENDENCIES) - -rm -f libebl_sparc_pic.a - $(libebl_sparc_pic_a_AR) libebl_sparc_pic.a $(libebl_sparc_pic_a_OBJECTS) $(libebl_sparc_pic_a_LIBADD) - $(RANLIB) libebl_sparc_pic.a -libebl_x86_64_pic.a: $(libebl_x86_64_pic_a_OBJECTS) $(libebl_x86_64_pic_a_DEPENDENCIES) - -rm -f libebl_x86_64_pic.a - $(libebl_x86_64_pic_a_AR) libebl_x86_64_pic.a $(libebl_x86_64_pic_a_OBJECTS) $(libebl_x86_64_pic_a_LIBADD) - $(RANLIB) libebl_x86_64_pic.a - -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/eblbackendname.Po -include ./$(DEPDIR)/eblclosebackend.Po -include ./$(DEPDIR)/eblcorenote.Po -include ./$(DEPDIR)/eblcorenotetypename.Po -include ./$(DEPDIR)/ebldebugscnp.Po -include ./$(DEPDIR)/ebldynamictagcheck.Po -include ./$(DEPDIR)/ebldynamictagname.Po -include ./$(DEPDIR)/eblgotpcreloccheck.Po -include ./$(DEPDIR)/eblgstrtab.Po -include ./$(DEPDIR)/eblmachineflagcheck.Po -include ./$(DEPDIR)/eblmachineflagname.Po -include ./$(DEPDIR)/eblobjecttypename.Po -include ./$(DEPDIR)/eblobjnote.Po -include ./$(DEPDIR)/eblobjnotetypename.Po -include ./$(DEPDIR)/eblopenbackend.Po -include ./$(DEPDIR)/eblosabiname.Po -include ./$(DEPDIR)/eblreloctypecheck.Po -include ./$(DEPDIR)/eblreloctypename.Po -include ./$(DEPDIR)/eblrelocvaliduse.Po -include ./$(DEPDIR)/eblsectionname.Po -include ./$(DEPDIR)/eblsectiontypename.Po -include ./$(DEPDIR)/eblsegmenttypename.Po -include ./$(DEPDIR)/eblshflagscombine.Po -include ./$(DEPDIR)/eblstrtab.Po -include ./$(DEPDIR)/eblsymbolbindingname.Po -include ./$(DEPDIR)/eblsymboltypename.Po -include ./$(DEPDIR)/eblwstrtab.Po - -.c.o: - if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ - then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c $< - -.c.obj: - if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ - then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: -install-euincludeHEADERS: $(euinclude_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)" - @list='$(euinclude_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(euincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(euincludedir)/$$f'"; \ - $(euincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(euincludedir)/$$f"; \ - done - -uninstall-euincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(euinclude_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(euincludedir)/$$f'"; \ - rm -f "$(DESTDIR)$(euincludedir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install-exec: install-exec-am -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \ - clean-noinstPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-euincludeHEADERS - -install-exec-am: install-libLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \ - uninstall-libLIBRARIES - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \ - ctags distclean distclean-compile distclean-generic \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ - install-euincludeHEADERS install-exec install-exec-am \ - install-info install-info-am install-libLIBRARIES install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-euincludeHEADERS \ - uninstall-info-am uninstall-libLIBRARIES - -libebl_i386.so: libebl_i386_pic.a libebl_i386.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_i386.map \ - -Wl,-z,defs $(libelf) $(libmudflap) -libebl_sh.so: libebl_sh_pic.a libebl_sh.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_sh.map \ - -Wl,-z,defs $(libmudflap) -libebl_mips.so: libebl_mips_pic.a libebl_mips.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_mips.map \ - -Wl,-z,defs $(libmudflap) -libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) -libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ia64.map \ - -Wl,-z,defs $(libmudflap) -libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_alpha.map \ - -Wl,-z,defs $(libmudflap) -libebl_arm.so: libebl_arm_pic.a libebl_arm.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_arm.map \ - -Wl,-z,defs $(libmudflap) -libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_sparc.map \ - -Wl,-z,defs $(libmudflap) -libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ppc.map \ - -Wl,-z,defs $(libelf) $(libmudflap) -libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) - -%.os: %.c %.o - if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ - -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ - then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \ - rm -f "$(DEPDIR)/$*.Tpo"; \ - else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ - fi - -install: install-am - $(mkinstalldirs) $(DESTDIR)$(libdir)/elfutils - for m in $(modules); do \ - $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ - ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ - done - -uninstall: uninstall-am - for m in $(modules); do \ - rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ - rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ - done - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/elfutils - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libebl/Makefile.am b/libebl/Makefile.am index 71514c85..c4e4a076 100644 --- a/libebl/Makefile.am +++ b/libebl/Makefile.am @@ -1,40 +1,47 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Red Hat, Inc. +## This file is part of Red Hat elfutils. ## -## This program is Open Source software; you can redistribute it and/or -## modify it under the terms of the Open Software License version 1.0 as -## published by the Open Source Initiative. +## Red Hat elfutils is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by the +## Free Software Foundation; version 2 of the License. ## -## You should have received a copy of the Open Software License along -## with this program; if not, you may obtain a copy of the Open Software -## License version 1.0 from http://www.opensource.org/licenses/osl.php or -## by writing the Open Source Initiative c/o Lawrence Rosen, Esq., -## 3001 King Ranch Road, Ukiah, CA 95482. +## Red Hat elfutils is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with Red Hat elfutils; if not, write to the Free Software Foundation, +## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. +## +## Red Hat elfutils is an included package of the Open Invention Network. +## An included package of the Open Invention Network is a package for which +## Open Invention Network licensees cross-license their patents. No patent +## license is granted, either expressly or impliedly, by designation as an +## included package. Should you wish to participate in the Open Invention +## Network licensing program, please visit www.openinventionnetwork.com +## <http://www.openinventionnetwork.com>. ## DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" if MUDFLAP -AM_CFLAGS = -Wall -Wshadow -fpic +AM_CFLAGS = -fmudflap else -AM_CFLAGS = -Wall -Werror -Wshadow -fpic +AM_CFLAGS = endif -AM_CFLAGS += -DLIBSTR=\"$$(basename $(libdir))\" +AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \ + -std=gnu99 -INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. +INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ + -I$(top_srcdir)/lib -I.. -I$(srcdir)/../libasm VERSION = 1 PACKAGE_VERSION = @PACKAGE_VERSION@ +LIBEBL_SUBDIR = @LIBEBL_SUBDIR@ lib_LIBRARIES = libebl.a -modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64 -noinst_LIBRARIES = libebl_i386_pic.a libebl_sh_pic.a libebl_mips_pic.a \ - libebl_x86_64_pic.a libebl_ia64_pic.a libebl_alpha_pic.a \ - libebl_arm_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ - libebl_ppc64_pic.a -noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) -euincludedir = $(includedir)/elfutils -euinclude_HEADERS = libebl.h +pkginclude_HEADERS = libebl.h gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ eblreloctypename.c eblsegmenttypename.c \ @@ -42,136 +49,20 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ eblsymboltypename.c ebldynamictagname.c eblsectionname.c \ eblobjecttypename.c eblsymbolbindingname.c \ eblbackendname.c eblshflagscombine.c eblwstrtab.c \ - eblgstrtab.c eblosabiname.c eblmachineflagcheck.c \ - eblreloctypecheck.c eblrelocvaliduse.c ebldynamictagcheck.c \ - eblcorenotetypename.c eblobjnotetypename.c \ + eblgstrtab.c eblosabiname.c \ + eblmachineflagcheck.c eblmachinesectionflagcheck.c \ + eblreloctypecheck.c eblrelocvaliduse.c eblrelocsimpletype.c \ + ebldynamictagcheck.c eblcorenotetypename.c eblobjnotetypename.c \ eblcorenote.c eblobjnote.c ebldebugscnp.c \ - eblgotpcreloccheck.c + eblgotpcreloccheck.c eblcopyrelocp.c eblsectionstripp.c \ + eblelfclass.c eblelfdata.c eblelfmachine.c \ + ebl_check_special_symbol.c eblbsspltp.c eblretval.c \ + eblreginfo.c eblnonerelocp.c eblrelativerelocp.c \ + eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \ + ebl_check_special_section.c ebl_syscall_abi.c libebl_a_SOURCES = $(gen_SOURCES) -# -# XXX Use --enable-new-dtags as soon as ld.so handles DT_RUNPATH when -# using dlopen correctly. -# -Wl,--rpath,\$$ORIGIN/elfutils \ -# -i386_SRCS = i386_init.c i386_destr.c i386_symbol.c i386_corenote.c -libebl_i386_pic_a_SOURCES = -am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) - -if MUDFLAP -libelf = ../libelf/libelf.a -libmudflap = -lmudflap -else -libelf = ../libelf/libelf.so -libmudflap = -endif - -libebl_i386_so_SOURCES = -libebl_i386.so: libebl_i386_pic.a libebl_i386.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_i386.map \ - -Wl,-z,defs $(libelf) $(libmudflap) - - -sh_SRCS = sh_init.c sh_destr.c sh_symbol.c -libebl_sh_pic_a_SOURCES = -am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) - -libebl_sh_so_SOURCES = -libebl_sh.so: libebl_sh_pic.a libebl_sh.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_sh.map \ - -Wl,-z,defs $(libmudflap) - - -mips_SRCS = mips_init.c mips_destr.c mips_symbol.c -libebl_mips_pic_a_SOURCES = -am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) - -libebl_mips_so_SOURCES = -libebl_mips.so: libebl_mips_pic.a libebl_mips.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_mips.map \ - -Wl,-z,defs $(libmudflap) - - -x86_64_SRCS = x86_64_init.c x86_64_destr.c x86_64_symbol.c -libebl_x86_64_pic_a_SOURCES = -am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) - -libebl_x86_64_so_SOURCES = -libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) - - -ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c -libebl_ia64_pic_a_SOURCES = -am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) - -libebl_ia64_so_SOURCES = -libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ia64.map \ - -Wl,-z,defs $(libmudflap) - - -alpha_SRCS = alpha_init.c alpha_destr.c alpha_symbol.c -libebl_alpha_pic_a_SOURCES = -am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) - -libebl_alpha_so_SOURCES = -libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_alpha.map \ - -Wl,-z,defs $(libmudflap) - - -arm_SRCS = arm_init.c arm_destr.c arm_symbol.c -libebl_arm_pic_a_SOURCES = -am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os) - -libebl_arm_so_SOURCES = -libebl_arm.so: libebl_arm_pic.a libebl_arm.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_arm.map \ - -Wl,-z,defs $(libmudflap) - - -sparc_SRCS = sparc_init.c sparc_destr.c sparc_symbol.c -libebl_sparc_pic_a_SOURCES = -am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) - -libebl_sparc_so_SOURCES = -libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_sparc.map \ - -Wl,-z,defs $(libmudflap) - - -ppc_SRCS = ppc_init.c ppc_destr.c ppc_symbol.c -libebl_ppc_pic_a_SOURCES = -am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) - -libebl_ppc_so_SOURCES = -libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ppc.map \ - -Wl,-z,defs $(libelf) $(libmudflap) - - -ppc64_SRCS = ppc64_init.c ppc64_destr.c ppc64_symbol.c -libebl_ppc64_pic_a_SOURCES = -am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) - -libebl_ppc64_so_SOURCES = -libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) - %.os: %.c %.o if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ @@ -181,24 +72,6 @@ libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ fi -install: install-am - $(mkinstalldirs) $(DESTDIR)$(libdir)/elfutils - for m in $(modules); do \ - $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ - ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ - done - -uninstall: uninstall-am - for m in $(modules); do \ - rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ - rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ - done - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/elfutils - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils - -noinst_HEADERS = libeblP.h $(noinst_LIBRARIES:%_pic.a=%.h) -EXTRA_DIST = $(noinst_LIBRARIES:%_pic.a=%.map) \ - $(foreach m,$(modules),$($(m)_SRCS)) +noinst_HEADERS = libeblP.h ebl-hooks.h -CLEANFILES = $(am_libebl_pic_a_OBJECTS) \ - $(foreach m,$(modules),$(am_libebl_$(m)_pic_a_OBJECTS)) +CLEANFILES = $(am_libebl_pic_a_OBJECTS) *.gcno *.gcda diff --git a/libebl/Makefile.in b/libebl/Makefile.in index aaff3fe7..5f1228b4 100644 --- a/libebl/Makefile.in +++ b/libebl/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,18 +15,11 @@ @SET_MAKE@ - -SOURCES = $(libebl_a_SOURCES) $(libebl_alpha_pic_a_SOURCES) $(libebl_arm_pic_a_SOURCES) $(libebl_i386_pic_a_SOURCES) $(libebl_ia64_pic_a_SOURCES) $(libebl_mips_pic_a_SOURCES) $(libebl_ppc64_pic_a_SOURCES) $(libebl_ppc_pic_a_SOURCES) $(libebl_sh_pic_a_SOURCES) $(libebl_sparc_pic_a_SOURCES) $(libebl_x86_64_pic_a_SOURCES) $(libebl_alpha_so_SOURCES) $(libebl_arm_so_SOURCES) $(libebl_i386_so_SOURCES) $(libebl_ia64_so_SOURCES) $(libebl_mips_so_SOURCES) $(libebl_ppc_so_SOURCES) $(libebl_ppc64_so_SOURCES) $(libebl_sh_so_SOURCES) $(libebl_sparc_so_SOURCES) $(libebl_x86_64_so_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,18 +33,15 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = $(am__EXEEXT_1) subdir = libebl -DIST_COMMON = $(euinclude_HEADERS) $(noinst_HEADERS) \ +DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -60,9 +50,9 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" libLIBRARIES_INSTALL = $(INSTALL_DATA) -LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES) +LIBRARIES = $(lib_LIBRARIES) AR = ar ARFLAGS = cru libebl_a_AR = $(AR) $(ARFLAGS) @@ -76,116 +66,37 @@ am__objects_1 = eblopenbackend.$(OBJEXT) eblclosebackend.$(OBJEXT) \ eblbackendname.$(OBJEXT) eblshflagscombine.$(OBJEXT) \ eblwstrtab.$(OBJEXT) eblgstrtab.$(OBJEXT) \ eblosabiname.$(OBJEXT) eblmachineflagcheck.$(OBJEXT) \ + eblmachinesectionflagcheck.$(OBJEXT) \ eblreloctypecheck.$(OBJEXT) eblrelocvaliduse.$(OBJEXT) \ - ebldynamictagcheck.$(OBJEXT) eblcorenotetypename.$(OBJEXT) \ - eblobjnotetypename.$(OBJEXT) eblcorenote.$(OBJEXT) \ - eblobjnote.$(OBJEXT) ebldebugscnp.$(OBJEXT) \ - eblgotpcreloccheck.$(OBJEXT) + eblrelocsimpletype.$(OBJEXT) ebldynamictagcheck.$(OBJEXT) \ + eblcorenotetypename.$(OBJEXT) eblobjnotetypename.$(OBJEXT) \ + eblcorenote.$(OBJEXT) eblobjnote.$(OBJEXT) \ + ebldebugscnp.$(OBJEXT) eblgotpcreloccheck.$(OBJEXT) \ + eblcopyrelocp.$(OBJEXT) eblsectionstripp.$(OBJEXT) \ + eblelfclass.$(OBJEXT) eblelfdata.$(OBJEXT) \ + eblelfmachine.$(OBJEXT) ebl_check_special_symbol.$(OBJEXT) \ + eblbsspltp.$(OBJEXT) eblretval.$(OBJEXT) eblreginfo.$(OBJEXT) \ + eblnonerelocp.$(OBJEXT) eblrelativerelocp.$(OBJEXT) \ + eblsysvhashentrysize.$(OBJEXT) eblauxvinfo.$(OBJEXT) \ + eblcheckobjattr.$(OBJEXT) ebl_check_special_section.$(OBJEXT) \ + ebl_syscall_abi.$(OBJEXT) am_libebl_a_OBJECTS = $(am__objects_1) libebl_a_OBJECTS = $(am_libebl_a_OBJECTS) -libebl_alpha_pic_a_AR = $(AR) $(ARFLAGS) -libebl_alpha_pic_a_LIBADD = -libebl_alpha_pic_a_OBJECTS = $(am_libebl_alpha_pic_a_OBJECTS) -libebl_arm_pic_a_AR = $(AR) $(ARFLAGS) -libebl_arm_pic_a_LIBADD = -libebl_arm_pic_a_OBJECTS = $(am_libebl_arm_pic_a_OBJECTS) -libebl_i386_pic_a_AR = $(AR) $(ARFLAGS) -libebl_i386_pic_a_LIBADD = -libebl_i386_pic_a_OBJECTS = $(am_libebl_i386_pic_a_OBJECTS) -libebl_ia64_pic_a_AR = $(AR) $(ARFLAGS) -libebl_ia64_pic_a_LIBADD = -libebl_ia64_pic_a_OBJECTS = $(am_libebl_ia64_pic_a_OBJECTS) -libebl_mips_pic_a_AR = $(AR) $(ARFLAGS) -libebl_mips_pic_a_LIBADD = -libebl_mips_pic_a_OBJECTS = $(am_libebl_mips_pic_a_OBJECTS) -libebl_ppc64_pic_a_AR = $(AR) $(ARFLAGS) -libebl_ppc64_pic_a_LIBADD = -libebl_ppc64_pic_a_OBJECTS = $(am_libebl_ppc64_pic_a_OBJECTS) -libebl_ppc_pic_a_AR = $(AR) $(ARFLAGS) -libebl_ppc_pic_a_LIBADD = -libebl_ppc_pic_a_OBJECTS = $(am_libebl_ppc_pic_a_OBJECTS) -libebl_sh_pic_a_AR = $(AR) $(ARFLAGS) -libebl_sh_pic_a_LIBADD = -libebl_sh_pic_a_OBJECTS = $(am_libebl_sh_pic_a_OBJECTS) -libebl_sparc_pic_a_AR = $(AR) $(ARFLAGS) -libebl_sparc_pic_a_LIBADD = -libebl_sparc_pic_a_OBJECTS = $(am_libebl_sparc_pic_a_OBJECTS) -libebl_x86_64_pic_a_AR = $(AR) $(ARFLAGS) -libebl_x86_64_pic_a_LIBADD = -libebl_x86_64_pic_a_OBJECTS = $(am_libebl_x86_64_pic_a_OBJECTS) -am__EXEEXT_1 = libebl_i386.so$(EXEEXT) libebl_sh.so$(EXEEXT) \ - libebl_mips.so$(EXEEXT) libebl_x86_64.so$(EXEEXT) \ - libebl_ia64.so$(EXEEXT) libebl_alpha.so$(EXEEXT) \ - libebl_arm.so$(EXEEXT) libebl_sparc.so$(EXEEXT) \ - libebl_ppc.so$(EXEEXT) libebl_ppc64.so$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) -am_libebl_alpha_so_OBJECTS = -libebl_alpha_so_OBJECTS = $(am_libebl_alpha_so_OBJECTS) -libebl_alpha_so_LDADD = $(LDADD) -am_libebl_arm_so_OBJECTS = -libebl_arm_so_OBJECTS = $(am_libebl_arm_so_OBJECTS) -libebl_arm_so_LDADD = $(LDADD) -am_libebl_i386_so_OBJECTS = -libebl_i386_so_OBJECTS = $(am_libebl_i386_so_OBJECTS) -libebl_i386_so_LDADD = $(LDADD) -am_libebl_ia64_so_OBJECTS = -libebl_ia64_so_OBJECTS = $(am_libebl_ia64_so_OBJECTS) -libebl_ia64_so_LDADD = $(LDADD) -am_libebl_mips_so_OBJECTS = -libebl_mips_so_OBJECTS = $(am_libebl_mips_so_OBJECTS) -libebl_mips_so_LDADD = $(LDADD) -am_libebl_ppc_so_OBJECTS = -libebl_ppc_so_OBJECTS = $(am_libebl_ppc_so_OBJECTS) -libebl_ppc_so_LDADD = $(LDADD) -am_libebl_ppc64_so_OBJECTS = -libebl_ppc64_so_OBJECTS = $(am_libebl_ppc64_so_OBJECTS) -libebl_ppc64_so_LDADD = $(LDADD) -am_libebl_sh_so_OBJECTS = -libebl_sh_so_OBJECTS = $(am_libebl_sh_so_OBJECTS) -libebl_sh_so_LDADD = $(LDADD) -am_libebl_sparc_so_OBJECTS = -libebl_sparc_so_OBJECTS = $(am_libebl_sparc_so_OBJECTS) -libebl_sparc_so_LDADD = $(LDADD) -am_libebl_x86_64_so_OBJECTS = -libebl_x86_64_so_OBJECTS = $(am_libebl_x86_64_so_OBJECTS) -libebl_x86_64_so_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libebl_a_SOURCES) $(libebl_alpha_pic_a_SOURCES) \ - $(libebl_arm_pic_a_SOURCES) $(libebl_i386_pic_a_SOURCES) \ - $(libebl_ia64_pic_a_SOURCES) $(libebl_mips_pic_a_SOURCES) \ - $(libebl_ppc64_pic_a_SOURCES) $(libebl_ppc_pic_a_SOURCES) \ - $(libebl_sh_pic_a_SOURCES) $(libebl_sparc_pic_a_SOURCES) \ - $(libebl_x86_64_pic_a_SOURCES) $(libebl_alpha_so_SOURCES) \ - $(libebl_arm_so_SOURCES) $(libebl_i386_so_SOURCES) \ - $(libebl_ia64_so_SOURCES) $(libebl_mips_so_SOURCES) \ - $(libebl_ppc_so_SOURCES) $(libebl_ppc64_so_SOURCES) \ - $(libebl_sh_so_SOURCES) $(libebl_sparc_so_SOURCES) \ - $(libebl_x86_64_so_SOURCES) -DIST_SOURCES = $(libebl_a_SOURCES) $(libebl_alpha_pic_a_SOURCES) \ - $(libebl_arm_pic_a_SOURCES) $(libebl_i386_pic_a_SOURCES) \ - $(libebl_ia64_pic_a_SOURCES) $(libebl_mips_pic_a_SOURCES) \ - $(libebl_ppc64_pic_a_SOURCES) $(libebl_ppc_pic_a_SOURCES) \ - $(libebl_sh_pic_a_SOURCES) $(libebl_sparc_pic_a_SOURCES) \ - $(libebl_x86_64_pic_a_SOURCES) $(libebl_alpha_so_SOURCES) \ - $(libebl_arm_so_SOURCES) $(libebl_i386_so_SOURCES) \ - $(libebl_ia64_so_SOURCES) $(libebl_mips_so_SOURCES) \ - $(libebl_ppc_so_SOURCES) $(libebl_ppc64_so_SOURCES) \ - $(libebl_sh_so_SOURCES) $(libebl_sparc_so_SOURCES) \ - $(libebl_x86_64_so_SOURCES) -euincludeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(euinclude_HEADERS) $(noinst_HEADERS) +SOURCES = $(libebl_a_SOURCES) +DIST_SOURCES = $(libebl_a_SOURCES) +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -194,43 +105,39 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEBUGPRED = @DEBUGPRED@ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ +LIBEBL_SUBDIR = @LIBEBL_SUBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ -MKINSTALLDIRS = @MKINSTALLDIRS@ +MKDIR_P = @MKDIR_P@ +MODVERSION = @MODVERSION@ MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ -MUDFLAP_FALSE = @MUDFLAP_FALSE@ -MUDFLAP_TRUE = @MUDFLAP_TRUE@ -NATIVE_LD_FALSE = @NATIVE_LD_FALSE@ -NATIVE_LD_TRUE = @NATIVE_LD_TRUE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -239,7 +146,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -247,12 +153,14 @@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -265,117 +173,76 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +eu_version = @eu_version@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -fpic \ -@MUDFLAP_FALSE@ -DLIBSTR=\"$$(basename $(libdir))\" -@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -fpic -DLIBSTR=\"$$(basename \ -@MUDFLAP_TRUE@ $(libdir))\" -INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ +@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99 +@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \ +@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 +INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ + -I$(top_srcdir)/lib -I.. -I$(srcdir)/../libasm + lib_LIBRARIES = libebl.a -modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64 -noinst_LIBRARIES = libebl_i386_pic.a libebl_sh_pic.a libebl_mips_pic.a \ - libebl_x86_64_pic.a libebl_ia64_pic.a libebl_alpha_pic.a \ - libebl_arm_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ - libebl_ppc64_pic.a - -euincludedir = $(includedir)/elfutils -euinclude_HEADERS = libebl.h +pkginclude_HEADERS = libebl.h gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ eblreloctypename.c eblsegmenttypename.c \ eblsectiontypename.c eblmachineflagname.c \ eblsymboltypename.c ebldynamictagname.c eblsectionname.c \ eblobjecttypename.c eblsymbolbindingname.c \ eblbackendname.c eblshflagscombine.c eblwstrtab.c \ - eblgstrtab.c eblosabiname.c eblmachineflagcheck.c \ - eblreloctypecheck.c eblrelocvaliduse.c ebldynamictagcheck.c \ - eblcorenotetypename.c eblobjnotetypename.c \ + eblgstrtab.c eblosabiname.c \ + eblmachineflagcheck.c eblmachinesectionflagcheck.c \ + eblreloctypecheck.c eblrelocvaliduse.c eblrelocsimpletype.c \ + ebldynamictagcheck.c eblcorenotetypename.c eblobjnotetypename.c \ eblcorenote.c eblobjnote.c ebldebugscnp.c \ - eblgotpcreloccheck.c + eblgotpcreloccheck.c eblcopyrelocp.c eblsectionstripp.c \ + eblelfclass.c eblelfdata.c eblelfmachine.c \ + ebl_check_special_symbol.c eblbsspltp.c eblretval.c \ + eblreginfo.c eblnonerelocp.c eblrelativerelocp.c \ + eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \ + ebl_check_special_section.c ebl_syscall_abi.c libebl_a_SOURCES = $(gen_SOURCES) - -# -# XXX Use --enable-new-dtags as soon as ld.so handles DT_RUNPATH when -# using dlopen correctly. -# -Wl,--rpath,\$$ORIGIN/elfutils \ -# -i386_SRCS = i386_init.c i386_destr.c i386_symbol.c i386_corenote.c -libebl_i386_pic_a_SOURCES = -am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) -@MUDFLAP_FALSE@libelf = ../libelf/libelf.so -@MUDFLAP_TRUE@libelf = ../libelf/libelf.a -@MUDFLAP_FALSE@libmudflap = -@MUDFLAP_TRUE@libmudflap = -lmudflap -libebl_i386_so_SOURCES = -sh_SRCS = sh_init.c sh_destr.c sh_symbol.c -libebl_sh_pic_a_SOURCES = -am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) -libebl_sh_so_SOURCES = -mips_SRCS = mips_init.c mips_destr.c mips_symbol.c -libebl_mips_pic_a_SOURCES = -am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) -libebl_mips_so_SOURCES = -x86_64_SRCS = x86_64_init.c x86_64_destr.c x86_64_symbol.c -libebl_x86_64_pic_a_SOURCES = -am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) -libebl_x86_64_so_SOURCES = -ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c -libebl_ia64_pic_a_SOURCES = -am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) -libebl_ia64_so_SOURCES = -alpha_SRCS = alpha_init.c alpha_destr.c alpha_symbol.c -libebl_alpha_pic_a_SOURCES = -am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) -libebl_alpha_so_SOURCES = -arm_SRCS = arm_init.c arm_destr.c arm_symbol.c -libebl_arm_pic_a_SOURCES = -am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os) -libebl_arm_so_SOURCES = -sparc_SRCS = sparc_init.c sparc_destr.c sparc_symbol.c -libebl_sparc_pic_a_SOURCES = -am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) -libebl_sparc_so_SOURCES = -ppc_SRCS = ppc_init.c ppc_destr.c ppc_symbol.c -libebl_ppc_pic_a_SOURCES = -am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) -libebl_ppc_so_SOURCES = -ppc64_SRCS = ppc64_init.c ppc64_destr.c ppc64_symbol.c -libebl_ppc64_pic_a_SOURCES = -am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) -libebl_ppc64_so_SOURCES = -noinst_HEADERS = libeblP.h $(noinst_LIBRARIES:%_pic.a=%.h) -EXTRA_DIST = $(noinst_LIBRARIES:%_pic.a=%.map) \ - $(foreach m,$(modules),$($(m)_SRCS)) - -CLEANFILES = $(am_libebl_pic_a_OBJECTS) \ - $(foreach m,$(modules),$(am_libebl_$(m)_pic_a_OBJECTS)) - +noinst_HEADERS = libeblP.h ebl-hooks.h +CLEANFILES = $(am_libebl_pic_a_OBJECTS) *.gcno *.gcda all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -400,13 +267,13 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ @@ -433,56 +300,10 @@ uninstall-libLIBRARIES: clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libebl.a: $(libebl_a_OBJECTS) $(libebl_a_DEPENDENCIES) -rm -f libebl.a $(libebl_a_AR) libebl.a $(libebl_a_OBJECTS) $(libebl_a_LIBADD) $(RANLIB) libebl.a -libebl_alpha_pic.a: $(libebl_alpha_pic_a_OBJECTS) $(libebl_alpha_pic_a_DEPENDENCIES) - -rm -f libebl_alpha_pic.a - $(libebl_alpha_pic_a_AR) libebl_alpha_pic.a $(libebl_alpha_pic_a_OBJECTS) $(libebl_alpha_pic_a_LIBADD) - $(RANLIB) libebl_alpha_pic.a -libebl_arm_pic.a: $(libebl_arm_pic_a_OBJECTS) $(libebl_arm_pic_a_DEPENDENCIES) - -rm -f libebl_arm_pic.a - $(libebl_arm_pic_a_AR) libebl_arm_pic.a $(libebl_arm_pic_a_OBJECTS) $(libebl_arm_pic_a_LIBADD) - $(RANLIB) libebl_arm_pic.a -libebl_i386_pic.a: $(libebl_i386_pic_a_OBJECTS) $(libebl_i386_pic_a_DEPENDENCIES) - -rm -f libebl_i386_pic.a - $(libebl_i386_pic_a_AR) libebl_i386_pic.a $(libebl_i386_pic_a_OBJECTS) $(libebl_i386_pic_a_LIBADD) - $(RANLIB) libebl_i386_pic.a -libebl_ia64_pic.a: $(libebl_ia64_pic_a_OBJECTS) $(libebl_ia64_pic_a_DEPENDENCIES) - -rm -f libebl_ia64_pic.a - $(libebl_ia64_pic_a_AR) libebl_ia64_pic.a $(libebl_ia64_pic_a_OBJECTS) $(libebl_ia64_pic_a_LIBADD) - $(RANLIB) libebl_ia64_pic.a -libebl_mips_pic.a: $(libebl_mips_pic_a_OBJECTS) $(libebl_mips_pic_a_DEPENDENCIES) - -rm -f libebl_mips_pic.a - $(libebl_mips_pic_a_AR) libebl_mips_pic.a $(libebl_mips_pic_a_OBJECTS) $(libebl_mips_pic_a_LIBADD) - $(RANLIB) libebl_mips_pic.a -libebl_ppc64_pic.a: $(libebl_ppc64_pic_a_OBJECTS) $(libebl_ppc64_pic_a_DEPENDENCIES) - -rm -f libebl_ppc64_pic.a - $(libebl_ppc64_pic_a_AR) libebl_ppc64_pic.a $(libebl_ppc64_pic_a_OBJECTS) $(libebl_ppc64_pic_a_LIBADD) - $(RANLIB) libebl_ppc64_pic.a -libebl_ppc_pic.a: $(libebl_ppc_pic_a_OBJECTS) $(libebl_ppc_pic_a_DEPENDENCIES) - -rm -f libebl_ppc_pic.a - $(libebl_ppc_pic_a_AR) libebl_ppc_pic.a $(libebl_ppc_pic_a_OBJECTS) $(libebl_ppc_pic_a_LIBADD) - $(RANLIB) libebl_ppc_pic.a -libebl_sh_pic.a: $(libebl_sh_pic_a_OBJECTS) $(libebl_sh_pic_a_DEPENDENCIES) - -rm -f libebl_sh_pic.a - $(libebl_sh_pic_a_AR) libebl_sh_pic.a $(libebl_sh_pic_a_OBJECTS) $(libebl_sh_pic_a_LIBADD) - $(RANLIB) libebl_sh_pic.a -libebl_sparc_pic.a: $(libebl_sparc_pic_a_OBJECTS) $(libebl_sparc_pic_a_DEPENDENCIES) - -rm -f libebl_sparc_pic.a - $(libebl_sparc_pic_a_AR) libebl_sparc_pic.a $(libebl_sparc_pic_a_OBJECTS) $(libebl_sparc_pic_a_LIBADD) - $(RANLIB) libebl_sparc_pic.a -libebl_x86_64_pic.a: $(libebl_x86_64_pic_a_OBJECTS) $(libebl_x86_64_pic_a_DEPENDENCIES) - -rm -f libebl_x86_64_pic.a - $(libebl_x86_64_pic_a_AR) libebl_x86_64_pic.a $(libebl_x86_64_pic_a_OBJECTS) $(libebl_x86_64_pic_a_LIBADD) - $(RANLIB) libebl_x86_64_pic.a - -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -490,64 +311,81 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebl_check_special_section.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebl_check_special_symbol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebl_syscall_abi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblauxvinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblbackendname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblbsspltp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblcheckobjattr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblclosebackend.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblcopyrelocp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblcorenote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblcorenotetypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebldebugscnp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebldynamictagcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebldynamictagname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblelfclass.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblelfdata.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblelfmachine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblgotpcreloccheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblgstrtab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblmachineflagcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblmachineflagname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblmachinesectionflagcheck.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblnonerelocp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblobjecttypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblobjnote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblobjnotetypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblopenbackend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblosabiname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblreginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblrelativerelocp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblrelocsimpletype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblreloctypecheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblreloctypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblrelocvaliduse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblretval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsectionname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsectionstripp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsectiontypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsegmenttypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblshflagscombine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblstrtab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsymbolbindingname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsymboltypename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblsysvhashentrysize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblwstrtab.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: -install-euincludeHEADERS: $(euinclude_HEADERS) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)" - @list='$(euinclude_HEADERS)'; for p in $$list; do \ + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ - echo " $(euincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(euincludedir)/$$f'"; \ - $(euincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(euincludedir)/$$f"; \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ done -uninstall-euincludeHEADERS: +uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(euinclude_HEADERS)'; for p in $$list; do \ + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(euincludedir)/$$f'"; \ - rm -f "$(DESTDIR)$(euincludedir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -555,8 +393,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -568,8 +406,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -579,13 +417,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -599,22 +436,21 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -627,13 +463,15 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) +all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done +install: install-am install-exec: install-exec-am install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am @@ -657,8 +495,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \ - clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-generic clean-libLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -676,14 +513,22 @@ info: info-am info-am: -install-data-am: install-euincludeHEADERS +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am install-exec-am: install-libLIBRARIES +install-html: install-html-am + install-info: install-info-am install-man: +install-pdf: install-pdf-am + +install-ps: install-ps-am + installcheck-am: maintainer-clean: maintainer-clean-am @@ -703,62 +548,24 @@ ps: ps-am ps-am: -uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \ - uninstall-libLIBRARIES +uninstall-am: uninstall-libLIBRARIES uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \ - ctags distclean distclean-compile distclean-generic \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ - install-euincludeHEADERS install-exec install-exec-am \ - install-info install-info-am install-libLIBRARIES install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-euincludeHEADERS \ - uninstall-info-am uninstall-libLIBRARIES - -libebl_i386.so: libebl_i386_pic.a libebl_i386.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_i386.map \ - -Wl,-z,defs $(libelf) $(libmudflap) -libebl_sh.so: libebl_sh_pic.a libebl_sh.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_sh.map \ - -Wl,-z,defs $(libmudflap) -libebl_mips.so: libebl_mips_pic.a libebl_mips.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_mips.map \ - -Wl,-z,defs $(libmudflap) -libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) -libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ia64.map \ - -Wl,-z,defs $(libmudflap) -libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_alpha.map \ - -Wl,-z,defs $(libmudflap) -libebl_arm.so: libebl_arm_pic.a libebl_arm.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_arm.map \ - -Wl,-z,defs $(libmudflap) -libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_sparc.map \ - -Wl,-z,defs $(libmudflap) -libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ppc.map \ - -Wl,-z,defs $(libelf) $(libmudflap) -libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map - $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ - -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) + clean-libLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLIBRARIES install-man install-pdf \ + install-pdf-am install-pkgincludeHEADERS install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-libLIBRARIES \ + uninstall-pkgincludeHEADERS + %.os: %.c %.o if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ @@ -767,21 +574,6 @@ libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map rm -f "$(DEPDIR)/$*.Tpo"; \ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ fi - -install: install-am - $(mkinstalldirs) $(DESTDIR)$(libdir)/elfutils - for m in $(modules); do \ - $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ - ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ - done - -uninstall: uninstall-am - for m in $(modules); do \ - rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ - rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ - done - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/elfutils - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/libebl/alpha_destr.c b/libebl/alpha_destr.c deleted file mode 100644 index c599d591..00000000 --- a/libebl/alpha_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for Alpha specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_alpha.h> - - -void -alpha_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/alpha_init.c b/libebl/alpha_init.c deleted file mode 100644 index b688bb73..00000000 --- a/libebl/alpha_init.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Initialization of Alpha specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_alpha.h> - - -int -alpha_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "Alpha"; - eh->reloc_type_name = alpha_reloc_type_name; - eh->reloc_type_check = alpha_reloc_type_check; - eh->destr = alpha_destr; - - return 0; -} diff --git a/libebl/alpha_symbol.c b/libebl/alpha_symbol.c deleted file mode 100644 index 749f4f55..00000000 --- a/libebl/alpha_symbol.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Alpha specific symbolic name handling. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> - -#include <libebl_alpha.h> - - -/* Return of the backend. */ -const char * -alpha_backend_name (void) -{ - return "alpha"; -} - - -/* Relocation mapping table. */ -static const char *reloc_map_table[] = - { - [R_ALPHA_NONE] = "R_ALPHA_NONE", - [R_ALPHA_REFLONG] = "R_ALPHA_REFLONG", - [R_ALPHA_REFQUAD] = "R_ALPHA_REFQUAD", - [R_ALPHA_GPREL32] = "R_ALPHA_GPREL32", - [R_ALPHA_LITERAL] = "R_ALPHA_LITERAL", - [R_ALPHA_LITUSE] = "R_ALPHA_LITUSE", - [R_ALPHA_GPDISP] = "R_ALPHA_GPDISP", - [R_ALPHA_BRADDR] = "R_ALPHA_BRADDR", - [R_ALPHA_HINT] = "R_ALPHA_HINT", - [R_ALPHA_SREL16] = "R_ALPHA_SREL16", - [R_ALPHA_SREL32] = "R_ALPHA_SREL32", - [R_ALPHA_SREL64] = "R_ALPHA_SREL64", - [R_ALPHA_GPRELHIGH] = "R_ALPHA_GPRELHIGH", - [R_ALPHA_GPRELLOW] = "R_ALPHA_GPRELLOW", - [R_ALPHA_GPREL16] = "R_ALPHA_GPREL16", - [R_ALPHA_COPY] = "R_ALPHA_COPY", - [R_ALPHA_GLOB_DAT] = "R_ALPHA_GLOB_DAT", - [R_ALPHA_JMP_SLOT] = "R_ALPHA_JMP_SLOT", - [R_ALPHA_RELATIVE] = "R_ALPHA_RELATIVE", - [R_ALPHA_TLS_GD_HI] = "R_ALPHA_TLS_GD_HI", - [R_ALPHA_TLSGD] = "R_ALPHA_TLSGD", - [R_ALPHA_TLS_LDM] = "R_ALPHA_TLS_LDM", - [R_ALPHA_DTPMOD64] = "R_ALPHA_DTPMOD64", - [R_ALPHA_GOTDTPREL] = "R_ALPHA_GOTDTPREL", - [R_ALPHA_DTPREL64] = "R_ALPHA_DTPREL64", - [R_ALPHA_DTPRELHI] = "R_ALPHA_DTPRELHI", - [R_ALPHA_DTPRELLO] = "R_ALPHA_DTPRELLO", - [R_ALPHA_DTPREL16] = "R_ALPHA_DTPREL16", - [R_ALPHA_GOTTPREL] = "R_ALPHA_GOTTPREL", - [R_ALPHA_TPREL64] = "R_ALPHA_TPREL64", - [R_ALPHA_TPRELHI] = "R_ALPHA_TPRELHI", - [R_ALPHA_TPRELLO] = "R_ALPHA_TPRELLO", - [R_ALPHA_TPREL16] = "R_ALPHA_TPREL16" - }; - - -/* Determine relocation type string for Alpha. */ -const char * -alpha_reloc_type_name (int type, char *buf, size_t len) -{ - if (type < 0 - || ((size_t) type - >= sizeof (reloc_map_table) / sizeof (reloc_map_table[0]))) - return NULL; - - return reloc_map_table[type]; -} - - -/* Check for correct relocation type. */ -bool -alpha_reloc_type_check (int type) -{ - return (type >= R_ALPHA_NONE - && ((size_t) type - < sizeof (reloc_map_table) / sizeof (reloc_map_table[0])) - && reloc_map_table[type] != NULL) ? true : false; -} diff --git a/libebl/arm_destr.c b/libebl/arm_destr.c deleted file mode 100644 index 3851240a..00000000 --- a/libebl/arm_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for Arm specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_arm.h> - - -void -arm_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/arm_init.c b/libebl/arm_init.c deleted file mode 100644 index 3dee75a7..00000000 --- a/libebl/arm_init.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Initialization of Arm specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_arm.h> - - -int -arm_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "Arm"; - eh->reloc_type_name = arm_reloc_type_name; - eh->reloc_type_check = arm_reloc_type_check; - eh->destr = arm_destr; - - return 0; -} diff --git a/libebl/arm_symbol.c b/libebl/arm_symbol.c deleted file mode 100644 index 224beea3..00000000 --- a/libebl/arm_symbol.c +++ /dev/null @@ -1,113 +0,0 @@ -/* Arm specific symbolic name handling. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> - -#include <libebl_arm.h> - - -/* Return of the backend. */ -const char * -arm_backend_name (void) -{ - return "arm"; -} - - -/* Relocation mapping table. */ -static const char *reloc_map_table[] = - { - [R_ARM_NONE] = "R_ARM_NONE", - [R_ARM_PC24] = "R_ARM_PC24", - [R_ARM_ABS32] = "R_ARM_ABS32", - [R_ARM_REL32] = "R_ARM_REL32", - [R_ARM_PC13] = "R_ARM_PC13", - [R_ARM_ABS16] = "R_ARM_ABS16", - [R_ARM_ABS12] = "R_ARM_ABS12", - [R_ARM_THM_ABS5] = "R_ARM_THM_ABS5", - [R_ARM_ABS8] = "R_ARM_ABS8", - [R_ARM_SBREL32] = "R_ARM_SBREL32", - [R_ARM_THM_PC22] = "R_ARM_THM_PC22", - [R_ARM_THM_PC8] = "R_ARM_THM_PC8", - [R_ARM_AMP_VCALL9] = "R_ARM_AMP_VCALL9", - [R_ARM_SWI24] = "R_ARM_SWI24", - [R_ARM_THM_SWI8] = "R_ARM_THM_SWI8", - [R_ARM_XPC25] = "R_ARM_XPC25", - [R_ARM_THM_XPC22] = "R_ARM_THM_XPC22", - [R_ARM_COPY] = "R_ARM_COPY", - [R_ARM_GLOB_DAT] = "R_ARM_GLOB_DAT", - [R_ARM_JUMP_SLOT] = "R_ARM_JUMP_SLOT", - [R_ARM_RELATIVE] = "R_ARM_RELATIVE", - [R_ARM_GOTOFF] = "R_ARM_GOTOFF", - [R_ARM_GOTPC] = "R_ARM_GOTPC", - [R_ARM_GOT32] = "R_ARM_GOT32", - [R_ARM_PLT32] = "R_ARM_PLT32", - [R_ARM_ALU_PCREL_7_0] = "R_ARM_ALU_PCREL_7_0", - [R_ARM_ALU_PCREL_15_8] = "R_ARM_ALU_PCREL_15_8", - [R_ARM_ALU_PCREL_23_15] = "R_ARM_ALU_PCREL_23_15", - [R_ARM_LDR_SBREL_11_0] = "R_ARM_LDR_SBREL_11_0", - [R_ARM_ALU_SBREL_19_12] = "R_ARM_ALU_SBREL_19_12", - [R_ARM_ALU_SBREL_27_20] = "R_ARM_ALU_SBREL_27_20" - }; - -static const char *reloc_map_table2[] = - { - [R_ARM_GNU_VTENTRY] = "R_ARM_GNU_VTENTRY", - [R_ARM_GNU_VTINHERIT] = "R_ARM_GNU_VTINHERIT", - [R_ARM_THM_PC11] = "R_ARM_THM_PC11", - [R_ARM_THM_PC9] = "R_ARM_THM_PC9" - }; - -static const char *reloc_map_table3[] = - { - [R_ARM_RXPC25] = "R_ARM_RXPC25", - [R_ARM_RSBREL32] = "R_ARM_RSBREL32", - [R_ARM_THM_RPC22] = "R_ARM_THM_RPC22", - [R_ARM_RREL32] = "R_ARM_RREL32", - [R_ARM_RABS22] = "R_ARM_RABS22", - [R_ARM_RPC24] = "R_ARM_RPC24", - [R_ARM_RBASE] = "R_ARM_RBASE" - }; - - -/* Determine relocation type string for Alpha. */ -const char * -arm_reloc_type_name (int type, char *buf, size_t len) -{ - if (type >= R_ARM_NONE && type <= R_ARM_ALU_SBREL_27_20) - return reloc_map_table[type]; - - if (type >= R_ARM_GNU_VTENTRY && type <= R_ARM_THM_PC9) - return reloc_map_table2[type - R_ARM_GNU_VTENTRY]; - - if (type >= R_ARM_RXPC25 && type <= R_ARM_RBASE) - return reloc_map_table3[type - R_ARM_RXPC25]; - - return NULL; -} - - -/* Check for correct relocation type. */ -bool -arm_reloc_type_check (int type) -{ - return ((type >= R_ARM_NONE && type <= R_ARM_ALU_SBREL_27_20) - || (type >= R_ARM_GNU_VTENTRY && type <= R_ARM_THM_PC9) - || (type >= R_ARM_RXPC25 && type <= R_ARM_RBASE)) ? true : false; -} diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h new file mode 100644 index 00000000..2db1e208 --- /dev/null +++ b/libebl/ebl-hooks.h @@ -0,0 +1,172 @@ +/* Backend hook signatures internal interface for libebl. + Copyright (C) 2000,2001,2002,2004,2005,2006,2007,2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +/* Return symbol representaton of object file type. */ +const char *EBLHOOK(object_type_name) (int, char *, size_t); + +/* Return symbolic representation of relocation type. */ +const char *EBLHOOK(reloc_type_name) (int, char *, size_t); + +/* Check relocation type. */ +bool EBLHOOK(reloc_type_check) (int); + +/* Check if relocation type is for simple absolute relocations. */ +Elf_Type EBLHOOK(reloc_simple_type) (Ebl *, int); + +/* Check relocation type use. */ +bool EBLHOOK(reloc_valid_use) (Elf *, int); + +/* Return true if the symbol type is that referencing the GOT. */ +bool EBLHOOK(gotpc_reloc_check) (Elf *, int); + +/* Return symbolic representation of segment type. */ +const char *EBLHOOK(segment_type_name) (int, char *, size_t); + +/* Return symbolic representation of section type. */ +const char *EBLHOOK(section_type_name) (int, char *, size_t); + +/* Return section name. */ +const char *EBLHOOK(section_name) (int, int, char *, size_t); + +/* Return next machine flag name. */ +const char *EBLHOOK(machine_flag_name) (GElf_Word *); + +/* Check whether machine flags are valid. */ +bool EBLHOOK(machine_flag_check) (GElf_Word); + +/* Check whether SHF_MASKPROC flag bits are valid. */ +bool EBLHOOK(machine_section_flag_check) (GElf_Xword); + +/* Check whether the section with the given index, header, and name + is a special machine section that is valid despite a combination + of flags or other details that are not generically valid. */ +bool EBLHOOK(check_special_section) (Ebl *, int, + const GElf_Shdr *, const char *); + +/* Return symbolic representation of symbol type. */ +const char *EBLHOOK(symbol_type_name) (int, char *, size_t); + +/* Return symbolic representation of symbol binding. */ +const char *EBLHOOK(symbol_binding_name) (int, char *, size_t); + +/* Return symbolic representation of dynamic tag. */ +const char *EBLHOOK(dynamic_tag_name) (int64_t, char *, size_t); + +/* Check dynamic tag. */ +bool EBLHOOK(dynamic_tag_check) (int64_t); + +/* Combine section header flags values. */ +GElf_Word EBLHOOK(sh_flags_combine) (GElf_Word, GElf_Word); + +/* Return symbolic representation of OS ABI. */ +const char *EBLHOOK(osabi_name) (int, char *, size_t); + +/* Name of a note entry type for core files. */ +const char *EBLHOOK(core_note_type_name) (uint32_t, char *, size_t); + +/* Name of a note entry type for object files. */ +const char *EBLHOOK(object_note_type_name) (uint32_t, char *, size_t); + +/* Describe core note format. */ +int EBLHOOK(core_note) (GElf_Word, GElf_Word, GElf_Word *, size_t *, + const Ebl_Register_Location **, + size_t *, const Ebl_Core_Item **); + +/* Handle object file note. */ +bool EBLHOOK(object_note) (const char *, uint32_t, uint32_t, const char *); + +/* Check object attribute. */ +bool EBLHOOK(check_object_attribute) (Ebl *, const char *, int, uint64_t, + const char **, const char **); + +/* Describe auxv element type. */ +int EBLHOOK(auxv_info) (GElf_Xword, const char **, const char **); + +/* Check section name for being that of a debug informatino section. */ +bool EBLHOOK(debugscn_p) (const char *); + +/* Check whether given relocation is a copy relocation. */ +bool EBLHOOK(copy_reloc_p) (int); + +/* Check whether given relocation is a no-op relocation. */ +bool EBLHOOK(none_reloc_p) (int); + +/* Check whether given relocation is a relative relocation. */ +bool EBLHOOK(relative_reloc_p) (int); + +/* Check whether given symbol's value is ok despite normal checks. */ +bool EBLHOOK(check_special_symbol) (Elf *, GElf_Ehdr *, const GElf_Sym *, + const char *, const GElf_Shdr *); + +/* Check if backend uses a bss PLT in this file. */ +bool EBLHOOK(bss_plt_p) (Elf *, GElf_Ehdr *); + +/* Return location expression to find return value given the + DW_AT_type DIE of a DW_TAG_subprogram DIE. */ +int EBLHOOK(return_value_location) (Dwarf_Die *functypedie, + const Dwarf_Op **locp); + +/* Return register name information. */ +ssize_t EBLHOOK(register_info) (Ebl *ebl, + int regno, char *name, size_t namelen, + const char **prefix, const char **setname, + int *bits, int *type); + +/* Return system call ABI registers. */ +int EBLHOOK(syscall_abi) (Ebl *ebl, int *sp, int *pc, + int *callno, int args[6]); + +/* Disassembler function. */ +int EBLHOOK(disasm) (const uint8_t **startp, const uint8_t *end, + GElf_Addr addr, const char *fmt, DisasmOutputCB_t outcb, + DisasmGetSymCB_t symcb, void *outcbarg, void *symcbarg); + + +/* Destructor for ELF backend handle. */ +void EBLHOOK(destr) (struct ebl *); diff --git a/libebl/ebl_check_special_section.c b/libebl/ebl_check_special_section.c new file mode 100644 index 00000000..d1f3c6e3 --- /dev/null +++ b/libebl/ebl_check_special_section.c @@ -0,0 +1,65 @@ +/* Check for a special section allowed to violate generic constraints. + Copyright (C) 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +bool +ebl_check_special_section (ebl, ndx, shdr, sname) + Ebl *ebl; + int ndx; + const GElf_Shdr *shdr; + const char *sname; +{ + return ebl != NULL && ebl->check_special_section (ebl, ndx, shdr, sname); +} diff --git a/libebl/ebl_check_special_symbol.c b/libebl/ebl_check_special_symbol.c new file mode 100644 index 00000000..875ed1ca --- /dev/null +++ b/libebl/ebl_check_special_symbol.c @@ -0,0 +1,70 @@ +/* Check special symbol's st_value. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <inttypes.h> +#include <libeblP.h> + + +bool +ebl_check_special_symbol (ebl, ehdr, sym, name, destshdr) + Ebl *ebl; + GElf_Ehdr *ehdr; + const GElf_Sym *sym; + const char *name; + const GElf_Shdr *destshdr; +{ + if (ebl == NULL) + return false; + + return ebl->check_special_symbol (ebl->elf, ehdr, sym, name, destshdr); +} diff --git a/libebl/ebl_syscall_abi.c b/libebl/ebl_syscall_abi.c new file mode 100644 index 00000000..2d9a26b6 --- /dev/null +++ b/libebl/ebl_syscall_abi.c @@ -0,0 +1,66 @@ +/* Return system call ABI mapped to DWARF register numbers. + Copyright (C) 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +int +ebl_syscall_abi (ebl, sp, pc, callno, args) + Ebl *ebl; + int *sp; + int *pc; + int *callno; + int args[6]; +{ + return ebl != NULL ? ebl->syscall_abi (ebl, sp, pc, callno, args) : -1; +} diff --git a/libebl/eblauxvinfo.c b/libebl/eblauxvinfo.c new file mode 100644 index 00000000..af65c47b --- /dev/null +++ b/libebl/eblauxvinfo.c @@ -0,0 +1,122 @@ +/* Describe known auxv types. + Copyright (C) 2007, 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <assert.h> +#include <byteswap.h> +#include <endian.h> +#include <inttypes.h> +#include <stdio.h> +#include <stddef.h> +#include <libeblP.h> + +#define AUXV_TYPES \ + TYPE (NULL, "") \ + TYPE (IGNORE, "") \ + TYPE (EXECFD, "d") \ + TYPE (EXECFN, "s") \ + TYPE (PHDR, "p") \ + TYPE (PHENT, "u") \ + TYPE (PHNUM, "u") \ + TYPE (PAGESZ, "u") \ + TYPE (BASE, "p") \ + TYPE (FLAGS, "x") \ + TYPE (ENTRY, "p") \ + TYPE (NOTELF, "") \ + TYPE (UID, "u") \ + TYPE (EUID, "u") \ + TYPE (GID, "u") \ + TYPE (EGID, "u") \ + TYPE (CLKTCK, "u") \ + TYPE (PLATFORM, "s") \ + TYPE (HWCAP, "x") \ + TYPE (FPUCW, "x") \ + TYPE (DCACHEBSIZE, "d") \ + TYPE (ICACHEBSIZE, "d") \ + TYPE (UCACHEBSIZE, "d") \ + TYPE (IGNOREPPC, "") \ + TYPE (SECURE, "u") \ + TYPE (SYSINFO, "p") \ + TYPE (SYSINFO_EHDR, "p") \ + TYPE (L1I_CACHESHAPE, "d") \ + TYPE (L1D_CACHESHAPE, "d") \ + TYPE (L2_CACHESHAPE, "d") \ + TYPE (L3_CACHESHAPE, "d") + +static const struct +{ + const char *name, *format; +} auxv_types[] = + { +#define TYPE(name, fmt) [AT_##name] = { #name, fmt }, + AUXV_TYPES +#undef TYPE + }; +#define nauxv_types (sizeof auxv_types / sizeof auxv_types[0]) + +int +ebl_auxv_info (ebl, a_type, name, format) + Ebl *ebl; + GElf_Xword a_type; + const char **name; + const char **format; +{ + int result = ebl->auxv_info (a_type, name, format); + if (result == 0 && a_type < nauxv_types && auxv_types[a_type].name != NULL) + { + /* The machine specific function did not know this type. */ + *name = auxv_types[a_type].name; + *format = auxv_types[a_type].format; + result = 1; + } + return result; +} diff --git a/libebl/eblbackendname.c b/libebl/eblbackendname.c index 03830ebe..daec8805 100644 --- a/libebl/eblbackendname.c +++ b/libebl/eblbackendname.c @@ -1,16 +1,52 @@ /* Return backend name. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblbsspltp.c b/libebl/eblbsspltp.c new file mode 100644 index 00000000..14b6f099 --- /dev/null +++ b/libebl/eblbsspltp.c @@ -0,0 +1,64 @@ +/* Check if backend uses a bss PLT. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <inttypes.h> +#include <libeblP.h> + + +bool +ebl_bss_plt_p (ebl, ehdr) + Ebl *ebl; + GElf_Ehdr *ehdr; +{ + return ebl == NULL ? false : ebl->bss_plt_p (ebl->elf, ehdr); +} diff --git a/libebl/eblcheckobjattr.c b/libebl/eblcheckobjattr.c new file mode 100644 index 00000000..fe75de74 --- /dev/null +++ b/libebl/eblcheckobjattr.c @@ -0,0 +1,81 @@ +/* Check object attributes. + Copyright (C) 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include <libeblP.h> + + +bool +ebl_check_object_attribute (ebl, vendor, tag, value, tag_name, value_name) + Ebl *ebl; + const char *vendor; + int tag; + uint64_t value; + const char **tag_name; + const char **value_name; +{ + if (ebl->check_object_attribute (ebl, vendor, tag, value, + tag_name, value_name)) + return true; + + if (strcmp (vendor, "gnu")) + return false; + + if (tag == 32) + { + *tag_name = "compatibility"; + return true; + } + + return false; +} diff --git a/libebl/eblclosebackend.c b/libebl/eblclosebackend.c index c5579612..a0fb3448 100644 --- a/libebl/eblclosebackend.c +++ b/libebl/eblclosebackend.c @@ -1,15 +1,51 @@ /* Free ELF backend handle. Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblcopyrelocp.c b/libebl/eblcopyrelocp.c new file mode 100644 index 00000000..a7aea880 --- /dev/null +++ b/libebl/eblcopyrelocp.c @@ -0,0 +1,64 @@ +/* Check whether given relocation is a copy relocation. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +bool +ebl_copy_reloc_p (ebl, reloc) + Ebl *ebl; + int reloc; +{ + return ebl->copy_reloc_p (reloc); +} diff --git a/libebl/eblcorenote.c b/libebl/eblcorenote.c index 6cc384fa..553d5ba9 100644 --- a/libebl/eblcorenote.c +++ b/libebl/eblcorenote.c @@ -1,151 +1,107 @@ -/* Print contents of core note. - Copyright (C) 2002, 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ +/* Describe known core note formats. + Copyright (C) 2007 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif +#include <assert.h> +#include <byteswap.h> +#include <endian.h> #include <inttypes.h> #include <stdio.h> #include <stddef.h> #include <libeblP.h> -void -ebl_core_note (ebl, name, type, descsz, desc) +int +ebl_core_note (ebl, n_type, descsz, + regs_offset, nregloc, reglocs, nitems, items) Ebl *ebl; - const char *name; - uint32_t type; - uint32_t descsz; - const char *desc; + GElf_Word n_type; + GElf_Word descsz; + GElf_Word *regs_offset; + size_t *nregloc; + const Ebl_Register_Location **reglocs; + size_t *nitems; + const Ebl_Core_Item **items; { - int class = gelf_getclass (ebl->elf); - - if (! ebl->core_note (name, type, descsz, desc)) - /* The machine specific function did not know this type. */ - switch (type) - { - case NT_PLATFORM: - printf (gettext (" Platform: %.*s\n"), (int) descsz, desc); - break; - - case NT_AUXV: - ; - size_t cnt; - size_t elsize = (class == ELFCLASS32 - ? sizeof (Elf32_auxv_t) : sizeof (Elf64_auxv_t)); - - for (cnt = 0; (cnt + 1) * elsize <= descsz; ++cnt) - { - unsigned long int atype; - unsigned long int val; - - if (class == ELFCLASS32) - { - Elf32_auxv_t *auxv = &((Elf32_auxv_t *) desc)[cnt]; - - atype = auxv->a_type; - val = auxv->a_un.a_val; - } - else - { - Elf64_auxv_t *auxv = &((Elf64_auxv_t *) desc)[cnt]; - - atype = auxv->a_type; - val = auxv->a_un.a_val; - } - - /* XXX Do we need the auxiliary vector info anywhere - else? If yes, move code into a separate function. */ - const char *at; - - switch (atype) - { -#define NEW_AT(name) case AT_##name: at = #name; break - NEW_AT (NULL); - NEW_AT (IGNORE); - NEW_AT (EXECFD); - NEW_AT (PHDR); - NEW_AT (PHENT); - NEW_AT (PHNUM); - NEW_AT (PAGESZ); - NEW_AT (BASE); - NEW_AT (FLAGS); - NEW_AT (ENTRY); - NEW_AT (NOTELF); - NEW_AT (UID); - NEW_AT (EUID); - NEW_AT (GID); - NEW_AT (EGID); - NEW_AT (CLKTCK); - NEW_AT (PLATFORM); - NEW_AT (HWCAP); - NEW_AT (FPUCW); - NEW_AT (DCACHEBSIZE); - NEW_AT (ICACHEBSIZE); - NEW_AT (UCACHEBSIZE); - NEW_AT (IGNOREPPC); - - default: - at = "???"; - break; - } - - switch (atype) + int result = ebl->core_note (n_type, descsz, regs_offset, nregloc, reglocs, + nitems, items); + if (result == 0) + { + /* The machine specific function did not know this type. */ + + *regs_offset = 0; + *nregloc = 0; + *reglocs = NULL; + switch (n_type) + { +#define ITEMS(type, table) \ + case type: \ + *items = table; \ + *nitems = sizeof table / sizeof table[0]; \ + result = 1; \ + break + + static const Ebl_Core_Item platform[] = + { { - case AT_NULL: - case AT_IGNORE: - case AT_IGNOREPPC: - case AT_NOTELF: - default: - printf (" %s\n", at); - break; - - case AT_EXECFD: - case AT_PHENT: - case AT_PHNUM: - case AT_PAGESZ: - case AT_UID: - case AT_EUID: - case AT_GID: - case AT_EGID: - case AT_CLKTCK: - case AT_FPUCW: - case AT_DCACHEBSIZE: - case AT_ICACHEBSIZE: - case AT_UCACHEBSIZE: - printf (" %s: %" PRId64 "\n", at, (int64_t) val); - break; - - case AT_PHDR: - case AT_BASE: - case AT_FLAGS: /* XXX Print flags? */ - case AT_ENTRY: - case AT_PLATFORM: /* XXX Get string? */ - case AT_HWCAP: /* XXX Print flags? */ - printf (" %s: %" PRIx64 "\n", at, (uint64_t) val); - break; + .name = "Platform", + .type = ELF_T_BYTE, .count = 0, .format = 's' } + }; + ITEMS (NT_PLATFORM, platform); - if (atype == AT_NULL) - /* Reached the end. */ - break; - } - break; +#undef ITEMS + } + } - default: - /* Unknown type. */ - break; - } + return result; } diff --git a/libebl/eblcorenotetypename.c b/libebl/eblcorenotetypename.c index 4a94d2ba..9376cf57 100644 --- a/libebl/eblcorenotetypename.c +++ b/libebl/eblcorenotetypename.c @@ -1,16 +1,52 @@ /* Return note type name. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2007, 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2002. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -20,7 +56,6 @@ #include <stdio.h> #include <libeblP.h> - const char * ebl_core_note_type_name (ebl, type, buf, len) Ebl *ebl; @@ -50,6 +85,7 @@ ebl_core_note_type_name (ebl, type, buf, len) KNOWNSTYPE (LWPSTATUS), KNOWNSTYPE (LWPSINFO), KNOWNSTYPE (PRFPXREG) +#undef KNOWNSTYPE }; /* Handle standard names. */ @@ -57,11 +93,21 @@ ebl_core_note_type_name (ebl, type, buf, len) && knowntypes[type] != NULL) res = knowntypes[type]; else - { - snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type); + switch (type) + { +#define KNOWNSTYPE(name) case NT_##name: res = #name; break + KNOWNSTYPE (PRXFPREG); + KNOWNSTYPE (PPC_VMX); + KNOWNSTYPE (PPC_SPE); + KNOWNSTYPE (386_TLS); + KNOWNSTYPE (386_IOPERM); +#undef KNOWNSTYPE + + default: + snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type); - res = buf; - } + res = buf; + } } return res; diff --git a/libebl/ebldebugscnp.c b/libebl/ebldebugscnp.c index 59310b51..c96622c5 100644 --- a/libebl/ebldebugscnp.c +++ b/libebl/ebldebugscnp.c @@ -1,16 +1,52 @@ /* Check section name for being that of a debug informatino section. Copyright (C) 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2002. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/ebldynamictagcheck.c b/libebl/ebldynamictagcheck.c index 68b41691..1953a9c0 100644 --- a/libebl/ebldynamictagcheck.c +++ b/libebl/ebldynamictagcheck.c @@ -1,16 +1,52 @@ /* Check dynamic tag. - Copyright (C) 2001, 2002 Red Hat, Inc. + Copyright (C) 2001, 2002, 2006 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -30,7 +66,7 @@ ebl_dynamic_tag_check (ebl, tag) if (!res && ((tag >= 0 && tag < DT_NUM) || (tag >= DT_GNU_PRELINKED && tag <= DT_SYMINENT) - || (tag >= DT_GNU_CONFLICT && tag <= DT_SYMINFO) + || (tag >= DT_GNU_HASH && tag <= DT_SYMINFO) || tag == DT_VERSYM || (tag >= DT_RELACOUNT && tag <= DT_VERNEEDNUM) || tag == DT_AUXILIARY diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c index 464c1e2a..e0972ede 100644 --- a/libebl/ebldynamictagname.c +++ b/libebl/ebldynamictagname.c @@ -1,16 +1,52 @@ /* Return dynamic tag name. - Copyright (C) 2001, 2002 Red Hat, Inc. + Copyright (C) 2001, 2002, 2006, 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -60,15 +96,16 @@ ebl_dynamic_tag_name (ebl, tag, buf, len) res = valrntags[tag - DT_GNU_PRELINKED]; } - else if (tag >= DT_GNU_CONFLICT && tag <= DT_SYMINFO) + else if (tag >= DT_GNU_HASH && tag <= DT_SYMINFO) { static const char *addrrntags[] = { + "GNU_HASH", "TLSDESC_PLT", "TLSDESC_DOT", "GNU_CONFLICT", "GNU_LIBLIST", "CONFIG", "DEPAUDIT", "AUDIT", "PLTPAD", "MOVETAB", "SYMINFO" }; - res = addrrntags[tag - DT_GNU_CONFLICT]; + res = addrrntags[tag - DT_GNU_HASH]; } else if (tag >= DT_RELACOUNT && tag <= DT_VERNEEDNUM) { @@ -86,7 +123,7 @@ ebl_dynamic_tag_name (ebl, tag, buf, len) res = "FILTER"; else { - snprintf (buf, len, gettext ("<unknown>: %" PRId64), tag); + snprintf (buf, len, gettext ("<unknown>: %#" PRIx64), tag); res = buf; diff --git a/libebl/eblelfclass.c b/libebl/eblelfclass.c new file mode 100644 index 00000000..222307e7 --- /dev/null +++ b/libebl/eblelfclass.c @@ -0,0 +1,63 @@ +/* Return ELF class. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +int +ebl_get_elfclass (ebl) + Ebl *ebl; +{ + return ebl->class; +} diff --git a/libebl/eblelfdata.c b/libebl/eblelfdata.c new file mode 100644 index 00000000..f84ae165 --- /dev/null +++ b/libebl/eblelfdata.c @@ -0,0 +1,63 @@ +/* Return ELF data encoding. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +int +ebl_get_elfdata (ebl) + Ebl *ebl; +{ + return ebl->data; +} diff --git a/libebl/eblelfmachine.c b/libebl/eblelfmachine.c new file mode 100644 index 00000000..9839fefe --- /dev/null +++ b/libebl/eblelfmachine.c @@ -0,0 +1,63 @@ +/* Return ELF machine. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +int +ebl_get_elfmachine (ebl) + Ebl *ebl; +{ + return ebl->machine; +} diff --git a/libebl/eblgotpcreloccheck.c b/libebl/eblgotpcreloccheck.c index 8ae8b7b8..e70fcb19 100644 --- a/libebl/eblgotpcreloccheck.c +++ b/libebl/eblgotpcreloccheck.c @@ -1,17 +1,53 @@ /* Return true if the symbol type is that referencing the GOT. E.g., R_386_GOTPC. Copyright (C) 2003 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2003. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblgstrtab.c b/libebl/eblgstrtab.c index 1fee0e89..73f0d278 100644 --- a/libebl/eblgstrtab.c +++ b/libebl/eblgstrtab.c @@ -1,16 +1,52 @@ /* Generic string table handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2000. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -139,16 +175,11 @@ ebl_gstrtabfree (struct Ebl_GStrtab *st) static struct Ebl_GStrent * newstring (struct Ebl_GStrtab *st, const char *str, size_t len) { - struct Ebl_GStrent *newstr; - size_t align; - size_t i; - size_t j; - /* Compute the amount of padding needed to make the structure aligned. */ - align = ((__alignof__ (struct Ebl_GStrent) - - (((uintptr_t) st->backp) - & (__alignof__ (struct Ebl_GStrent) - 1))) - & (__alignof__ (struct Ebl_GStrent) - 1)); + size_t align = ((__alignof__ (struct Ebl_GStrent) + - (((uintptr_t) st->backp) + & (__alignof__ (struct Ebl_GStrent) - 1))) + & (__alignof__ (struct Ebl_GStrent) - 1)); /* Make sure there is enough room in the memory block. */ if (st->left < align + sizeof (struct Ebl_GStrent) + len * st->width) @@ -158,7 +189,7 @@ newstring (struct Ebl_GStrtab *st, const char *str, size_t len) } /* Create the reserved string. */ - newstr = (struct Ebl_GStrent *) (st->backp + align); + struct Ebl_GStrent *newstr = (struct Ebl_GStrent *) (st->backp + align); newstr->string = str; newstr->len = len; newstr->width = st->width; @@ -166,10 +197,10 @@ newstring (struct Ebl_GStrtab *st, const char *str, size_t len) newstr->left = NULL; newstr->right = NULL; newstr->offset = 0; - for (i = len - 2; i >= 0; --i) - for (j = st->width - 1; j >= 0; --j) + for (int i = len - 2; i >= 0; --i) + for (int j = st->width - 1; j >= 0; --j) newstr->reverse[i * st->width + j] = str[(len - 2 - i) * st->width + j]; - for (j = 0; j < st->width; ++j) + for (size_t j = 0; j < st->width; ++j) newstr->reverse[(len - 1) * st->width + j] = '\0'; st->backp += align + sizeof (struct Ebl_GStrent) + len * st->width; st->left -= align + sizeof (struct Ebl_GStrent) + len * st->width; diff --git a/libebl/eblmachineflagcheck.c b/libebl/eblmachineflagcheck.c index abc8d302..ac383f60 100644 --- a/libebl/eblmachineflagcheck.c +++ b/libebl/eblmachineflagcheck.c @@ -1,16 +1,52 @@ /* Check machine flag. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblmachineflagname.c b/libebl/eblmachineflagname.c index 228a9945..88a8da83 100644 --- a/libebl/eblmachineflagname.c +++ b/libebl/eblmachineflagname.c @@ -1,16 +1,52 @@ /* Return machine flag names. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblmachinesectionflagcheck.c b/libebl/eblmachinesectionflagcheck.c new file mode 100644 index 00000000..9eb6d386 --- /dev/null +++ b/libebl/eblmachinesectionflagcheck.c @@ -0,0 +1,63 @@ +/* Check SHF_MASKPROC flags. + Copyright (C) 2007 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +bool +ebl_machine_section_flag_check (ebl, flags) + Ebl *ebl; + GElf_Xword flags; +{ + return ebl != NULL ? ebl->machine_section_flag_check (flags) : (flags == 0); +} diff --git a/libebl/eblnonerelocp.c b/libebl/eblnonerelocp.c new file mode 100644 index 00000000..3bca98b1 --- /dev/null +++ b/libebl/eblnonerelocp.c @@ -0,0 +1,64 @@ +/* Check whether given relocation is a no-op relocation. + Copyright (C) 2006 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2006. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +bool +ebl_none_reloc_p (ebl, reloc) + Ebl *ebl; + int reloc; +{ + return ebl->none_reloc_p (reloc); +} diff --git a/libebl/eblobjecttypename.c b/libebl/eblobjecttypename.c index c099c71d..ce100e7f 100644 --- a/libebl/eblobjecttypename.c +++ b/libebl/eblobjecttypename.c @@ -1,16 +1,52 @@ /* Return object file type name. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c index 5adff18e..836ac8dc 100644 --- a/libebl/eblobjnote.c +++ b/libebl/eblobjnote.c @@ -1,16 +1,52 @@ /* Print contents of object file note. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2007 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2002. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -34,48 +70,71 @@ ebl_object_note (ebl, name, type, descsz, desc) /* The machine specific function did not know this type. */ switch (type) { - case NT_VERSION: - if (strcmp (name, "GNU") == 0 && descsz >= 8) + case NT_GNU_BUILD_ID: + if (strcmp (name, "GNU") == 0 && descsz > 0) + { + printf (gettext (" Build ID: ")); + uint_fast32_t i; + for (i = 0; i < descsz - 1; ++i) + printf ("%02" PRIx8, (uint8_t) desc[i]); + printf ("%02" PRIx8 "\n", (uint8_t) desc[i]); + } + break; + + case NT_GNU_ABI_TAG: + if (strcmp (name, "GNU") == 0 && descsz >= 8 && descsz % 4 == 0) { - struct - { - uint32_t os; - uint32_t version[descsz / 4 - 1]; - } *tag = (__typeof (tag)) desc; - - const char *os; - switch (tag->os) + Elf_Data in = + { + .d_version = EV_CURRENT, + .d_type = ELF_T_WORD, + .d_size = descsz, + .d_buf = (void *) desc + }; + uint32_t buf[descsz / 4]; + Elf_Data out = + { + .d_version = EV_CURRENT, + .d_type = ELF_T_WORD, + .d_size = descsz, + .d_buf = buf + }; + + if (elf32_xlatetom (&out, &in, ebl->data) != NULL) { - case ELF_NOTE_OS_LINUX: - os = "Linux"; - break; + const char *os; + switch (buf[0]) + { + case ELF_NOTE_OS_LINUX: + os = "Linux"; + break; - case ELF_NOTE_OS_GNU: - os = "GNU"; - break; + case ELF_NOTE_OS_GNU: + os = "GNU"; + break; - case ELF_NOTE_OS_SOLARIS2: - os = "Solaris"; - break; + case ELF_NOTE_OS_SOLARIS2: + os = "Solaris"; + break; - case ELF_NOTE_OS_FREEBSD: - os = "FreeBSD"; - break; + case ELF_NOTE_OS_FREEBSD: + os = "FreeBSD"; + break; - default: - os = "???"; - break; - } + default: + os = "???"; + break; + } - printf (gettext (" OS: %s, ABI: "), os); - size_t cnt; - for (cnt = 0; cnt < descsz / 4 - 1; ++cnt) - { - if (cnt != 0) - putchar_unlocked ('.'); - printf ("%" PRIu32, tag->version[cnt]); + printf (gettext (" OS: %s, ABI: "), os); + for (size_t cnt = 1; cnt < descsz / 4; ++cnt) + { + if (cnt > 1) + putchar_unlocked ('.'); + printf ("%" PRIu32, buf[cnt]); + } + putchar_unlocked ('\n'); } - putchar_unlocked ('\n'); break; } /* FALLTHROUGH */ diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c index a963cefb..ff9330f9 100644 --- a/libebl/eblobjnotetypename.c +++ b/libebl/eblobjnotetypename.c @@ -1,16 +1,52 @@ /* Return note type name. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2007 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2002. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -36,6 +72,8 @@ ebl_object_note_type_name (ebl, type, buf, len) { #define KNOWNSTYPE(name) [NT_##name] = #name KNOWNSTYPE (VERSION), + KNOWNSTYPE (GNU_HWCAP), + KNOWNSTYPE (GNU_BUILD_ID), }; /* Handle standard names. */ diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index c801a6a0..8cf42189 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -1,15 +1,51 @@ /* Generate ELF backend handle. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -18,9 +54,11 @@ #include <assert.h> #include <dlfcn.h> #include <error.h> -#include <gelf.h> +#include <libelfP.h> +#include <dwarf.h> #include <stdlib.h> #include <string.h> +#include <stdio.h> #include <libeblP.h> @@ -36,83 +74,83 @@ static const struct const char *prefix; int prefix_len; int em; + int class; + int data; } machines[] = { - { "i386", "elf_i386", "i386", 4, EM_386 }, - { "ia64", "elf_ia64", "ia64", 4, EM_IA_64 }, - { "alpha", "elf_alpha", "alpha", 5, EM_ALPHA }, - { "x86_64", "elf_x86_64", "x86_64", 6, EM_X86_64 }, - { "sh", "elf_sh", "sh", 2, EM_SH }, - { "arm", "ebl_arm", "arm", 3, EM_ARM }, - { "sparc", "elf_sparcv9", "sparc", 5, EM_SPARCV9 }, - { "sparc", "elf_sparc", "sparc", 5, EM_SPARC }, - { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS }, - - { "m32", "elf_m32", "m32", 3, EM_M32 }, - { "m68k", "elf_m68k", "m68k", 4, EM_68K }, - { "m88k", "elf_m88k", "m88k", 4, EM_88K }, - { "i860", "elf_i860", "i860", 4, EM_860 }, - { "mips", "elf_mips", "mips", 4, EM_MIPS }, - { "s370", "ebl_s370", "s370", 4, EM_S370 }, - { "mips", "elf_mipsel", "mips", 4, EM_MIPS_RS3_LE }, - { "parisc", "elf_parisc", "parisc", 6, EM_PARISC }, - { "vpp500", "elf_vpp500", "vpp500", 5, EM_VPP500 }, - { "sparc", "elf_v8plus", "v8plus", 6, EM_SPARC32PLUS }, - { "i960", "elf_i960", "i960", 4, EM_960 }, - { "ppc", "elf_ppc", "ppc", 3, EM_PPC }, - { "ppc64", "elf_ppc64", "ppc64", 5, EM_PPC64 }, - { "s390", "ebl_s390", "s390", 4, EM_S390 }, - { "v800", "ebl_v800", "v800", 4, EM_V800 }, - { "fr20", "ebl_fr20", "fr20", 4, EM_FR20 }, - { "rh32", "ebl_rh32", "rh32", 4, EM_RH32 }, - { "rce", "ebl_rce", "rce", 3, EM_RCE }, - { "tricore", "elf_tricore", "tricore", 7, EM_TRICORE }, - { "arc", "elf_arc", "arc", 3, EM_ARC }, - { "h8", "elf_h8_300", "h8_300", 6, EM_H8_300 }, - { "h8", "elf_h8_300h", "h8_300h", 6, EM_H8_300H }, - { "h8", "elf_h8s", "h8s", 6, EM_H8S }, - { "h8", "elf_h8_500", "h8_500", 6, EM_H8_500 }, - { "mips_x", "elf_mips_x", "mips_x", 6, EM_MIPS_X }, - { "coldfire", "elf_coldfire", "coldfire", 8, EM_COLDFIRE }, - { "m68k", "elf_68hc12", "68hc12", 6, EM_68HC12 }, - { "mma", "elf_mma", "mma", 3, EM_MMA }, - { "pcp", "elf_pcp", "pcp", 3, EM_PCP }, - { "ncpu", "elf_ncpu", "ncpu", 4, EM_NCPU }, - { "ndr1", "elf_ndr1", "ndr1", 4, EM_NDR1 }, - { "starcore", "elf_starcore", "starcore", 8, EM_STARCORE }, - { "me16", "elf_me16", "em16", 4, EM_ME16 }, - { "st100", "elf_st100", "st100", 5, EM_ST100 }, - { "tinyj", "elf_tinyj", "tinyj", 5, EM_TINYJ }, - { "pdsp", "elf_pdsp", "pdsp", 4, EM_PDSP }, - { "fx66", "elf_fx66", "fx66", 4, EM_FX66 }, - { "st9plus", "elf_st9plus", "st9plus", 7, EM_ST9PLUS }, - { "st7", "elf_st7", "st7", 3, EM_ST7 }, - { "m68k", "elf_68hc16", "68hc16", 6, EM_68HC16 }, - { "m68k", "elf_68hc11", "68hc11", 6, EM_68HC11 }, - { "m68k", "elf_68hc08", "68hc08", 6, EM_68HC08 }, - { "m68k", "elf_68hc05", "68hc05", 6, EM_68HC05 }, - { "svx", "elf_svx", "svx", 3, EM_SVX }, - { "st19", "elf_st19", "st19", 4, EM_ST19 }, - { "vax", "elf_vax", "vax", 3, EM_VAX }, - { "cris", "elf_cris", "cris", 4, EM_CRIS }, - { "javelin", "elf_javelin", "javelin", 7, EM_JAVELIN }, - { "firepath", "elf_firepath", "firepath", 8, EM_FIREPATH }, - { "zsp", "elf_zsp", "zsp", 3, EM_ZSP}, - { "mmix", "elf_mmix", "mmix", 4, EM_MMIX }, - { "hunay", "elf_huany", "huany", 5, EM_HUANY }, - { "prism", "elf_prism", "prism", 5, EM_PRISM }, - { "avr", "elf_avr", "avr", 3, EM_AVR }, - { "fr30", "elf_fr30", "fr30", 4, EM_FR30 }, - { "dv10", "elf_dv10", "dv10", 4, EM_D10V }, - { "dv30", "elf_dv30", "dv30", 4, EM_D30V }, - { "v850", "elf_v850", "v850", 4, EM_V850 }, - { "m32r", "elf_m32r", "m32r", 4, EM_M32R }, - { "mn10300", "elf_mn10300", "mn10300", 7, EM_MN10300 }, - { "mn10200", "elf_mn10200", "mn10200", 7, EM_MN10200 }, - { "pj", "elf_pj", "pj", 2, EM_PJ }, - { "openrisc", "elf_openrisc", "openrisc", 8, EM_OPENRISC }, - { "arc", "elf_arc_a5", "arc_a5", 6, EM_ARC_A5 }, - { "xtensa", "elf_xtensa", "xtensa", 6, EM_XTENSA }, + { "i386", "elf_i386", "i386", 4, EM_386, ELFCLASS32, ELFDATA2LSB }, + { "ia64", "elf_ia64", "ia64", 4, EM_IA_64, ELFCLASS64, ELFDATA2LSB }, + { "alpha", "elf_alpha", "alpha", 5, EM_ALPHA, ELFCLASS64, ELFDATA2LSB }, + { "x86_64", "elf_x86_64", "x86_64", 6, EM_X86_64, ELFCLASS64, ELFDATA2LSB }, + { "ppc", "elf_ppc", "ppc", 3, EM_PPC, ELFCLASS32, ELFDATA2MSB }, + { "ppc64", "elf_ppc64", "ppc64", 5, EM_PPC64, ELFCLASS64, ELFDATA2MSB }, + // XXX class and machine fields need to be filled in for all archs. + { "sh", "elf_sh", "sh", 2, EM_SH, 0, 0 }, + { "arm", "ebl_arm", "arm", 3, EM_ARM, 0, 0 }, + { "sparc", "elf_sparcv9", "sparc", 5, EM_SPARCV9, 0, 0 }, + { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 }, + { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 }, + { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 }, + + { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 }, + { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 }, + { "m88k", "elf_m88k", "m88k", 4, EM_88K, 0, 0 }, + { "i860", "elf_i860", "i860", 4, EM_860, 0, 0 }, + { "s370", "ebl_s370", "s370", 4, EM_S370, 0, 0 }, + { "parisc", "elf_parisc", "parisc", 6, EM_PARISC, 0, 0 }, + { "vpp500", "elf_vpp500", "vpp500", 5, EM_VPP500, 0, 0 }, + { "sparc", "elf_v8plus", "v8plus", 6, EM_SPARC32PLUS, 0, 0 }, + { "i960", "elf_i960", "i960", 4, EM_960, 0, 0 }, + { "v800", "ebl_v800", "v800", 4, EM_V800, 0, 0 }, + { "fr20", "ebl_fr20", "fr20", 4, EM_FR20, 0, 0 }, + { "rh32", "ebl_rh32", "rh32", 4, EM_RH32, 0, 0 }, + { "rce", "ebl_rce", "rce", 3, EM_RCE, 0, 0 }, + { "tricore", "elf_tricore", "tricore", 7, EM_TRICORE, 0, 0 }, + { "arc", "elf_arc", "arc", 3, EM_ARC, 0, 0 }, + { "h8", "elf_h8_300", "h8_300", 6, EM_H8_300, 0, 0 }, + { "h8", "elf_h8_300h", "h8_300h", 6, EM_H8_300H, 0, 0 }, + { "h8", "elf_h8s", "h8s", 6, EM_H8S, 0, 0 }, + { "h8", "elf_h8_500", "h8_500", 6, EM_H8_500, 0, 0 }, + { "coldfire", "elf_coldfire", "coldfire", 8, EM_COLDFIRE, 0, 0 }, + { "m68k", "elf_68hc12", "68hc12", 6, EM_68HC12, 0, 0 }, + { "mma", "elf_mma", "mma", 3, EM_MMA, 0, 0 }, + { "pcp", "elf_pcp", "pcp", 3, EM_PCP, 0, 0 }, + { "ncpu", "elf_ncpu", "ncpu", 4, EM_NCPU, 0, 0 }, + { "ndr1", "elf_ndr1", "ndr1", 4, EM_NDR1, 0, 0 }, + { "starcore", "elf_starcore", "starcore", 8, EM_STARCORE, 0, 0 }, + { "me16", "elf_me16", "em16", 4, EM_ME16, 0, 0 }, + { "st100", "elf_st100", "st100", 5, EM_ST100, 0, 0 }, + { "tinyj", "elf_tinyj", "tinyj", 5, EM_TINYJ, 0, 0 }, + { "pdsp", "elf_pdsp", "pdsp", 4, EM_PDSP, 0, 0 }, + { "fx66", "elf_fx66", "fx66", 4, EM_FX66, 0, 0 }, + { "st9plus", "elf_st9plus", "st9plus", 7, EM_ST9PLUS, 0, 0 }, + { "st7", "elf_st7", "st7", 3, EM_ST7, 0, 0 }, + { "m68k", "elf_68hc16", "68hc16", 6, EM_68HC16, 0, 0 }, + { "m68k", "elf_68hc11", "68hc11", 6, EM_68HC11, 0, 0 }, + { "m68k", "elf_68hc08", "68hc08", 6, EM_68HC08, 0, 0 }, + { "m68k", "elf_68hc05", "68hc05", 6, EM_68HC05, 0, 0 }, + { "svx", "elf_svx", "svx", 3, EM_SVX, 0, 0 }, + { "st19", "elf_st19", "st19", 4, EM_ST19, 0, 0 }, + { "vax", "elf_vax", "vax", 3, EM_VAX, 0, 0 }, + { "cris", "elf_cris", "cris", 4, EM_CRIS, 0, 0 }, + { "javelin", "elf_javelin", "javelin", 7, EM_JAVELIN, 0, 0 }, + { "firepath", "elf_firepath", "firepath", 8, EM_FIREPATH, 0, 0 }, + { "zsp", "elf_zsp", "zsp", 3, EM_ZSP, 0, 0 }, + { "mmix", "elf_mmix", "mmix", 4, EM_MMIX, 0, 0 }, + { "hunay", "elf_huany", "huany", 5, EM_HUANY, 0, 0 }, + { "prism", "elf_prism", "prism", 5, EM_PRISM, 0, 0 }, + { "avr", "elf_avr", "avr", 3, EM_AVR, 0, 0 }, + { "fr30", "elf_fr30", "fr30", 4, EM_FR30, 0, 0 }, + { "dv10", "elf_dv10", "dv10", 4, EM_D10V, 0, 0 }, + { "dv30", "elf_dv30", "dv30", 4, EM_D30V, 0, 0 }, + { "v850", "elf_v850", "v850", 4, EM_V850, 0, 0 }, + { "m32r", "elf_m32r", "m32r", 4, EM_M32R, 0, 0 }, + { "mn10300", "elf_mn10300", "mn10300", 7, EM_MN10300, 0, 0 }, + { "mn10200", "elf_mn10200", "mn10200", 7, EM_MN10200, 0, 0 }, + { "pj", "elf_pj", "pj", 2, EM_PJ, 0, 0 }, + { "openrisc", "elf_openrisc", "openrisc", 8, EM_OPENRISC, 0, 0 }, + { "arc", "elf_arc_a5", "arc_a5", 6, EM_ARC_A5, 0, 0 }, + { "xtensa", "elf_xtensa", "xtensa", 6, EM_XTENSA, 0, 0 }, }; #define nmachines (sizeof (machines) / sizeof (machines[0])) @@ -123,6 +161,7 @@ static const char *default_object_type_name (int ignore, char *buf, static const char *default_reloc_type_name (int ignore, char *buf, size_t len); static bool default_reloc_type_check (int ignore); static bool default_reloc_valid_use (Elf *elf, int ignore); +static Elf_Type default_reloc_simple_type (Ebl *ebl, int ignore); static bool default_gotpc_reloc_check (Elf *elf, int ignore); static const char *default_segment_type_name (int ignore, char *buf, size_t len); @@ -132,6 +171,7 @@ static const char *default_section_name (int ignore, int ignore2, char *buf, size_t len); static const char *default_machine_flag_name (Elf64_Word *ignore); static bool default_machine_flag_check (Elf64_Word flags); +static bool default_machine_section_flag_check (GElf_Xword flags); static const char *default_symbol_type_name (int ignore, char *buf, size_t len); static const char *default_symbol_binding_name (int ignore, char *buf, @@ -146,46 +186,56 @@ static const char *default_core_note_type_name (uint32_t, char *buf, size_t len); static const char *default_object_note_type_name (uint32_t, char *buf, size_t len); -static bool default_core_note (const char *name, uint32_t type, - uint32_t descsz, const char *desc); +static int default_core_note (GElf_Word n_type, GElf_Word descsz, + GElf_Word *regs_offset, size_t *nregloc, + const Ebl_Register_Location **reglocs, + size_t *nitems, const Ebl_Core_Item **); +static int default_auxv_info (GElf_Xword a_type, + const char **name, const char **format); static bool default_object_note (const char *name, uint32_t type, uint32_t descsz, const char *desc); static bool default_debugscn_p (const char *name); +static bool default_copy_reloc_p (int reloc); +static bool default_none_reloc_p (int reloc); +static bool default_relative_reloc_p (int reloc); +static bool default_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, + const GElf_Sym *sym, + const char *name, + const GElf_Shdr *destshdr); +static bool default_check_special_section (Ebl *, int, + const GElf_Shdr *, const char *); +static bool default_bss_plt_p (Elf *elf, GElf_Ehdr *ehdr); +static int default_return_value_location (Dwarf_Die *functypedie, + const Dwarf_Op **locops); +static ssize_t default_register_info (Ebl *ebl, + int regno, char *name, size_t namelen, + const char **prefix, + const char **setname, + int *bits, int *type); +static int default_syscall_abi (Ebl *ebl, int *sp, int *pc, + int *callno, int args[6]); +static bool default_check_object_attribute (Ebl *ebl, const char *vendor, + int tag, uint64_t value, + const char **tag_name, + const char **value_name); -/* Find an appropriate backend for the file associated with ELF. */ -static Ebl * -openbackend (elf, emulation, machine) - Elf *elf; - const char *emulation; - GElf_Half machine; +static void +fill_defaults (Ebl *result) { - Ebl *result; - size_t cnt; - - /* First allocate the data structure for the result. We do this - here since this assures that the structure is always large - enough. */ - result = (Ebl *) calloc (1, sizeof (Ebl)); - if (result == NULL) - { - // XXX uncomment - // __libebl_seterror (ELF_E_NOMEM); - return NULL; - } - - /* Fill in the default callbacks. The initializer for the machine - specific module can overwrite the values. */ result->object_type_name = default_object_type_name; result->reloc_type_name = default_reloc_type_name; result->reloc_type_check = default_reloc_type_check; result->reloc_valid_use = default_reloc_valid_use; + result->reloc_simple_type = default_reloc_simple_type; result->gotpc_reloc_check = default_gotpc_reloc_check; result->segment_type_name = default_segment_type_name; result->section_type_name = default_section_type_name; result->section_name = default_section_name; result->machine_flag_name = default_machine_flag_name; result->machine_flag_check = default_machine_flag_check; + result->machine_section_flag_check = default_machine_section_flag_check; + result->check_special_section = default_check_special_section; result->symbol_type_name = default_symbol_type_name; result->symbol_binding_name = default_symbol_binding_name; result->dynamic_tag_name = default_dynamic_tag_name; @@ -195,9 +245,48 @@ openbackend (elf, emulation, machine) result->core_note_type_name = default_core_note_type_name; result->object_note_type_name = default_object_note_type_name; result->core_note = default_core_note; + result->auxv_info = default_auxv_info; result->object_note = default_object_note; result->debugscn_p = default_debugscn_p; + result->copy_reloc_p = default_copy_reloc_p; + result->none_reloc_p = default_none_reloc_p; + result->relative_reloc_p = default_relative_reloc_p; + result->check_special_symbol = default_check_special_symbol; + result->bss_plt_p = default_bss_plt_p; + result->return_value_location = default_return_value_location; + result->register_info = default_register_info; + result->syscall_abi = default_syscall_abi; + result->check_object_attribute = default_check_object_attribute; + result->disasm = NULL; result->destr = default_destr; + result->sysvhash_entrysize = sizeof (Elf32_Word); +} + + +/* Find an appropriate backend for the file associated with ELF. */ +static Ebl * +openbackend (elf, emulation, machine) + Elf *elf; + const char *emulation; + GElf_Half machine; +{ + Ebl *result; + size_t cnt; + + /* First allocate the data structure for the result. We do this + here since this assures that the structure is always large + enough. */ + result = (Ebl *) calloc (1, sizeof (Ebl)); + if (result == NULL) + { + // XXX uncomment + // __libebl_seterror (ELF_E_NOMEM); + return NULL; + } + + /* Fill in the default callbacks. The initializer for the machine + specific module can overwrite the values. */ + fill_defaults (result); /* XXX Currently all we do is to look at 'e_machine' value in the ELF header. With an internal mapping table from EM_* value to @@ -215,11 +304,38 @@ openbackend (elf, emulation, machine) /* Well, we know the emulation name now. */ result->emulation = machines[cnt].emulation; + /* We access some data structures directly. Make sure the 32 and + 64 bit variants are laid out the same. */ + assert (offsetof (Elf32_Ehdr, e_machine) + == offsetof (Elf64_Ehdr, e_machine)); + assert (sizeof (((Elf32_Ehdr *) 0)->e_machine) + == sizeof (((Elf64_Ehdr *) 0)->e_machine)); + assert (offsetof (Elf, state.elf32.ehdr) + == offsetof (Elf, state.elf64.ehdr)); + + /* Prefer taking the information from the ELF file. */ + if (elf == NULL) + { + result->machine = machines[cnt].em; + result->class = machines[cnt].class; + result->data = machines[cnt].data; + } + else + { + result->machine = elf->state.elf32.ehdr->e_machine; + result->class = elf->state.elf32.ehdr->e_ident[EI_CLASS]; + result->data = elf->state.elf32.ehdr->e_ident[EI_DATA]; + } + +#ifndef LIBEBL_SUBDIR +# define LIBEBL_SUBDIR PACKAGE +#endif +#define ORIGINDIR "$ORIGIN/../$LIB/" LIBEBL_SUBDIR "/" + /* Give it a try. At least the machine type matches. First try to load the module. */ char dsoname[100]; - strcpy (stpcpy (stpcpy (dsoname, - "$ORIGIN/../" LIBSTR "/elfutils/libebl_"), + strcpy (stpcpy (stpcpy (dsoname, ORIGINDIR "libebl_"), machines[cnt].dsoname), ".so"); @@ -237,6 +353,8 @@ openbackend (elf, emulation, machine) { /* We managed to load the object. Now see whether the initialization function likes our file. */ + static const char version[] = MODVERSION; + const char *modversion; ebl_bhinit_t initp; char symname[machines[cnt].prefix_len + sizeof "_init"]; @@ -245,7 +363,8 @@ openbackend (elf, emulation, machine) initp = (ebl_bhinit_t) dlsym (h, symname); if (initp != NULL - && initp (elf, machine, result, sizeof (Ebl)) == 0) + && (modversion = initp (elf, machine, result, sizeof (Ebl))) + && strcmp (version, modversion) == 0) { /* We found a module to handle our file. */ result->dlhandle = h; @@ -267,6 +386,7 @@ openbackend (elf, emulation, machine) result->dlhandle = NULL; result->elf = elf; result->name = machines[cnt].prefix; + fill_defaults (result); return result; } @@ -276,6 +396,7 @@ openbackend (elf, emulation, machine) result->elf = elf; result->emulation = "<unknown>"; result->name = "<unknown>"; + fill_defaults (result); return result; } @@ -321,85 +442,126 @@ ebl_openbackend_emulation (const char *emulation) /* Default callbacks. Mostly they just return the error value. */ static const char * -default_object_type_name (int ignore, char *buf, size_t len) +default_object_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_reloc_type_name (int ignore, char *buf, size_t len) +default_reloc_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static bool -default_reloc_type_check (int ignore) +default_reloc_type_check (int ignore __attribute__ ((unused))) { return false; } static bool -default_reloc_valid_use (Elf *elf, int ignore) +default_reloc_valid_use (Elf *elf __attribute__ ((unused)), + int ignore __attribute__ ((unused))) { return false; } +static Elf_Type +default_reloc_simple_type (Ebl *eh __attribute__ ((unused)), + int ignore __attribute__ ((unused))) +{ + return ELF_T_NUM; +} + static bool -default_gotpc_reloc_check (Elf *elf, int ignore) +default_gotpc_reloc_check (Elf *elf __attribute__ ((unused)), + int ignore __attribute__ ((unused))) { return false; } static const char * -default_segment_type_name (int ignore, char *buf, size_t len) +default_segment_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_section_type_name (int ignore, char *buf, size_t len) +default_section_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_section_name (int ignore, int ignore2, char *buf, size_t len) +default_section_name (int ignore __attribute__ ((unused)), + int ignore2 __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_machine_flag_name (Elf64_Word *ignore) +default_machine_flag_name (Elf64_Word *ignore __attribute__ ((unused))) { return NULL; } static bool -default_machine_flag_check (Elf64_Word flags) +default_machine_flag_check (Elf64_Word flags __attribute__ ((unused))) +{ + return flags == 0; +} + +static bool +default_machine_section_flag_check (GElf_Xword flags) { return flags == 0; } +static bool +default_check_special_section (Ebl *ebl __attribute__ ((unused)), + int ndx __attribute__ ((unused)), + const GElf_Shdr *shdr __attribute__ ((unused)), + const char *sname __attribute__ ((unused))) +{ + return false; +} + static const char * -default_symbol_type_name (int ignore, char *buf, size_t len) +default_symbol_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_symbol_binding_name (int ignore, char *buf, size_t len) +default_symbol_binding_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_dynamic_tag_name (int64_t ignore, char *buf, size_t len) +default_dynamic_tag_name (int64_t ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static bool -default_dynamic_tag_check (int64_t ignore) +default_dynamic_tag_check (int64_t ignore __attribute__ ((unused))) { return false; } @@ -411,38 +573,60 @@ default_sh_flags_combine (GElf_Word flags1, GElf_Word flags2) } static void -default_destr (struct ebl *ignore) +default_destr (struct ebl *ignore __attribute__ ((unused))) { } static const char * -default_osabi_name (int ignore, char *buf, size_t len) +default_osabi_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_core_note_type_name (uint32_t ignore, char *buf, size_t len) +default_core_note_type_name (uint32_t ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } -static const char * -default_object_note_type_name (uint32_t ignore, char *buf, size_t len) +static int +default_auxv_info (GElf_Xword a_type __attribute__ ((unused)), + const char **name __attribute__ ((unused)), + const char **format __attribute__ ((unused))) { - return NULL; + return 0; } -static bool -default_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc) +static int +default_core_note (GElf_Word n_type __attribute__ ((unused)), + GElf_Word descsz __attribute__ ((unused)), + GElf_Word *ro __attribute__ ((unused)), + size_t *nregloc __attribute__ ((unused)), + const Ebl_Register_Location **reglocs + __attribute__ ((unused)), + size_t *nitems __attribute__ ((unused)), + const Ebl_Core_Item **items __attribute__ ((unused))) +{ + return 0; +} + +static const char * +default_object_note_type_name (uint32_t ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static bool -default_object_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc) +default_object_note (const char *name __attribute__ ((unused)), + uint32_t type __attribute__ ((unused)), + uint32_t descsz __attribute__ ((unused)), + const char *desc __attribute__ ((unused))) { return NULL; } @@ -481,11 +665,84 @@ default_debugscn_p (const char *name) }; const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); - size_t cnt; - - for (cnt = 0; cnt < ndwarf_scn_names; ++cnt) + for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt) if (strcmp (name, dwarf_scn_names[cnt]) == 0) return true; return false; } + +static bool +default_copy_reloc_p (int reloc __attribute__ ((unused))) +{ + return false; +} +strong_alias (default_copy_reloc_p, default_none_reloc_p) +strong_alias (default_copy_reloc_p, default_relative_reloc_p) + +static bool +default_check_special_symbol (Elf *elf __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + const GElf_Sym *sym __attribute__ ((unused)), + const char *name __attribute__ ((unused)), + const GElf_Shdr *destshdr __attribute__ ((unused))) +{ + return false; +} + +static bool +default_bss_plt_p (Elf *elf __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused))) +{ + return false; +} + +static int +default_return_value_location (Dwarf_Die *functypedie __attribute__ ((unused)), + const Dwarf_Op **locops __attribute__ ((unused))) +{ + return -2; +} + +static ssize_t +default_register_info (Ebl *ebl __attribute__ ((unused)), + int regno, char *name, size_t namelen, + const char **prefix, + const char **setname, + int *bits, int *type) +{ + if (name == NULL) + return 0; + + *setname = "???"; + *prefix = ""; + *bits = -1; + *type = DW_ATE_void; + return snprintf (name, namelen, "reg%d", regno); +} + +static int +default_syscall_abi (Ebl *ebl __attribute__ ((unused)), + int *sp, int *pc, int *callno, int args[6]) +{ + *sp = *pc = *callno = -1; + args[0] = -1; + args[1] = -1; + args[2] = -1; + args[3] = -1; + args[4] = -1; + args[5] = -1; + return -1; +} + +static bool +default_check_object_attribute (Ebl *ebl __attribute__ ((unused)), + const char *vendor __attribute__ ((unused)), + int tag __attribute__ ((unused)), + uint64_t value __attribute__ ((unused)), + const char **tag_name, const char **value_name) +{ + *tag_name = NULL; + *value_name = NULL; + return false; +} diff --git a/libebl/eblosabiname.c b/libebl/eblosabiname.c index 9a1e6534..3b38b441 100644 --- a/libebl/eblosabiname.c +++ b/libebl/eblosabiname.c @@ -1,16 +1,52 @@ /* Return OS ABI name Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblreginfo.c b/libebl/eblreginfo.c new file mode 100644 index 00000000..8fc4abfa --- /dev/null +++ b/libebl/eblreginfo.c @@ -0,0 +1,71 @@ +/* Return register name information. + Copyright (C) 2005, 2006 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <inttypes.h> +#include <libeblP.h> + + +ssize_t +ebl_register_info (ebl, regno, name, namelen, prefix, setname, bits, type) + Ebl *ebl; + int regno; + char *name; + size_t namelen; + const char **prefix; + const char **setname; + int *bits; + int *type; +{ + return ebl == NULL ? -1 : ebl->register_info (ebl, regno, name, namelen, + prefix, setname, bits, type); +} diff --git a/libebl/eblrelativerelocp.c b/libebl/eblrelativerelocp.c new file mode 100644 index 00000000..8ea97b88 --- /dev/null +++ b/libebl/eblrelativerelocp.c @@ -0,0 +1,64 @@ +/* Check whether given relocation is a relocation relocation. + Copyright (C) 2006 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2006. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +bool +ebl_relative_reloc_p (ebl, reloc) + Ebl *ebl; + int reloc; +{ + return ebl->relative_reloc_p (reloc); +} diff --git a/libebl/eblrelocsimpletype.c b/libebl/eblrelocsimpletype.c new file mode 100644 index 00000000..87eb5a89 --- /dev/null +++ b/libebl/eblrelocsimpletype.c @@ -0,0 +1,63 @@ +/* Check relocation type for simple types. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +Elf_Type +ebl_reloc_simple_type (ebl, reloc) + Ebl *ebl; + int reloc; +{ + return ebl != NULL ? ebl->reloc_simple_type (ebl, reloc) : ELF_T_NUM; +} diff --git a/libebl/eblreloctypecheck.c b/libebl/eblreloctypecheck.c index cafbc611..576073cb 100644 --- a/libebl/eblreloctypecheck.c +++ b/libebl/eblreloctypecheck.c @@ -1,16 +1,52 @@ /* Check relocation type. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblreloctypename.c b/libebl/eblreloctypename.c index 5fa95608..c715b064 100644 --- a/libebl/eblreloctypename.c +++ b/libebl/eblreloctypename.c @@ -1,16 +1,52 @@ /* Return relocation type name. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblrelocvaliduse.c b/libebl/eblrelocvaliduse.c index 74889861..40f27157 100644 --- a/libebl/eblrelocvaliduse.c +++ b/libebl/eblrelocvaliduse.c @@ -1,16 +1,52 @@ /* Check relocation type use. Copyright (C) 2003 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2003. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblretval.c b/libebl/eblretval.c new file mode 100644 index 00000000..56dc30ff --- /dev/null +++ b/libebl/eblretval.c @@ -0,0 +1,65 @@ +/* Return location expression to find return value given a function type DIE. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <inttypes.h> +#include <libeblP.h> + + +int +ebl_return_value_location (ebl, functypedie, locops) + Ebl *ebl; + Dwarf_Die *functypedie; + const Dwarf_Op **locops; +{ + return ebl == NULL ? -1 : ebl->return_value_location (functypedie, locops); +} diff --git a/libebl/eblsectionname.c b/libebl/eblsectionname.c index 6c801db6..f1c2b56a 100644 --- a/libebl/eblsectionname.c +++ b/libebl/eblsectionname.c @@ -1,16 +1,52 @@ /* Return section name. Copyright (C) 2001, 2002, 2004 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblsectionstripp.c b/libebl/eblsectionstripp.c new file mode 100644 index 00000000..9aa7502c --- /dev/null +++ b/libebl/eblsectionstripp.c @@ -0,0 +1,88 @@ +/* Check whether section can be stripped. + Copyright (C) 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include "libeblP.h" + + +bool +ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr, + const char *name, bool remove_comment, + bool only_remove_debug) +{ + /* If only debug information should be removed check the name. There + is unfortunately no other way. */ + if (unlikely (only_remove_debug)) + { + if (ebl_debugscn_p (ebl, name)) + return true; + + if (shdr->sh_type == SHT_RELA || shdr->sh_type == SHT_REL) + { + Elf_Scn *scn_l = elf_getscn (ebl->elf, (shdr)->sh_info); + GElf_Shdr shdr_mem_l; + GElf_Shdr *shdr_l = gelf_getshdr (scn_l, &shdr_mem_l); + if (shdr_l == NULL) + { + const char *s_l = elf_strptr (ebl->elf, ehdr->e_shstrndx, + shdr_l->sh_name); + if (s_l != NULL && ebl_debugscn_p (ebl, s_l)) + return true; + } + } + + return false; + } + + return SECTION_STRIP_P (shdr, name, remove_comment); +} diff --git a/libebl/eblsectiontypename.c b/libebl/eblsectiontypename.c index e6857acd..a37e5f6d 100644 --- a/libebl/eblsectiontypename.c +++ b/libebl/eblsectiontypename.c @@ -1,16 +1,52 @@ /* Return section type name. - Copyright (C) 2001, 2002 Red Hat, Inc. + Copyright (C) 2001, 2002, 2006, 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -74,29 +110,38 @@ ebl_section_type_name (ebl, section, buf, len) res = sunwtypes[section - SHT_LOSUNW]; } else - { - /* A few GNU additions. */ - if (section == SHT_CHECKSUM) + /* A few GNU additions. */ + switch (section) + { + case SHT_CHECKSUM: res = "CHECKSUM"; - else if (section == SHT_GNU_LIBLIST) + break; + case SHT_GNU_LIBLIST: res = "GNU_LIBLIST"; - /* Handle OS-specific section names. */ - else - { - if (section >= SHT_LOOS && section <= SHT_HIOS) - snprintf (buf, len, "SHT_LOOS+%x", section - SHT_LOOS); - /* Handle processor-specific section names. */ - else if (section >= SHT_LOPROC && section <= SHT_HIPROC) - snprintf (buf, len, "SHT_LOPROC+%x", section - SHT_LOPROC); - else if ((unsigned int) section >= SHT_LOUSER - && (unsigned int) section <= SHT_HIUSER) - snprintf (buf, len, "SHT_LOUSER+%x", section - SHT_LOUSER); - else - snprintf (buf, len, "%s: %d", gettext ("<unknown>"), section); + break; + case SHT_GNU_HASH: + res = "GNU_HASH"; + break; + case SHT_GNU_ATTRIBUTES: + res = "GNU_ATTRIBUTES"; + break; - res = buf; - } - } + default: + /* Handle OS-specific section names. */ + if (section >= SHT_LOOS && section <= SHT_HIOS) + snprintf (buf, len, "SHT_LOOS+%x", section - SHT_LOOS); + /* Handle processor-specific section names. */ + else if (section >= SHT_LOPROC && section <= SHT_HIPROC) + snprintf (buf, len, "SHT_LOPROC+%x", section - SHT_LOPROC); + else if ((unsigned int) section >= SHT_LOUSER + && (unsigned int) section <= SHT_HIUSER) + snprintf (buf, len, "SHT_LOUSER+%x", section - SHT_LOUSER); + else + snprintf (buf, len, "%s: %d", gettext ("<unknown>"), section); + + res = buf; + break; + } } return res; diff --git a/libebl/eblsegmenttypename.c b/libebl/eblsegmenttypename.c index c59f037d..8c4c2952 100644 --- a/libebl/eblsegmenttypename.c +++ b/libebl/eblsegmenttypename.c @@ -1,16 +1,52 @@ /* Return segment type name. Copyright (C) 2001, 2002, 2004 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblshflagscombine.c b/libebl/eblshflagscombine.c index 7edcf4e7..49a65600 100644 --- a/libebl/eblshflagscombine.c +++ b/libebl/eblshflagscombine.c @@ -1,16 +1,52 @@ /* Return combines section header flags value. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblstrtab.c b/libebl/eblstrtab.c index bbf0d6ee..d6ce94ae 100644 --- a/libebl/eblstrtab.c +++ b/libebl/eblstrtab.c @@ -1,16 +1,52 @@ /* ELF string table handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2000. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -73,15 +109,14 @@ static size_t ps; struct Ebl_Strtab * ebl_strtabinit (bool nullstr) { - struct Ebl_Strtab *ret; - if (ps == 0) { ps = sysconf (_SC_PAGESIZE) - 2 * sizeof (void *); assert (sizeof (struct memoryblock) < ps); } - ret = (struct Ebl_Strtab *) calloc (1, sizeof (struct Ebl_Strtab)); + struct Ebl_Strtab *ret + = (struct Ebl_Strtab *) calloc (1, sizeof (struct Ebl_Strtab)); if (ret != NULL) { ret->nullstr = nullstr; @@ -100,11 +135,10 @@ ebl_strtabinit (bool nullstr) static int morememory (struct Ebl_Strtab *st, size_t len) { - struct memoryblock *newmem; - if (len < ps) len = ps; - newmem = (struct memoryblock *) malloc (len); + + struct memoryblock *newmem = (struct memoryblock *) malloc (len); if (newmem == NULL) return 1; @@ -136,15 +170,11 @@ ebl_strtabfree (struct Ebl_Strtab *st) static struct Ebl_Strent * newstring (struct Ebl_Strtab *st, const char *str, size_t len) { - struct Ebl_Strent *newstr; - size_t align; - int i; - /* Compute the amount of padding needed to make the structure aligned. */ - align = ((__alignof__ (struct Ebl_Strent) - - (((uintptr_t) st->backp) - & (__alignof__ (struct Ebl_Strent) - 1))) - & (__alignof__ (struct Ebl_Strent) - 1)); + size_t align = ((__alignof__ (struct Ebl_Strent) + - (((uintptr_t) st->backp) + & (__alignof__ (struct Ebl_Strent) - 1))) + & (__alignof__ (struct Ebl_Strent) - 1)); /* Make sure there is enough room in the memory block. */ if (st->left < align + sizeof (struct Ebl_Strent) + len) @@ -156,14 +186,14 @@ newstring (struct Ebl_Strtab *st, const char *str, size_t len) } /* Create the reserved string. */ - newstr = (struct Ebl_Strent *) (st->backp + align); + struct Ebl_Strent *newstr = (struct Ebl_Strent *) (st->backp + align); newstr->string = str; newstr->len = len; newstr->next = NULL; newstr->left = NULL; newstr->right = NULL; newstr->offset = 0; - for (i = len - 2; i >= 0; --i) + for (int i = len - 2; i >= 0; --i) newstr->reverse[i] = str[len - 2 - i]; newstr->reverse[len - 1] = '\0'; st->backp += align + sizeof (struct Ebl_Strent) + len; @@ -179,8 +209,6 @@ newstring (struct Ebl_Strtab *st, const char *str, size_t len) static struct Ebl_Strent ** searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) { - int cmpres; - /* More strings? */ if (*sep == NULL) { @@ -189,8 +217,8 @@ searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) } /* Compare the strings. */ - cmpres = memcmp ((*sep)->reverse, newstr->reverse, - MIN ((*sep)->len, newstr->len) - 1); + int cmpres = memcmp ((*sep)->reverse, newstr->reverse, + MIN ((*sep)->len, newstr->len) - 1); if (cmpres == 0) /* We found a matching string. */ return sep; @@ -205,9 +233,6 @@ searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) struct Ebl_Strent * ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len) { - struct Ebl_Strent *newstr; - struct Ebl_Strent **sep; - /* Compute the string length if the caller doesn't know it. */ if (len == 0) len = strlen (str) + 1; @@ -218,23 +243,22 @@ ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len) return &st->null; /* Allocate memory for the new string and its associated information. */ - newstr = newstring (st, str, len); + struct Ebl_Strent *newstr = newstring (st, str, len); if (newstr == NULL) return NULL; /* Search in the array for the place to insert the string. If there is no string with matching prefix and no string with matching leading substring, create a new entry. */ - sep = searchstring (&st->root, newstr); + struct Ebl_Strent **sep = searchstring (&st->root, newstr); if (*sep != newstr) { /* This is not the same entry. This means we have a prefix match. */ if ((*sep)->len > newstr->len) { - struct Ebl_Strent *subs; - /* Check whether we already know this string. */ - for (subs = (*sep)->next; subs != NULL; subs = subs->next) + for (struct Ebl_Strent *subs = (*sep)->next; subs != NULL; + subs = subs->next) if (subs->len == newstr->len) { /* We have an exact match with a substring. Free the memory @@ -283,8 +307,6 @@ ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len) static void copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp) { - struct Ebl_Strent *subs; - if (nodep->left != NULL) copystrings (nodep->left, freep, offsetp); @@ -293,7 +315,7 @@ copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp) *freep = (char *) mempcpy (*freep, nodep->string, nodep->len); *offsetp += nodep->len; - for (subs = nodep->next; subs != NULL; subs = subs->next) + for (struct Ebl_Strent *subs = nodep->next; subs != NULL; subs = subs->next) { assert (subs->len < nodep->len); subs->offset = nodep->offset + nodep->len - subs->len; @@ -308,8 +330,6 @@ copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp) void ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data) { - size_t copylen; - char *endp; size_t nulllen = st->nullstr ? 1 : 0; /* Fill in the information. */ @@ -330,8 +350,8 @@ ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data) /* Now run through the tree and add all the string while also updating the offset members of the elfstrent records. */ - endp = (char *) data->d_buf + nulllen; - copylen = nulllen; + char *endp = (char *) data->d_buf + nulllen; + size_t copylen = nulllen; copystrings (st->root, &endp, ©len); assert (copylen == st->total + nulllen); } diff --git a/libebl/eblsymbolbindingname.c b/libebl/eblsymbolbindingname.c index efcd250e..c4412c9e 100644 --- a/libebl/eblsymbolbindingname.c +++ b/libebl/eblsymbolbindingname.c @@ -1,16 +1,52 @@ /* Return symbol binding name. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblsymboltypename.c b/libebl/eblsymboltypename.c index d11aec1a..c7cb2cba 100644 --- a/libebl/eblsymboltypename.c +++ b/libebl/eblsymboltypename.c @@ -1,16 +1,52 @@ /* Return symbol type name. Copyright (C) 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/eblsysvhashentrysize.c b/libebl/eblsysvhashentrysize.c new file mode 100644 index 00000000..341979c1 --- /dev/null +++ b/libebl/eblsysvhashentrysize.c @@ -0,0 +1,63 @@ +/* Return OS ABI name + Copyright (C) 2006 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper <drepper@redhat.com>, 2006. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +int +ebl_sysvhash_entrysize (ebl) + Ebl *ebl; +{ + return ebl->sysvhash_entrysize; +} diff --git a/libebl/eblwstrtab.c b/libebl/eblwstrtab.c index 8320cb58..f29c0c7a 100644 --- a/libebl/eblwstrtab.c +++ b/libebl/eblwstrtab.c @@ -1,16 +1,52 @@ /* ELF string table handling. Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2000. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/libebl/i386_corenote.c b/libebl/i386_corenote.c deleted file mode 100644 index 482f81d7..00000000 --- a/libebl/i386_corenote.c +++ /dev/null @@ -1,149 +0,0 @@ -/* i386 specific core note handling. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> -#include <stdio.h> -#include <sys/time.h> - -#include <libebl_i386.h> - - -/* We cannot include <sys/procfs.h> since it is available only on x86 - systems. */ -struct elf_prstatus - { - struct - { - int si_signo; /* Signal number. */ - int si_code; /* Extra code. */ - int si_errno; /* Errno. */ - } pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ - unsigned long int pr_sigpend; /* Set of pending signals. */ - unsigned long int pr_sighold; /* Set of held signals. */ - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct timeval pr_utime; /* User time. */ - struct timeval pr_stime; /* System time. */ - struct timeval pr_cutime; /* Cumulative user time. */ - struct timeval pr_cstime; /* Cumulative system time. */ - unsigned long int pr_reg[17]; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - - -struct elf_prpsinfo - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - unsigned long int pr_flag; /* Flags. */ - unsigned short int pr_uid; - unsigned short int pr_gid; - int pr_pid; - int pr_ppid; - int pr_pgrp; - int pr_sid; - /* Lots missing */ - char pr_fname[16]; /* Filename of executable. */ - char pr_psargs[80]; /* Initial part of arg list. */ - }; - - -bool -i386_core_note (name, type, descsz, desc) - const char *name; - uint32_t type; - uint32_t descsz; - const char *desc; -{ - bool result = false; - - switch (type) - { - case NT_PRSTATUS: - if (descsz < sizeof (struct elf_prstatus)) - /* Not enough data. */ - break; - - struct elf_prstatus *stat = (struct elf_prstatus *) desc; - - printf (" SIGINFO: signo: %d, code = %d, errno = %d\n" - " signal: %hd, pending: %#08lx, holding: %#08lx\n" - " pid: %d, ppid = %d, pgrp = %d, sid = %d\n" - " utime: %6ld.%06lds, stime: %6ld.%06lds\n" - " cutime: %6ld.%06lds, cstime: %6ld.%06lds\n" - " eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n" - " esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n" - " eip: %08lx eflags: %08lx, original eax: %08lx\n" - " cs: %04lx ds: %04lx es: %04lx fs: %04lx gs: %04lx" - " ss: %04lx\n\n" -, - stat->pr_info. si_signo, - stat->pr_info. si_code, - stat->pr_info. si_errno, - stat->pr_cursig, - stat->pr_sigpend, stat->pr_sighold, - stat->pr_pid, stat->pr_ppid, stat->pr_pgrp, stat->pr_sid, - stat->pr_utime.tv_sec, (long int) stat->pr_utime.tv_usec, - stat->pr_stime.tv_sec, (long int) stat->pr_stime.tv_usec, - stat->pr_cutime.tv_sec, (long int) stat->pr_cutime.tv_usec, - stat->pr_cstime.tv_sec, (long int) stat->pr_cstime.tv_usec, - stat->pr_reg[6], stat->pr_reg[0], stat->pr_reg[1], - stat->pr_reg[2], stat->pr_reg[3], stat->pr_reg[4], - stat->pr_reg[5], stat->pr_reg[15], stat->pr_reg[12], - stat->pr_reg[14], stat->pr_reg[11], stat->pr_reg[13] & 0xffff, - stat->pr_reg[7] & 0xffff, stat->pr_reg[8] & 0xffff, - stat->pr_reg[9] & 0xffff, stat->pr_reg[10] & 0xffff, - stat->pr_reg[16]); - - /* We handled this entry. */ - result = true; - break; - - case NT_PRPSINFO: - if (descsz < sizeof (struct elf_prpsinfo)) - /* Not enough data. */ - break; - - struct elf_prpsinfo *info = (struct elf_prpsinfo *) desc; - - printf (" state: %c (%hhd), zombie: %hhd, nice: %hhd\n" - " flags: %08lx, uid: %hd, gid: %hd\n" - " pid: %d, ppid: %d, pgrp: %d, sid: %d\n" - " fname: %.16s\n" - " args: %.80s\n\n", - info->pr_sname, info->pr_state, info->pr_zomb, info->pr_nice, - info->pr_flag, info->pr_uid, info->pr_gid, - info->pr_pid, info->pr_ppid, info->pr_pgrp, info->pr_sid, - info->pr_fname, info->pr_psargs); - - /* We handled this entry. */ - result = true; - break; - - default: - break; - } - - return result; -} diff --git a/libebl/i386_destr.c b/libebl/i386_destr.c deleted file mode 100644 index 23609496..00000000 --- a/libebl/i386_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for i386 specific backend library. - Copyright (C) 2000, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_i386.h> - - -void -i386_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/i386_init.c b/libebl/i386_init.c deleted file mode 100644 index b53c57da..00000000 --- a/libebl/i386_init.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Initialization of i386 specific backend library. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_i386.h> - - -int -i386_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "Intel 80386"; - eh->reloc_type_name = i386_reloc_type_name; - eh->reloc_type_check = i386_reloc_type_check; - eh->reloc_valid_use = i386_reloc_valid_use; - eh->gotpc_reloc_check = i386_gotpc_reloc_check; - eh->core_note = i386_core_note; - eh->destr = i386_destr; - - return 0; -} diff --git a/libebl/i386_symbol.c b/libebl/i386_symbol.c deleted file mode 100644 index fc70e506..00000000 --- a/libebl/i386_symbol.c +++ /dev/null @@ -1,127 +0,0 @@ -/* i386 specific symbolic name handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <assert.h> -#include <elf.h> -#include <stddef.h> - -#include <libebl_i386.h> - - -/* Return of the backend. */ -const char * -i386_backend_name (void) -{ - return "i386"; -} - - -/* Relocation mapping table. */ -static struct -{ - const char *name; - enum { both = 0, rel = 1, exec = 2 } appear; -} reloc_map_table[] = - { - [R_386_NONE] = { "R_386_NONE", both }, - [R_386_32] = { "R_386_32", both }, - [R_386_PC32] = { "R_386_PC32", rel }, - [R_386_GOT32] = { "R_386_GOT32", rel }, - [R_386_PLT32] = { "R_386_PLT32", rel }, - [R_386_COPY] = { "R_386_COPY", exec }, - [R_386_GLOB_DAT] = { "R_386_GLOB_DAT", exec }, - [R_386_JMP_SLOT] = { "R_386_JMP_SLOT", exec }, - [R_386_RELATIVE] = { "R_386_RELATIVE", exec }, - [R_386_GOTOFF] = { "R_386_GOTOFF", rel }, - [R_386_GOTPC] = { "R_386_GOTPC", rel }, - [R_386_32PLT] = { "R_386_32PLT", rel }, - [R_386_TLS_TPOFF] = { "R_386_TLS_TPOFF", rel }, - [R_386_TLS_IE] = { "R_386_TLS_IE", rel }, - [R_386_TLS_GOTIE] = { "R_386_TLS_GOTIE", rel }, - [R_386_TLS_LE] = { "R_386_TLS_LE", rel }, - [R_386_TLS_GD] = { "R_386_TLS_GD", rel }, - [R_386_TLS_LDM] = { "R_386_TLS_LDM", rel }, - [R_386_16] = { "R_386_16", rel }, - [R_386_PC16] = { "R_386_PC16", rel }, - [R_386_8] = { "R_386_8", rel }, - [R_386_PC8] = { "R_386_PC8", rel }, - [R_386_TLS_GD_32] = { "R_386_TLS_GD_32", rel }, - [R_386_TLS_GD_PUSH] = { "R_386_TLS_GD_PUSH", rel }, - [R_386_TLS_GD_CALL] = { "R_386_TLS_GD_CALL", rel }, - [R_386_TLS_GD_POP] = { "R_386_TLS_GD_POP", rel }, - [R_386_TLS_LDM_32] = { "R_386_TLS_LDM_32", rel }, - [R_386_TLS_LDM_PUSH] = { "R_386_TLS_LDM_PUSH", rel }, - [R_386_TLS_LDM_CALL] = { "R_386_TLS_LDM_CALL", rel }, - [R_386_TLS_LDM_POP] = { "R_386_TLS_LDM_POP", rel }, - [R_386_TLS_LDO_32] = { "R_386_TLS_LDO_32", rel }, - [R_386_TLS_IE_32] = { "R_386_TLS_IE_32", rel }, - [R_386_TLS_LE_32] = { "R_386_TLS_LE_32", rel }, - [R_386_TLS_DTPMOD32] = { "R_386_TLS_DTPMOD32", rel }, - [R_386_TLS_DTPOFF32] = { "R_386_TLS_DTPOFF32", rel }, - [R_386_TLS_TPOFF32] = { "R_386_TLS_TPOFF32", rel } - }; - - -/* Determine relocation type string for x86. */ -const char * -i386_reloc_type_name (int type, char *buf, size_t len) -{ - if (type < 0 || type >= R_386_NUM) - return NULL; - - return reloc_map_table[type].name; -} - - -/* Check for correct relocation type. */ -bool -i386_reloc_type_check (int type) -{ - return (type >= R_386_NONE && type < R_386_NUM - && reloc_map_table[type].name != NULL) ? true : false; -} - - -/* Check for correct relocation type use. */ -bool -i386_reloc_valid_use (Elf *elf, int type) -{ - if (type < R_386_NONE || type >= R_386_NUM - || reloc_map_table[type].name == NULL) - return false; - - Elf32_Ehdr *ehdr = elf32_getehdr (elf); - assert (ehdr != NULL); - - if (reloc_map_table[type].appear == rel) - return ehdr->e_type == ET_REL; - - if (reloc_map_table[type].appear == exec) - return ehdr->e_type != ET_REL; - - assert (reloc_map_table[type].appear == both); - return true; -} - - -/* Return true if the symbol type is that referencing the GOT. */ -bool -i386_gotpc_reloc_check (Elf *elf, int type) -{ - return type == R_386_GOTPC; -} diff --git a/libebl/ia64_destr.c b/libebl/ia64_destr.c deleted file mode 100644 index a48302c8..00000000 --- a/libebl/ia64_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for IA-64 specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_ia64.h> - - -void -ia64_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/ia64_init.c b/libebl/ia64_init.c deleted file mode 100644 index 30925acb..00000000 --- a/libebl/ia64_init.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Initialization of IA-64 specific backend library. - Copyright (C) 2002, 2003 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_ia64.h> - - -int -ia64_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "Intel IA-64"; - eh->reloc_type_name = ia64_reloc_type_name; - eh->reloc_type_check = ia64_reloc_type_check; - eh->segment_type_name = ia64_segment_type_name; - eh->dynamic_tag_name = ia64_dynamic_tag_name; - eh->destr = ia64_destr; - - return 0; -} diff --git a/libebl/ia64_symbol.c b/libebl/ia64_symbol.c deleted file mode 100644 index fe4c7b71..00000000 --- a/libebl/ia64_symbol.c +++ /dev/null @@ -1,177 +0,0 @@ -/* IA-64 specific symbolic name handling. - Copyright (C) 2002, 2003 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> - -#include <libebl_ia64.h> - - -/* Return of the backend. */ -const char * -ia64_backend_name (void) -{ - return "ia64"; -} - - -/* Relocation mapping table. */ -static const char *reloc_map_table[] = - { - [R_IA64_NONE] = "R_IA64_NONE", - [R_IA64_IMM14] = "R_IA64_IMM14", - [R_IA64_IMM22] = "R_IA64_IMM22", - [R_IA64_IMM64] = "R_IA64_IMM64", - [R_IA64_DIR32MSB] = "R_IA64_DIR32MSB", - [R_IA64_DIR32LSB] = "R_IA64_DIR32LSB", - [R_IA64_DIR64MSB] = "R_IA64_DIR64MSB", - [R_IA64_DIR64LSB] = "R_IA64_DIR64LSB", - [R_IA64_GPREL22] = "R_IA64_GPREL22", - [R_IA64_GPREL64I] = "R_IA64_GPREL64I", - [R_IA64_GPREL32MSB] = "R_IA64_GPREL32MSB", - [R_IA64_GPREL32LSB] = "R_IA64_GPREL32LSB", - [R_IA64_GPREL64MSB] = "R_IA64_GPREL64MSB", - [R_IA64_GPREL64LSB] = "R_IA64_GPREL64LSB", - [R_IA64_LTOFF22] = "R_IA64_LTOFF22", - [R_IA64_LTOFF64I] = "R_IA64_LTOFF64I", - [R_IA64_PLTOFF22] = "R_IA64_PLTOFF22", - [R_IA64_PLTOFF64I] = "R_IA64_PLTOFF64I", - [R_IA64_PLTOFF64MSB] = "R_IA64_PLTOFF64MSB", - [R_IA64_PLTOFF64LSB] = "R_IA64_PLTOFF64LSB", - [R_IA64_FPTR64I] = "R_IA64_FPTR64I", - [R_IA64_FPTR32MSB] = "R_IA64_FPTR32MSB", - [R_IA64_FPTR32LSB] = "R_IA64_FPTR32LSB", - [R_IA64_FPTR64MSB] = "R_IA64_FPTR64MSB", - [R_IA64_FPTR64LSB] = "R_IA64_FPTR64LSB", - [R_IA64_PCREL60B] = "R_IA64_PCREL60B", - [R_IA64_PCREL21B] = "R_IA64_PCREL21B", - [R_IA64_PCREL21M] = "R_IA64_PCREL21M", - [R_IA64_PCREL21F] = "R_IA64_PCREL21F", - [R_IA64_PCREL32MSB] = "R_IA64_PCREL32MSB", - [R_IA64_PCREL32LSB] = "R_IA64_PCREL32LSB", - [R_IA64_PCREL64MSB] = "R_IA64_PCREL64MSB", - [R_IA64_PCREL64LSB] = "R_IA64_PCREL64LSB", - [R_IA64_LTOFF_FPTR22] = "R_IA64_LTOFF_FPTR22", - [R_IA64_LTOFF_FPTR64I] = "R_IA64_LTOFF_FPTR64I", - [R_IA64_LTOFF_FPTR32MSB] = "R_IA64_LTOFF_FPTR32MSB", - [R_IA64_LTOFF_FPTR32LSB] = "R_IA64_LTOFF_FPTR32LSB", - [R_IA64_LTOFF_FPTR64MSB] = "R_IA64_LTOFF_FPTR64MSB", - [R_IA64_LTOFF_FPTR64LSB] = "R_IA64_LTOFF_FPTR64LSB", - [R_IA64_SEGREL32MSB] = "R_IA64_SEGREL32MSB", - [R_IA64_SEGREL32LSB] = "R_IA64_SEGREL32LSB", - [R_IA64_SEGREL64MSB] = "R_IA64_SEGREL64MSB", - [R_IA64_SEGREL64LSB] = "R_IA64_SEGREL64LSB", - [R_IA64_SECREL32MSB] = "R_IA64_SECREL32MSB", - [R_IA64_SECREL32LSB] = "R_IA64_SECREL32LSB", - [R_IA64_SECREL64MSB] = "R_IA64_SECREL64MSB", - [R_IA64_SECREL64LSB] = "R_IA64_SECREL64LSB", - [R_IA64_REL32MSB] = "R_IA64_REL32MSB", - [R_IA64_REL32LSB] = "R_IA64_REL32LSB", - [R_IA64_REL64MSB] = "R_IA64_REL64MSB", - [R_IA64_REL64LSB] = "R_IA64_REL64LSB", - [R_IA64_LTV32MSB] = "R_IA64_LTV32MSB", - [R_IA64_LTV32LSB] = "R_IA64_LTV32LSB", - [R_IA64_LTV64MSB] = "R_IA64_LTV64MSB", - [R_IA64_LTV64LSB] = "R_IA64_LTV64LSB", - [R_IA64_PCREL21BI] = "R_IA64_PCREL21BI", - [R_IA64_PCREL22] = "R_IA64_PCREL22", - [R_IA64_PCREL64I] = "R_IA64_PCREL64I", - [R_IA64_IPLTMSB] = "R_IA64_IPLTMSB", - [R_IA64_IPLTLSB] = "R_IA64_IPLTLSB", - [R_IA64_COPY] = "R_IA64_COPY", - [R_IA64_SUB] = "R_IA64_SUB", - [R_IA64_LTOFF22X] = "R_IA64_LTOFF22X", - [R_IA64_LDXMOV] = "R_IA64_LDXMOV", - [R_IA64_TPREL14] = "R_IA64_TPREL14", - [R_IA64_TPREL22] = "R_IA64_TPREL22", - [R_IA64_TPREL64I] = "R_IA64_TPREL64I", - [R_IA64_TPREL64MSB] = "R_IA64_TPREL64MSB", - [R_IA64_TPREL64LSB] = "R_IA64_TPREL64LSB", - [R_IA64_LTOFF_TPREL22] = "R_IA64_LTOFF_TPREL22", - [R_IA64_DTPMOD64MSB] = "R_IA64_DTPMOD64MSB", - [R_IA64_DTPMOD64LSB] = "R_IA64_DTPMOD64LSB", - [R_IA64_LTOFF_DTPMOD22] = "R_IA64_LTOFF_DTPMOD22", - [R_IA64_DTPREL14] = "R_IA64_DTPREL14", - [R_IA64_DTPREL22] = "R_IA64_DTPREL22", - [R_IA64_DTPREL64I] = "R_IA64_DTPREL64I", - [R_IA64_DTPREL32MSB] = "R_IA64_DTPREL32MSB", - [R_IA64_DTPREL32LSB] = "R_IA64_DTPREL32LSB", - [R_IA64_DTPREL64MSB] = "R_IA64_DTPREL64MSB", - [R_IA64_DTPREL64LSB] = "R_IA64_DTPREL64LSB", - [R_IA64_LTOFF_DTPREL22] = "R_IA64_LTOFF_DTPREL22" - }; - - -/* Determine relocation type string for IA-64. */ -const char * -ia64_reloc_type_name (int type, char *buf, size_t len) -{ - if (type < 0 - || ((size_t) type - >= sizeof (reloc_map_table) / sizeof (reloc_map_table[0]))) - return NULL; - - return reloc_map_table[type]; -} - - -/* Check for correct relocation type. */ -bool -ia64_reloc_type_check (int type) -{ - return (type >= R_IA64_NONE - && ((size_t) type - < sizeof (reloc_map_table) / sizeof (reloc_map_table[0])) - && reloc_map_table[type] != NULL) ? true : false; -} - - -const char * -ia64_segment_type_name (int segment, char *buf, size_t len) -{ - switch (segment) - { - case PT_IA_64_ARCHEXT: - return "IA_64_ARCHEXT"; - case PT_IA_64_UNWIND: - return "IA_64_UNWIND"; - case PT_IA_64_HP_OPT_ANOT: - return "IA_64_HP_OPT_ANOT"; - case PT_IA_64_HP_HSL_ANOT: - return "IA_64_HP_HSL_ANOT"; - case PT_IA_64_HP_STACK: - return "IA_64_HP_STACK"; - default: - break; - } - return NULL; -} - - -const char * -ia64_dynamic_tag_name (int64_t tag, char *buf, size_t len) -{ - switch (tag) - { - case DT_IA_64_PLT_RESERVE: - return "IA_64_PLT_RESERVE"; - default: - break; - } - return NULL; -} diff --git a/libebl/libebl.h b/libebl/libebl.h index 392350ac..50258690 100644 --- a/libebl/libebl.h +++ b/libebl/libebl.h @@ -1,109 +1,71 @@ /* Interface for libebl. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifndef _LIBEBL_H #define _LIBEBL_H 1 #include <gelf.h> +#include "libdw.h" #include <stdbool.h> #include <stddef.h> #include <stdint.h> -#include <elf-knowledge.h> - - -/* Backend handle. */ -typedef struct ebl -{ - /* Machine name. */ - const char *name; - - /* Emulation name. */ - const char *emulation; - - /* The libelf handle (if known). */ - Elf *elf; - - /* Return symbol representaton of object file type. */ - const char *(*object_type_name) (int, char *, size_t); - - /* Return symbolic representation of relocation type. */ - const char *(*reloc_type_name) (int, char *, size_t); - - /* Check relocation type. */ - bool (*reloc_type_check) (int); - - /* Check relocation type use. */ - bool (*reloc_valid_use) (Elf *, int); - - /* Return true if the symbol type is that referencing the GOT. */ - bool (*gotpc_reloc_check) (Elf *, int); - - /* Return symbolic representation of segment type. */ - const char *(*segment_type_name) (int, char *, size_t); - - /* Return symbolic representation of section type. */ - const char *(*section_type_name) (int, char *, size_t); - - /* Return section name. */ - const char *(*section_name) (int, int, char *, size_t); - - /* Return next machine flag name. */ - const char *(*machine_flag_name) (GElf_Word *); - - /* Check whether machine flags are valid. */ - bool (*machine_flag_check) (GElf_Word); - - /* Return symbolic representation of symbol type. */ - const char *(*symbol_type_name) (int, char *, size_t); - - /* Return symbolic representation of symbol binding. */ - const char *(*symbol_binding_name) (int, char *, size_t); - - /* Return symbolic representation of dynamic tag. */ - const char *(*dynamic_tag_name) (int64_t, char *, size_t); - - /* Check dynamic tag. */ - bool (*dynamic_tag_check) (int64_t); - - /* Combine section header flags values. */ - GElf_Word (*sh_flags_combine) (GElf_Word, GElf_Word); +#include "elf-knowledge.h" - /* Return symbolic representation of OS ABI. */ - const char *(*osabi_name) (int, char *, size_t); - /* Name of a note entry type for core files. */ - const char *(*core_note_type_name) (uint32_t, char *, size_t); +/* Opaque type for the handle. */ +typedef struct ebl Ebl; - /* Name of a note entry type for object files. */ - const char *(*object_note_type_name) (uint32_t, char *, size_t); - - /* Handle core note. */ - bool (*core_note) (const char *, uint32_t, uint32_t, const char *); - - /* Handle object file note. */ - bool (*object_note) (const char *, uint32_t, uint32_t, const char *); - - /* Check section name for being that of a debug informatino section. */ - bool (*debugscn_p) (const char *); - - /* Destructor for ELF backend handle. */ - void (*destr) (struct ebl *); - - /* Internal data. */ - void *dlhandle; -} Ebl; +#ifdef __cplusplus +extern "C" { +#endif /* Get backend handle for object associated with ELF handle. */ extern Ebl *ebl_openbackend (Elf *elf); @@ -116,6 +78,18 @@ extern Ebl *ebl_openbackend_emulation (const char *emulation); extern void ebl_closebackend (Ebl *bh); +/* Information about the descriptor. */ + +/* Get ELF machine. */ +extern int ebl_get_elfmachine (Ebl *ebl) __attribute__ ((__pure__)); + +/* Get ELF class. */ +extern int ebl_get_elfclass (Ebl *ebl) __attribute__ ((__pure__)); + +/* Get ELF data encoding. */ +extern int ebl_get_elfdata (Ebl *ebl) __attribute__ ((__pure__)); + + /* Function to call the callback functions including default ELF handling. */ @@ -136,6 +110,10 @@ extern bool ebl_reloc_type_check (Ebl *ebl, int reloc); /* Check relocation type use. */ extern bool ebl_reloc_valid_use (Ebl *ebl, int reloc); +/* Check if relocation type is for simple absolute relocations. + Return ELF_T_{BYTE,HALF,SWORD,SXWORD} for a simple type, else ELF_T_NUM. */ +extern Elf_Type ebl_reloc_simple_type (Ebl *ebl, int reloc); + /* Return true if the symbol type is that referencing the GOT. E.g., R_386_GOTPC. */ extern bool ebl_gotpc_reloc_check (Ebl *ebl, int reloc); @@ -160,6 +138,15 @@ extern const char *ebl_machine_flag_name (Ebl *ebl, GElf_Word flags, /* Check whether machine flag is valid. */ extern bool ebl_machine_flag_check (Ebl *ebl, GElf_Word flags); +/* Check whether SHF_MASKPROC flags are valid. */ +extern bool ebl_machine_section_flag_check (Ebl *ebl, GElf_Xword flags); + +/* Check whether the section with the given index, header, and name + is a special machine section that is valid despite a combination + of flags or other details that are not generically valid. */ +extern bool ebl_check_special_section (Ebl *ebl, int ndx, + const GElf_Shdr *shdr, const char *name); + /* Return symbol type name. */ extern const char *ebl_symbol_type_name (Ebl *ebl, int symbol, char *buf, size_t len); @@ -175,6 +162,12 @@ extern const char *ebl_dynamic_tag_name (Ebl *ebl, int64_t tag, /* Check dynamic tag. */ extern bool ebl_dynamic_tag_check (Ebl *ebl, int64_t tag); +/* Check whether given symbol's st_value and st_size are OK despite failing + normal checks. */ +extern bool ebl_check_special_symbol (Ebl *ebl, GElf_Ehdr *ehdr, + const GElf_Sym *sym, const char *name, + const GElf_Shdr *destshdr); + /* Return combined section header flags value. */ extern GElf_Word ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2); @@ -191,17 +184,77 @@ extern const char *ebl_core_note_type_name (Ebl *ebl, uint32_t type, char *buf, extern const char *ebl_object_note_type_name (Ebl *ebl, uint32_t type, char *buf, size_t len); -/* Print information about core note if available. */ -extern void ebl_core_note (Ebl *ebl, const char *name, uint32_t type, - uint32_t descsz, const char *desc); - /* Print information about object note if available. */ extern void ebl_object_note (Ebl *ebl, const char *name, uint32_t type, uint32_t descsz, const char *desc); +/* Check whether an attribute in a .gnu_attributes section is recognized. + Fills in *TAG_NAME with the name for this tag. + If VALUE is a known value for that tag, also fills in *VALUE_NAME. */ +extern bool ebl_check_object_attribute (Ebl *ebl, const char *vendor, + int tag, uint64_t value, + const char **tag_name, + const char **value_name); + + /* Check section name for being that of a debug informatino section. */ extern bool ebl_debugscn_p (Ebl *ebl, const char *name); +/* Check whether given relocation is a copy relocation. */ +extern bool ebl_copy_reloc_p (Ebl *ebl, int reloc); + +/* Check whether given relocation is a no-op relocation. */ +extern bool ebl_none_reloc_p (Ebl *ebl, int reloc); + +/* Check whether given relocation is a relative relocation. */ +extern bool ebl_relative_reloc_p (Ebl *ebl, int reloc); + +/* Check whether section should be stripped. */ +extern bool ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, + const GElf_Shdr *shdr, const char *name, + bool remove_comment, bool only_remove_debug); + +/* Check if backend uses a bss PLT in this file. */ +extern bool ebl_bss_plt_p (Ebl *ebl, GElf_Ehdr *ehdr); + +/* Return size of entry in SysV-style hash table. */ +extern int ebl_sysvhash_entrysize (Ebl *ebl); + +/* Return location expression to find return value given a + DW_TAG_subprogram, DW_TAG_subroutine_type, or similar DIE describing + function itself (whose DW_AT_type attribute describes its return type). + Returns -1 for a libdw error (see dwarf_errno). + Returns -2 for an unrecognized type formation. + Returns zero if the function has no return value (e.g. "void" in C). + Otherwise, *LOCOPS gets a location expression to find the return value, + and returns the number of operations in the expression. The pointer is + permanently allocated at least as long as the Ebl handle is open. */ +extern int ebl_return_value_location (Ebl *ebl, + Dwarf_Die *functypedie, + const Dwarf_Op **locops); + +/* Fill in register information given DWARF register numbers. + If NAME is null, return the maximum REGNO + 1 that has a name. + Otherwise, store in NAME the name for DWARF register number REGNO + and return the number of bytes written (including '\0' terminator). + Return -1 if NAMELEN is too short or REGNO is negative or too large. + Return 0 if REGNO is unused (a gap in the DWARF number assignment). + On success, set *SETNAME to a description like "integer" or "FPU" + fit for "%s registers" title display, and *PREFIX to the string + that precedes NAME in canonical assembler syntax (e.g. "%" or "$"). + The NAME string contains identifier characters only (maybe just digits). */ +extern ssize_t ebl_register_info (Ebl *ebl, + int regno, char *name, size_t namelen, + const char **prefix, const char **setname, + int *bits, int *type); + +/* Fill in the DWARF register numbers for the registers used in system calls. + The SP and PC are what kernel reports call the user stack pointer and PC. + The CALLNO and ARGS are the system call number and incoming arguments. + Each of these is filled with the DWARF register number corresponding, + or -1 if there is none. Returns zero when the information is available. */ +extern int ebl_syscall_abi (Ebl *ebl, int *sp, int *pc, + int *callno, int args[6]); /* ELF string table handling. */ struct Ebl_Strtab; @@ -271,4 +324,45 @@ extern void ebl_gstrtabfinalize (struct Ebl_GStrtab *st, Elf_Data *data); /* Get offset in wide char string table for string associated with SE. */ extern size_t ebl_gstrtaboffset (struct Ebl_GStrent *se); + +/* Register map info. */ +typedef struct +{ + Dwarf_Half offset; /* Byte offset in register data block. */ + Dwarf_Half regno; /* DWARF register number. */ + uint8_t bits; /* Bits of data for one register. */ + uint8_t pad; /* Bytes of padding after register's data. */ + Dwarf_Half count; /* Consecutive register numbers here. */ +} Ebl_Register_Location; + +/* Non-register data items in core notes. */ +typedef struct +{ + const char *name; /* Printable identifier. */ + const char *group; /* Identifier for category of related items. */ + Dwarf_Half offset; /* Byte offset in note data. */ + Dwarf_Half count; + Elf_Type type; + char format; + bool thread_identifier; +} Ebl_Core_Item; + +/* Describe the format of a core file note with type field matching N_TYPE + and descriptor size matching DESCSZ. */ +extern int ebl_core_note (Ebl *ebl, GElf_Word n_type, GElf_Word descsz, + GElf_Word *regs_offset, size_t *nregloc, + const Ebl_Register_Location **reglocs, + size_t *nitems, const Ebl_Core_Item **items) + __nonnull_attribute__ (1, 4, 5, 6, 7, 8); + +/* Describe the auxv type number. */ +extern int ebl_auxv_info (Ebl *ebl, GElf_Xword a_type, + const char **name, const char **format) + __nonnull_attribute__ (1, 3, 4); + + +#ifdef __cplusplus +} +#endif + #endif /* libebl.h */ diff --git a/libebl/libeblP.h b/libebl/libeblP.h index 55ace24d..f765291e 100644 --- a/libebl/libeblP.h +++ b/libebl/libeblP.h @@ -1,29 +1,96 @@ /* Internal definitions for interface for libebl. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006 Red Hat, Inc. + This file is part of Red Hat elfutils. - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + In addition, as a special exception, Red Hat, Inc. gives You the + additional right to link the code of Red Hat elfutils with code licensed + under any Open Source Initiative certified open source license + (http://www.opensource.org/licenses/index.php) which requires the + distribution of source code with any binary distribution and to + distribute linked combinations of the two. Non-GPL Code permitted under + this exception must only link to the code of Red Hat elfutils through + those well defined interfaces identified in the file named EXCEPTION + found in the source code files (the "Approved Interfaces"). The files + of Non-GPL Code may instantiate templates or use macros or inline + functions from the Approved Interfaces without causing the resulting + work to be covered by the GNU General Public License. Only Red Hat, + Inc. may make changes or additions to the list of Approved Interfaces. + Red Hat's grant of this exception is conditioned upon your not adding + any new exceptions. If you wish to add a new Approved Interface or + exception, please contact Red Hat. You must obey the GNU General Public + License in all respects for all of the Red Hat elfutils code and other + code used in conjunction with Red Hat elfutils except the Non-GPL Code + covered by this exception. If you modify this file, you may extend this + exception to your version of the file, but you are not obligated to do + so. If you do not wish to provide this exception without modification, + you must delete this exception statement from your version and license + this file solely under the GPL without exception. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ #ifndef _LIBEBLP_H #define _LIBEBLP_H 1 #include <gelf.h> +#include <libasm.h> #include <libebl.h> -//#include <libintl.h> +#include <libintl.h> + +/* Backend handle. */ +struct ebl +{ + /* Machine name. */ + const char *name; + + /* Emulation name. */ + const char *emulation; + + /* ELF machine, class, and data encoding. */ + uint_fast16_t machine; + uint_fast8_t class; + uint_fast8_t data; + + /* The libelf handle (if known). */ + Elf *elf; + + /* See ebl-hooks.h for the declarations of the hook functions. */ +# define EBLHOOK(name) (*name) +# include "ebl-hooks.h" +# undef EBLHOOK + + /* Size of entry in Sysv-style hash table. */ + int sysvhash_entrysize; + + /* Internal data. */ + void *dlhandle; +}; /* Type of the initialization functions in the backend modules. */ -typedef int (*ebl_bhinit_t) (Elf *, GElf_Half, Ebl *, size_t); +typedef const char *(*ebl_bhinit_t) (Elf *, GElf_Half, Ebl *, size_t); /* gettext helper macros. */ +#undef _ #define _(Str) dgettext ("elfutils", Str) #endif /* libeblP.h */ diff --git a/libebl/libebl_alpha.h b/libebl/libebl_alpha.h deleted file mode 100644 index 36d7dadc..00000000 --- a/libebl/libebl_alpha.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Interface for libebl_alpha module. - Copyright (C) 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_ALPHA_H -#define _LIBEBL_ALPHA_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int alpha_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void alpha_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *alpha_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool alpha_reloc_type_check (int type); - -#endif /* libebl_alpha.h */ diff --git a/libebl/libebl_alpha.map b/libebl/libebl_alpha.map deleted file mode 100644 index aa66ad75..00000000 --- a/libebl/libebl_alpha.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - alpha_backend_name; - alpha_destr; - alpha_init; - alpha_reloc_type_check; - alpha_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_arm.h b/libebl/libebl_arm.h deleted file mode 100644 index 8aade439..00000000 --- a/libebl/libebl_arm.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Interface for libebl_arm module. - Copyright (C) 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_ARM_H -#define _LIBEBL_ARM_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int arm_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void arm_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *arm_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool arm_reloc_type_check (int type); - -#endif /* libebl_arm.h */ diff --git a/libebl/libebl_arm.map b/libebl/libebl_arm.map deleted file mode 100644 index d389526c..00000000 --- a/libebl/libebl_arm.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - arm_backend_name; - arm_destr; - arm_init; - arm_reloc_type_check; - arm_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_i386.h b/libebl/libebl_i386.h deleted file mode 100644 index ed719660..00000000 --- a/libebl/libebl_i386.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Interface for libebl_i386 module. - Copyright (C) 2000, 2001, 2002, 2003 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_I386_H -#define _LIBEBL_I386_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int i386_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void i386_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *i386_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool i386_reloc_type_check (int type); - -/* Check relocation type use. */ -extern bool i386_reloc_valid_use (Elf *elf, int type); - -/* Check relocation type use. */ -extern bool i386_gotpc_reloc_check (Elf *elf, int type); - -/* Code note handling. */ -extern bool i386_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc); - -#endif /* libebl_i386.h */ diff --git a/libebl/libebl_i386.map b/libebl/libebl_i386.map deleted file mode 100644 index 38513247..00000000 --- a/libebl/libebl_i386.map +++ /dev/null @@ -1,12 +0,0 @@ -ELFUTILS_1.0 { - global: - i386_backend_name; - i386_core_note; - i386_destr; - i386_init; - i386_reloc_type_check; - i386_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_ia64.h b/libebl/libebl_ia64.h deleted file mode 100644 index 19e73fe8..00000000 --- a/libebl/libebl_ia64.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Interface for libebl_ia64 module. - Copyright (C) 2002, 2003 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_IA64_H -#define _LIBEBL_IA64_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int ia64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void ia64_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *ia64_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool ia64_reloc_type_check (int type); - -/* Name of segment type. */ -extern const char *ia64_segment_type_name (int segment, char *buf, size_t len); - -/* Name of dynamic tag. */ -extern const char *ia64_dynamic_tag_name (int64_t tag, char *buf, size_t len); - -#endif /* libebl_ia64.h */ diff --git a/libebl/libebl_ia64.map b/libebl/libebl_ia64.map deleted file mode 100644 index f67042c6..00000000 --- a/libebl/libebl_ia64.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - ia64_backend_name; - ia64_destr; - ia64_init; - ia64_reloc_type_check; - ia64_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_mips.h b/libebl/libebl_mips.h deleted file mode 100644 index 167eab30..00000000 --- a/libebl/libebl_mips.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Interface for libebl_mips module. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_MIPS_H -#define _LIBEBL_MIPS_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int mips_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void mips_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *mips_reloc_type_name (int type, char *buf, size_t len); - -/* Function to get segment type name. */ -extern const char *mips_segment_type_name (int type, char *buf, size_t len); - -/* Function to get setion type name. */ -extern const char *mips_section_type_name (int type, char *buf, size_t len); - -/* Function to get machine flag name. */ -extern const char *mips_machine_flag_name (Elf64_Word *flags); - -/* Function to get dynamic tag name. */ -extern const char *mips_dynamic_tag_name (int64_t tag, char *buf, size_t len); - -#endif /* libebl_mips.h */ diff --git a/libebl/libebl_mips.map b/libebl/libebl_mips.map deleted file mode 100644 index 9ddd366b..00000000 --- a/libebl/libebl_mips.map +++ /dev/null @@ -1,14 +0,0 @@ -ELFUTILS_1.0 { - global: - mips_backend_name; - mips_destr; - mips_dynamic_tag_name; - mips_init; - mips_machine_flag_name; - mips_reloc_type_name; - mips_section_type_name; - mips_segment_type_name; - - local: - *; -}; diff --git a/libebl/libebl_ppc.h b/libebl/libebl_ppc.h deleted file mode 100644 index 880cd399..00000000 --- a/libebl/libebl_ppc.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Interface for libebl_PPC module. - Copyright (C) 2004 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_PPC_H -#define _LIBEBL_PPC_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int ppc_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void ppc_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *ppc_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool ppc_reloc_type_check (int type); - -/* Check relocation type use. */ -extern bool ppc_reloc_valid_use (Elf *elf, int type); - -/* Code note handling. */ -extern bool ppc_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc); - -#endif /* libebl_ppc.h */ diff --git a/libebl/libebl_ppc.map b/libebl/libebl_ppc.map deleted file mode 100644 index 03bbfcc4..00000000 --- a/libebl/libebl_ppc.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - ppc_backend_name; - ppc_destr; - ppc_init; - ppc_reloc_type_check; - ppc_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_ppc64.h b/libebl/libebl_ppc64.h deleted file mode 100644 index 3ad3e8cf..00000000 --- a/libebl/libebl_ppc64.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Interface for libebl_PPC64 module. - Copyright (C) 2004 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_PPC64_H -#define _LIBEBL_PPC64_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int ppc64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void ppc64_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *ppc64_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool ppc64_reloc_type_check (int type); - -/* Check relocation type use. */ -extern bool ppc64_reloc_valid_use (Elf *elf, int type); - -/* Code note handling. */ -extern bool ppc64_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc); - -/* Name of dynamic tag. */ -extern const char *ppc64_dynamic_tag_name (int64_t tag, char *buf, size_t len); - -#endif /* libebl_ppc.h */ diff --git a/libebl/libebl_ppc64.map b/libebl/libebl_ppc64.map deleted file mode 100644 index 2d0d556a..00000000 --- a/libebl/libebl_ppc64.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - ppc64_backend_name; - ppc64_destr; - ppc64_init; - ppc64_reloc_type_check; - ppc64_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_sh.h b/libebl/libebl_sh.h deleted file mode 100644 index 40e2a8c2..00000000 --- a/libebl/libebl_sh.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Interface for libebl_sh module. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_SH_H -#define _LIBEBL_SH_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int sh_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void sh_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *sh_reloc_type_name (int type, char *buf, size_t len); - -#endif /* libebl_sh.h */ diff --git a/libebl/libebl_sh.map b/libebl/libebl_sh.map deleted file mode 100644 index 252720a9..00000000 --- a/libebl/libebl_sh.map +++ /dev/null @@ -1,10 +0,0 @@ -ELFUTILS_1.0 { - global: - sh_backend_name; - sh_destr; - sh_init; - sh_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_sparc.h b/libebl/libebl_sparc.h deleted file mode 100644 index c06228ed..00000000 --- a/libebl/libebl_sparc.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for libebl_sparc module. - Copyright (C) 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_SPARC_H -#define _LIBEBL_SPARC_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int sparc_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void sparc_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *sparc_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool sparc_reloc_type_check (int type); - -/* Code note handling. */ -extern bool sparc_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc); - -#endif /* libebl_sparc.h */ diff --git a/libebl/libebl_sparc.map b/libebl/libebl_sparc.map deleted file mode 100644 index 7ca60383..00000000 --- a/libebl/libebl_sparc.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - sparc_backend_name; - sparc_destr; - sparc_init; - sparc_reloc_type_check; - sparc_reloc_type_name; - - local: - *; -}; diff --git a/libebl/libebl_x86_64.h b/libebl/libebl_x86_64.h deleted file mode 100644 index b68124ab..00000000 --- a/libebl/libebl_x86_64.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Interface for libebl_x86_64 module. - Copyright (C) 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifndef _LIBEBL_X86_64_H -#define _LIBEBL_X86_64_H 1 - -#include <libeblP.h> - - -/* Constructor. */ -extern int x86_64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); - -/* Destructor. */ -extern void x86_64_destr (Ebl *bh); - - -/* Function to get relocation type name. */ -extern const char *x86_64_reloc_type_name (int type, char *buf, size_t len); - -/* Check relocation type. */ -extern bool x86_64_reloc_type_check (int type); - -/* Check relocation type use. */ -extern bool x86_64_reloc_valid_use (Elf *elf, int type); - -/* Code note handling. */ -extern bool x86_64_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc); - -#endif /* libebl_x86_64.h */ diff --git a/libebl/libebl_x86_64.map b/libebl/libebl_x86_64.map deleted file mode 100644 index bf07cb9c..00000000 --- a/libebl/libebl_x86_64.map +++ /dev/null @@ -1,11 +0,0 @@ -ELFUTILS_1.0 { - global: - x86_64_backend_name; - x86_64_destr; - x86_64_init; - x86_64_reloc_type_check; - x86_64_reloc_type_name; - - local: - *; -}; diff --git a/libebl/mips_destr.c b/libebl/mips_destr.c deleted file mode 100644 index fa8f8d30..00000000 --- a/libebl/mips_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for MIPS specific backend library. - Copyright (C) 2000, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_mips.h> - - -void -mips_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/mips_init.c b/libebl/mips_init.c deleted file mode 100644 index 7b51f405..00000000 --- a/libebl/mips_init.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Initialization of MIPS specific backend library. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_mips.h> - - -int -mips_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - if (machine != EM_MIPS) - eh->name = "MIPS R3000 big-endian"; - else - eh->name = "MIPS R3000 little-endian"; - - eh->reloc_type_name = mips_reloc_type_name; - eh->segment_type_name = mips_segment_type_name; - eh->section_type_name = mips_section_type_name; - eh->machine_flag_name = mips_machine_flag_name; - eh->dynamic_tag_name = mips_dynamic_tag_name; - eh->destr = mips_destr; - - return 0; -} diff --git a/libebl/mips_symbol.c b/libebl/mips_symbol.c deleted file mode 100644 index cab03310..00000000 --- a/libebl/mips_symbol.c +++ /dev/null @@ -1,266 +0,0 @@ -/* MIPS specific symbolic name handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> - -#include <libebl_mips.h> - - -/* Return of the backend. */ -const char * -mips_backend_name (void) -{ - return "mips"; -} - - -/* Determine relocation type string for MIPS. */ -const char * -mips_reloc_type_name (int type, char *buf, size_t len) -{ - static const char *map_table[] = - { - [R_MIPS_NONE] = "MIPS_NONE", - [R_MIPS_16] = "MIPS_16", - [R_MIPS_32] = "MIPS_32", - [R_MIPS_REL32] = "MIPS_REL32", - [R_MIPS_26] = "MIPS_26", - [R_MIPS_HI16] = "MIPS_HI16", - [R_MIPS_LO16] = "MIPS_LO16", - [R_MIPS_GPREL16] = "MIPS_GPREL16", - [R_MIPS_LITERAL] = "MIPS_LITERAL", - [R_MIPS_GOT16] = "MIPS_GOT16", - [R_MIPS_PC16] = "MIPS_PC16", - [R_MIPS_CALL16] = "MIPS_CALL16", - [R_MIPS_GPREL32] = "MIPS_GPREL32", - [R_MIPS_SHIFT5] = "MIPS_SHIFT5", - [R_MIPS_SHIFT6] = "MIPS_SHIFT6", - [R_MIPS_64] = "MIPS_64", - [R_MIPS_GOT_DISP] = "MIPS_GOT_DISP", - [R_MIPS_GOT_PAGE] = "MIPS_GOT_PAGE", - [R_MIPS_GOT_OFST] = "MIPS_GOT_OFST", - [R_MIPS_GOT_HI16] = "MIPS_GOT_HI16", - [R_MIPS_GOT_LO16] = "MIPS_GOT_LO16", - [R_MIPS_SUB] = "MIPS_SUB", - [R_MIPS_INSERT_A] = "MIPS_INSERT_A", - [R_MIPS_INSERT_B] = "MIPS_INSERT_B", - [R_MIPS_DELETE] = "MIPS_DELETE", - [R_MIPS_HIGHER] = "MIPS_HIGHER", - [R_MIPS_HIGHEST] = "MIPS_HIGHEST", - [R_MIPS_CALL_HI16] = "MIPS_CALL_HI16", - [R_MIPS_CALL_LO16] = "MIPS_CALL_LO16", - [R_MIPS_SCN_DISP] = "MIPS_SCN_DISP", - [R_MIPS_REL16] = "MIPS_REL16", - [R_MIPS_ADD_IMMEDIATE] = "MIPS_ADD_IMMEDIATE", - [R_MIPS_PJUMP] = "MIPS_PJUMP", - [R_MIPS_RELGOT] = "MIPS_RELGOT", - [R_MIPS_JALR] = "MIPS_JALR" - }; - - if (type < 0 || type >= R_MIPS_NUM) - return NULL; - - return map_table[type]; -} - - -const char * -mips_segment_type_name (int type, char *buf, size_t len) -{ - static const struct - { - int type; - const char *str; - } mips_segments[] = - { - { PT_MIPS_REGINFO, "MIPS_REGINFO" }, - { PT_MIPS_RTPROC, "MIPS_RTPROC" }, - { PT_MIPS_OPTIONS, "MIPS_OPTIONS" } - }; -#define nsegments (sizeof (mips_segments) / sizeof (mips_segments[0])) - size_t cnt; - - for (cnt = 0; cnt < nsegments; ++cnt) - if (type == mips_segments[cnt].type) - return mips_segments[cnt].str; - - /* We don't know the segment type. */ - return NULL; -} - - -const char * -mips_section_type_name (int type, char *buf, size_t len) -{ - static const struct - { - int type; - const char *str; - } mips_sections[] = - { - { SHT_MIPS_LIBLIST, "MIPS_LIBLIST" }, - { SHT_MIPS_MSYM, "MIPS_MSYM" }, - { SHT_MIPS_CONFLICT, "MIPS_CONFLICT" }, - { SHT_MIPS_GPTAB, "MIPS_GPTAB" }, - { SHT_MIPS_UCODE, "MIPS_UCODE" }, - { SHT_MIPS_DEBUG, "MIPS_DEBUG" }, - { SHT_MIPS_REGINFO, "MIPS_REGINFO" }, - { SHT_MIPS_PACKAGE, "MIPS_PACKAGE" }, - { SHT_MIPS_PACKSYM, "MIPS_PACKSYM" }, - { SHT_MIPS_RELD, "MIPS_RELD" }, - { SHT_MIPS_IFACE, "MIPS_IFACE" }, - { SHT_MIPS_CONTENT, "MIPS_CONTENT" }, - { SHT_MIPS_OPTIONS, "MIPS_OPTIONS" }, - { SHT_MIPS_SHDR, "MIPS_SHDR" }, - { SHT_MIPS_FDESC, "MIPS_FDESC" }, - { SHT_MIPS_EXTSYM, "MIPS_EXTSYM" }, - { SHT_MIPS_DENSE, "MIPS_DENSE" }, - { SHT_MIPS_PDESC, "MIPS_PDESC" }, - { SHT_MIPS_LOCSYM, "MIPS_LOCSYM" }, - { SHT_MIPS_AUXSYM, "MIPS_AUXSYM" }, - { SHT_MIPS_OPTSYM, "MIPS_OPTSYM" }, - { SHT_MIPS_LOCSTR, "MIPS_LOCSTR" }, - { SHT_MIPS_LINE, "MIPS_LINE" }, - { SHT_MIPS_RFDESC, "MIPS_RFDESC" }, - { SHT_MIPS_DELTASYM, "MIPS_DELTASYM" }, - { SHT_MIPS_DELTAINST, "MIPS_DELTAINST" }, - { SHT_MIPS_DELTACLASS, "MIPS_DELTACLASS" }, - { SHT_MIPS_DWARF, "MIPS_DWARF" }, - { SHT_MIPS_DELTADECL, "MIPS_DELTADECL" }, - { SHT_MIPS_SYMBOL_LIB, "MIPS_SYMBOL_LIB" }, - { SHT_MIPS_EVENTS, "MIPS_EVENTS" }, - { SHT_MIPS_TRANSLATE, "MIPS_TRANSLATE" }, - { SHT_MIPS_PIXIE, "MIPS_PIXIE" }, - { SHT_MIPS_XLATE, "MIPS_XLATE" }, - { SHT_MIPS_XLATE_DEBUG, "MIPS_XLATE_DEBUG" }, - { SHT_MIPS_WHIRL, "MIPS_WHIRL" }, - { SHT_MIPS_EH_REGION, "MIPS_EH_REGION" }, - { SHT_MIPS_XLATE_OLD, "MIPS_XLATE_OLD" }, - { SHT_MIPS_PDR_EXCEPTION, "MIPS_PDR_EXCEPTION" } - }; -#define nsections (sizeof (mips_sections) / sizeof (mips_sections[0])) - size_t cnt; - - for (cnt = 0; cnt < nsections; ++cnt) - if (type == mips_sections[cnt].type) - return mips_sections[cnt].str; - - /* We don't know the section type. */ - return NULL; -} - - -const char * -mips_machine_flag_name (Elf64_Word *flags) -{ - static const struct - { - unsigned int mask; - unsigned int flag; - const char *str; - } mips_flags[] = - { - { EF_MIPS_NOREORDER, EF_MIPS_NOREORDER, "noreorder" }, - { EF_MIPS_PIC, EF_MIPS_PIC, "pic" }, - { EF_MIPS_CPIC, EF_MIPS_CPIC, "cpic" }, - { EF_MIPS_ABI2, EF_MIPS_ABI2, "abi2" }, - { EF_MIPS_ARCH, E_MIPS_ARCH_1, "mips1" }, - { EF_MIPS_ARCH, E_MIPS_ARCH_2, "mips2" }, - { EF_MIPS_ARCH, E_MIPS_ARCH_3, "mips3" }, - { EF_MIPS_ARCH, E_MIPS_ARCH_4, "mips4" }, - { EF_MIPS_ARCH, E_MIPS_ARCH_5, "mips5" } - }; -#define nflags (sizeof (mips_flags) / sizeof (mips_flags[0])) - size_t cnt; - - for (cnt = 0; cnt < nflags; ++cnt) - if ((*flags & mips_flags[cnt].mask) == mips_flags[cnt].flag) - { - *flags &= ~mips_flags[cnt].mask; - return mips_flags[cnt].str; - } - - /* We don't know the flag. */ - return NULL; -} - - -const char * -mips_dynamic_tag_name (int64_t tag, char *buf, size_t len) -{ - static const struct - { - int tag; - const char *str; - } mips_dtags[] = - { - { DT_MIPS_RLD_VERSION, "MIPS_RLD_VERSION" }, - { DT_MIPS_TIME_STAMP, "MIPS_TIME_STAMP" }, - { DT_MIPS_ICHECKSUM, "MIPS_ICHECKSUM" }, - { DT_MIPS_IVERSION, "MIPS_IVERSION" }, - { DT_MIPS_FLAGS, "MIPS_FLAGS" }, - { DT_MIPS_BASE_ADDRESS, "MIPS_BASE_ADDRESS" }, - { DT_MIPS_MSYM, "MIPS_MSYM" }, - { DT_MIPS_CONFLICT, "MIPS_CONFLICT" }, - { DT_MIPS_LIBLIST, "MIPS_LIBLIST" }, - { DT_MIPS_LOCAL_GOTNO, "MIPS_LOCAL_GOTNO" }, - { DT_MIPS_CONFLICTNO, "MIPS_CONFLICTNO" }, - { DT_MIPS_LIBLISTNO, "MIPS_LIBLISTNO" }, - { DT_MIPS_SYMTABNO, "MIPS_SYMTABNO" }, - { DT_MIPS_UNREFEXTNO, "MIPS_UNREFEXTNO" }, - { DT_MIPS_GOTSYM, "MIPS_GOTSYM" }, - { DT_MIPS_HIPAGENO, "MIPS_HIPAGENO" }, - { DT_MIPS_RLD_MAP, "MIPS_RLD_MAP" }, - { DT_MIPS_DELTA_CLASS, "MIPS_DELTA_CLASS" }, - { DT_MIPS_DELTA_CLASS_NO, "MIPS_DELTA_CLASS_NO" }, - { DT_MIPS_DELTA_INSTANCE, "MIPS_DELTA_INSTANCE" }, - { DT_MIPS_DELTA_INSTANCE_NO, "MIPS_DELTA_INSTANCE_NO" }, - { DT_MIPS_DELTA_RELOC, "MIPS_DELTA_RELOC" }, - { DT_MIPS_DELTA_RELOC_NO, "MIPS_DELTA_RELOC_NO" }, - { DT_MIPS_DELTA_SYM, "MIPS_DELTA_SYM" }, - { DT_MIPS_DELTA_SYM_NO, "MIPS_DELTA_SYM_NO" }, - { DT_MIPS_DELTA_CLASSSYM, "MIPS_DELTA_CLASSSYM" }, - { DT_MIPS_DELTA_CLASSSYM_NO, "MIPS_DELTA_CLASSSYM_NO" }, - { DT_MIPS_CXX_FLAGS, "MIPS_CXX_FLAGS" }, - { DT_MIPS_PIXIE_INIT, "MIPS_PIXIE_INIT" }, - { DT_MIPS_SYMBOL_LIB, "MIPS_SYMBOL_LIB" }, - { DT_MIPS_LOCALPAGE_GOTIDX, "MIPS_LOCALPAGE_GOTIDX" }, - { DT_MIPS_LOCAL_GOTIDX, "MIPS_LOCAL_GOTIDX" }, - { DT_MIPS_HIDDEN_GOTIDX, "MIPS_HIDDEN_GOTIDX" }, - { DT_MIPS_PROTECTED_GOTIDX, "MIPS_PROTECTED_GOTIDX" }, - { DT_MIPS_OPTIONS, "MIPS_OPTIONS" }, - { DT_MIPS_INTERFACE, "MIPS_INTERFACE" }, - { DT_MIPS_DYNSTR_ALIGN, "MIPS_DYNSTR_ALIGN" }, - { DT_MIPS_INTERFACE_SIZE, "MIPS_INTERFACE_SIZE" }, - { DT_MIPS_RLD_TEXT_RESOLVE_ADDR, "MIPS_RLD_TEXT_RESOLVE_ADDR" }, - { DT_MIPS_PERF_SUFFIX, "MIPS_PERF_SUFFIX" }, - { DT_MIPS_COMPACT_SIZE, "MIPS_COMPACT_SIZE" }, - { DT_MIPS_GP_VALUE, "MIPS_GP_VALUE" }, - { DT_MIPS_AUX_DYNAMIC, "MIPS_AUX_DYNAMIC" }, - }; -#define ndtags (sizeof (mips_dtags) / sizeof (mips_dtags[0])) - size_t cnt; - - for (cnt = 0; cnt < ndtags; ++cnt) - if (tag == mips_dtags[cnt].tag) - return mips_dtags[cnt].str; - - /* We don't know this dynamic tag. */ - return NULL; -} diff --git a/libebl/ppc64_destr.c b/libebl/ppc64_destr.c deleted file mode 100644 index 9fd38021..00000000 --- a/libebl/ppc64_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for PPC64 specific backend library. - Copyright (C) 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2004. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_ppc64.h> - - -void -ppc64_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/ppc64_init.c b/libebl/ppc64_init.c deleted file mode 100644 index fec963b2..00000000 --- a/libebl/ppc64_init.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Initialization of PPC64 specific backend library. - Copyright (C) 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2004. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_ppc64.h> - - -int -ppc64_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "PowerPC 64-bit"; - eh->reloc_type_name = ppc64_reloc_type_name; - eh->reloc_type_check = ppc64_reloc_type_check; - eh->reloc_valid_use = ppc64_reloc_valid_use; - eh->dynamic_tag_name = ppc64_dynamic_tag_name; - eh->destr = ppc64_destr; - - return 0; -} diff --git a/libebl/ppc64_symbol.c b/libebl/ppc64_symbol.c deleted file mode 100644 index 9ab53667..00000000 --- a/libebl/ppc64_symbol.c +++ /dev/null @@ -1,206 +0,0 @@ -/* PPC64 specific symbolic name handling. - Copyright (C) 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2004. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <assert.h> -#include <elf.h> -#include <stddef.h> - -#include <libebl_ppc64.h> - - -/* Return of the backend. */ -const char * -ppc64_backend_name (void) -{ - return "ppc64"; -} - - -/* Relocation mapping table. */ -static struct -{ - const char *name; - enum { both = 0, rel = 1, exec = 2 } appear; -} reloc_map_table[] = - { - // XXX Check all the appear values. - [R_PPC64_NONE] = { "R_PPC64_NONE", both }, - [R_PPC64_ADDR32] = { "R_PPC64_ADDR32", both }, - [R_PPC64_ADDR24] = { "R_PPC64_ADDR24", both }, - [R_PPC64_ADDR16] = { "R_PPC64_ADDR16", both }, - [R_PPC64_ADDR16_LO] = { "R_PPC64_ADDR16_LO", both }, - [R_PPC64_ADDR16_HI] = { "R_PPC64_ADDR16_HI", both }, - [R_PPC64_ADDR16_HA] = { "R_PPC64_ADDR16_HA", both }, - [R_PPC64_ADDR14] = { "R_PPC64_ADDR14", both }, - [R_PPC64_ADDR14_BRTAKEN] = { "R_PPC64_ADDR14_BRTAKEN", exec }, - [R_PPC64_ADDR14_BRNTAKEN] = { "R_PPC64_ADDR14_BRNTAKEN", exec }, - [R_PPC64_REL24] = { "R_PPC64_REL24", both }, - [R_PPC64_REL14] = { "R_PPC64_REL14", both }, - [R_PPC64_REL14_BRTAKEN] = { "R_PPC64_REL14_BRTAKEN", exec }, - [R_PPC64_REL14_BRNTAKEN] = { "R_PPC64_REL14_BRNTAKEN", exec }, - [R_PPC64_GOT16] = { "R_PPC64_GOT16", rel }, - [R_PPC64_GOT16_LO] = { "R_PPC64_GOT16_LO", rel }, - [R_PPC64_GOT16_HI] = { "R_PPC64_GOT16_HI", rel }, - [R_PPC64_GOT16_HA] = { "R_PPC64_GOT16_HA", rel }, - [R_PPC64_COPY] = { "R_PPC64_COPY", exec }, - [R_PPC64_GLOB_DAT] = { "R_PPC64_GLOB_DAT", exec }, - [R_PPC64_JMP_SLOT] = { "R_PPC64_JMP_SLOT", exec }, - [R_PPC64_RELATIVE] = { "R_PPC64_RELATIVE", exec }, - [R_PPC64_UADDR32] = { "R_PPC64_UADDR32", exec }, - [R_PPC64_UADDR16] = { "R_PPC64_UADDR16", exec }, - [R_PPC64_REL32] = { "R_PPC64_REL32", exec }, - [R_PPC64_PLT32] = { "R_PPC64_PLT32", exec }, - [R_PPC64_PLTREL32] = { "R_PPC64_PLTREL32", both }, - [R_PPC64_PLT16_LO] = { "R_PPC64_PLT16_LO", both }, - [R_PPC64_PLT16_HI] = { "R_PPC64_PLT16_HI", both }, - [R_PPC64_PLT16_HA] = { "R_PPC64_PLT16_HA", both }, - [R_PPC64_SECTOFF] = { "R_PPC64_SECTOFF", both }, - [R_PPC64_SECTOFF_LO] = { "R_PPC64_SECTOFF_LO", both }, - [R_PPC64_SECTOFF_HI] = { "R_PPC64_SECTOFF_HI", both }, - [R_PPC64_SECTOFF_HA] = { "R_PPC64_SECTOFF_HA", both }, - [R_PPC64_ADDR30] = { "R_PPC64_ADDR30", both }, - [R_PPC64_ADDR64] = { "R_PPC64_ADDR64", both }, - [R_PPC64_ADDR16_HIGHER] = { "R_PPC64_ADDR16_HIGHER", both }, - [R_PPC64_ADDR16_HIGHERA] = { "R_PPC64_ADDR16_HIGHERA", both }, - [R_PPC64_ADDR16_HIGHEST] = { "R_PPC64_ADDR16_HIGHEST", both }, - [R_PPC64_ADDR16_HIGHESTA] = { "R_PPC64_ADDR16_HIGHESTA", both }, - [R_PPC64_UADDR64] = { "R_PPC64_UADDR64", both }, - [R_PPC64_REL64] = { "R_PPC64_REL64", both }, - [R_PPC64_PLT64] = { "R_PPC64_PLT64", both }, - [R_PPC64_PLTREL64] = { "R_PPC64_PLTREL64", both }, - [R_PPC64_TOC16] = { "R_PPC64_TOC16", both }, - [R_PPC64_TOC16_LO] = { "R_PPC64_TOC16_LO", both }, - [R_PPC64_TOC16_HI] = { "R_PPC64_TOC16_HI", both }, - [R_PPC64_TOC16_HA] = { "R_PPC64_TOC16_HA", both }, - [R_PPC64_TOC] = { "R_PPC64_TOC", both }, - [R_PPC64_PLTGOT16] = { "R_PPC64_PLTGOT16", both }, - [R_PPC64_PLTGOT16_LO] = { "R_PPC64_PLTGOT16_LO", both }, - [R_PPC64_PLTGOT16_HI] = { "R_PPC64_PLTGOT16_HI", both }, - [R_PPC64_PLTGOT16_HA] = { "R_PPC64_PLTGOT16_HA", both }, - [R_PPC64_ADDR16_DS] = { "R_PPC64_ADDR16_DS", both }, - [R_PPC64_ADDR16_LO_DS] = { "R_PPC64_ADDR16_LO_DS", both }, - [R_PPC64_GOT16_DS] = { "R_PPC64_GOT16_DS", both }, - [R_PPC64_GOT16_LO_DS] = { "R_PPC64_GOT16_LO_DS", both }, - [R_PPC64_PLT16_LO_DS] = { "R_PPC64_PLT16_LO_DS", both }, - [R_PPC64_SECTOFF_DS] = { "R_PPC64_SECTOFF_DS", both }, - [R_PPC64_SECTOFF_LO_DS] = { "R_PPC64_SECTOFF_LO_DS", both }, - [R_PPC64_TOC16_DS] = { "R_PPC64_TOC16_DS", both }, - [R_PPC64_TOC16_LO_DS] = { "R_PPC64_TOC16_LO_DS", both }, - [R_PPC64_PLTGOT16_DS] = { "R_PPC64_PLTGOT16_DS", both }, - [R_PPC64_PLTGOT16_LO_DS] = { "R_PPC64_PLTGOT16_LO_DS", both }, - [R_PPC64_TLS] = { "R_PPC64_TLS", both }, - [R_PPC64_DTPMOD64] = { "R_PPC64_DTPMOD64", both }, - [R_PPC64_TPREL16] = { "R_PPC64_TPREL16", both }, - [R_PPC64_TPREL16_LO] = { "R_PPC64_TPREL16_LO", both }, - [R_PPC64_TPREL16_HI] = { "R_PPC64_TPREL16_HI", both }, - [R_PPC64_TPREL16_HA] = { "R_PPC64_TPREL16_HA", both }, - [R_PPC64_TPREL64] = { "R_PPC64_TPREL64", both }, - [R_PPC64_DTPREL16] = { "R_PPC64_DTPREL16", both }, - [R_PPC64_DTPREL16_LO] = { "R_PPC64_DTPREL16_LO", both }, - [R_PPC64_DTPREL16_HI] = { "R_PPC64_DTPREL16_HI", both }, - [R_PPC64_DTPREL16_HA] = { "R_PPC64_DTPREL16_HA", both }, - [R_PPC64_DTPREL64] = { "R_PPC64_DTPREL64", both }, - [R_PPC64_GOT_TLSGD16] = { "R_PPC64_GOT_TLSGD16", both }, - [R_PPC64_GOT_TLSGD16_LO] = { "R_PPC64_GOT_TLSGD16_LO", both }, - [R_PPC64_GOT_TLSGD16_HI] = { "R_PPC64_GOT_TLSGD16_HI", both }, - [R_PPC64_GOT_TLSGD16_HA] = { "R_PPC64_GOT_TLSGD16_HA", both }, - [R_PPC64_GOT_TLSLD16] = { "R_PPC64_GOT_TLSLD16", both }, - [R_PPC64_GOT_TLSLD16_LO] = { "R_PPC64_GOT_TLSLD16_LO", both }, - [R_PPC64_GOT_TLSLD16_HI] = { "R_PPC64_GOT_TLSLD16_HI", both }, - [R_PPC64_GOT_TLSLD16_HA] = { "R_PPC64_GOT_TLSLD16_HA", both }, - [R_PPC64_GOT_TPREL16_DS] = { "R_PPC64_GOT_TPREL16_DS", both }, - [R_PPC64_GOT_TPREL16_LO_DS] = { "R_PPC64_GOT_TPREL16_LO_DS", both }, - [R_PPC64_GOT_TPREL16_HI] = { "R_PPC64_GOT_TPREL16_HI", both }, - [R_PPC64_GOT_TPREL16_HA] = { "R_PPC64_GOT_TPREL16_HA", both }, - [R_PPC64_GOT_DTPREL16_DS] = { "R_PPC64_GOT_DTPREL16_DS", both }, - [R_PPC64_GOT_DTPREL16_LO_DS] = { "R_PPC64_GOT_DTPREL16_LO_DS", both }, - [R_PPC64_GOT_DTPREL16_HI] = { "R_PPC64_GOT_DTPREL16_HI", both }, - [R_PPC64_GOT_DTPREL16_HA] = { "R_PPC64_GOT_DTPREL16_HA", both }, - [R_PPC64_TPREL16_DS] = { "R_PPC64_TPREL16_DS", both }, - [R_PPC64_TPREL16_LO_DS] = { "R_PPC64_TPREL16_LO_DS", both }, - [R_PPC64_TPREL16_HIGHER] = { "R_PPC64_TPREL16_HIGHER", both }, - [R_PPC64_TPREL16_HIGHERA] = { "R_PPC64_TPREL16_HIGHERA", both }, - [R_PPC64_TPREL16_HIGHEST] = { "R_PPC64_TPREL16_HIGHEST", both }, - [R_PPC64_TPREL16_HIGHESTA] = { "R_PPC64_TPREL16_HIGHESTA", both }, - [R_PPC64_DTPREL16_DS] = { "R_PPC64_DTPREL16_DS", both }, - [R_PPC64_DTPREL16_LO_DS] = { "R_PPC64_DTPREL16_LO_DS", both }, - [R_PPC64_DTPREL16_HIGHER] = { "R_PPC64_DTPREL16_HIGHER", both }, - [R_PPC64_DTPREL16_HIGHERA] = { "R_PPC64_DTPREL16_HIGHERA", both }, - [R_PPC64_DTPREL16_HIGHEST] = { "R_PPC64_DTPREL16_HIGHEST", both }, - [R_PPC64_DTPREL16_HIGHESTA] = { "R_PPC64_DTPREL16_HIGHESTA", both } - }; - - -/* Determine relocation type string for PPC. */ -const char * -ppc64_reloc_type_name (int type, char *buf, size_t len) -{ - if (type < R_PPC64_NONE || type >= R_PPC64_NUM) - return NULL; - - return reloc_map_table[type].name; -} - - -/* Check for correct relocation type. */ -bool -ppc64_reloc_type_check (int type) -{ - return (type >= R_PPC64_NONE && type < R_PPC64_NUM - && reloc_map_table[type].name != NULL) ? true : false; -} - - -/* Check for correct relocation type use. */ -bool -ppc64_reloc_valid_use (Elf *elf, int type) -{ - if (type < R_PPC64_NONE || type >= R_PPC64_NUM - || reloc_map_table[type].name == NULL) - return false; - - Elf64_Ehdr *ehdr = elf64_getehdr (elf); - assert (ehdr != NULL); - - if (reloc_map_table[type].appear == rel) - return ehdr->e_type == ET_REL; - - if (reloc_map_table[type].appear == exec) - return ehdr->e_type != ET_REL; - - assert (reloc_map_table[type].appear == both); - return true; -} - - -const char * -ppc64_dynamic_tag_name (int64_t tag, char *buf, size_t len) -{ - switch (tag) - { - case DT_PPC64_GLINK: - return "PPC64_GLINK"; - case DT_PPC64_OPD: - return "PPC64_OPD"; - case DT_PPC64_OPDSZ: - return "PPC64_OPDSZ"; - default: - break; - } - return NULL; -} diff --git a/libebl/ppc_destr.c b/libebl/ppc_destr.c deleted file mode 100644 index 219de067..00000000 --- a/libebl/ppc_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for PPC specific backend library. - Copyright (C) 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2004. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_ppc.h> - - -void -ppc_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/ppc_init.c b/libebl/ppc_init.c deleted file mode 100644 index 9b45bd73..00000000 --- a/libebl/ppc_init.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Initialization of PPC specific backend library. - Copyright (C) 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2004. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_ppc.h> - - -int -ppc_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "PowerPC"; - eh->reloc_type_name = ppc_reloc_type_name; - eh->reloc_type_check = ppc_reloc_type_check; - eh->reloc_valid_use = ppc_reloc_valid_use; - eh->destr = ppc_destr; - - return 0; -} diff --git a/libebl/ppc_symbol.c b/libebl/ppc_symbol.c deleted file mode 100644 index 08a9fef7..00000000 --- a/libebl/ppc_symbol.c +++ /dev/null @@ -1,149 +0,0 @@ -/* PPC specific symbolic name handling. - Copyright (C) 2004 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2004. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <assert.h> -#include <elf.h> -#include <stddef.h> - -#include <libebl_ppc.h> - - -/* Return of the backend. */ -const char * -ppc_backend_name (void) -{ - return "ppc"; -} - - -/* Relocation mapping table. */ -static struct -{ - const char *name; - enum { both = 0, rel = 1, exec = 2 } appear; -} reloc_map_table[] = - { - // XXX Check all the appear values. - [R_PPC_NONE] = { "R_PPC_NONE", both }, - [R_PPC_ADDR32] = { "R_PPC_ADDR32", both }, - [R_PPC_ADDR24] = { "R_PPC_ADDR24", both }, - [R_PPC_ADDR16] = { "R_PPC_ADDR16", both }, - [R_PPC_ADDR16_LO] = { "R_PPC_ADDR16_LO", both }, - [R_PPC_ADDR16_HI] = { "R_PPC_ADDR16_HI", both }, - [R_PPC_ADDR16_HA] = { "R_PPC_ADDR16_HA", both }, - [R_PPC_ADDR14] = { "R_PPC_ADDR14", exec }, - [R_PPC_ADDR14_BRTAKEN] = { "R_PPC_ADDR14_BRTAKEN", exec }, - [R_PPC_ADDR14_BRNTAKEN] = { "R_PPC_ADDR14_BRNTAKEN", exec }, - [R_PPC_REL24] = { "R_PPC_REL24", both }, - [R_PPC_REL14] = { "R_PPC_REL14", both }, - [R_PPC_REL14_BRTAKEN] = { "R_PPC_REL14_BRTAKEN", exec }, - [R_PPC_REL14_BRNTAKEN] = { "R_PPC_REL14_BRNTAKEN", exec }, - [R_PPC_GOT16] = { "R_PPC_GOT16", rel }, - [R_PPC_GOT16_LO] = { "R_PPC_GOT16_LO", rel }, - [R_PPC_GOT16_HI] = { "R_PPC_GOT16_HI", rel }, - [R_PPC_GOT16_HA] = { "R_PPC_GOT16_HA", rel }, - [R_PPC_PLTREL24] = { "R_PPC_PLTREL24", rel }, - [R_PPC_COPY] = { "R_PPC_COPY", exec }, - [R_PPC_GLOB_DAT] = { "R_PPC_GLOB_DAT", exec }, - [R_PPC_JMP_SLOT] = { "R_PPC_JMP_SLOT", exec }, - [R_PPC_RELATIVE] = { "R_PPC_RELATIVE", exec }, - [R_PPC_LOCAL24PC] = { "R_PPC_LOCAL24PC", rel }, - [R_PPC_UADDR32] = { "R_PPC_UADDR32", exec }, - [R_PPC_UADDR16] = { "R_PPC_UADDR16", exec }, - [R_PPC_REL32] = { "R_PPC_REL32", exec }, - [R_PPC_PLT32] = { "R_PPC_PLT32", exec }, - [R_PPC_PLTREL32] = { "R_PPC_PLTREL32", both }, - [R_PPC_PLT16_LO] = { "R_PPC_PLT16_LO", both }, - [R_PPC_PLT16_HI] = { "R_PPC_PLT16_HI", both }, - [R_PPC_PLT16_HA] = { "R_PPC_PLT16_HA", both }, - [R_PPC_SDAREL16] = { "R_PPC_SDAREL16", both }, - [R_PPC_SECTOFF] = { "R_PPC_SECTOFF", both }, - [R_PPC_SECTOFF_LO] = { "R_PPC_SECTOFF_LO", both }, - [R_PPC_SECTOFF_HI] = { "R_PPC_SECTOFF_HI", both }, - [R_PPC_SECTOFF_HA] = { "R_PPC_SECTOFF_HA", both }, - [R_PPC_TLS] = { "R_PPC_TLS", both }, - [R_PPC_DTPMOD32] = { "R_PPC_DTPMOD32", exec }, - [R_PPC_TPREL16] = { "R_PPC_TPREL16", rel }, - [R_PPC_TPREL16_LO] = { "R_PPC_TPREL16_LO", rel }, - [R_PPC_TPREL16_HI] = { "R_PPC_TPREL16_HI", rel }, - [R_PPC_TPREL16_HA] = { "R_PPC_TPREL16_HA", rel }, - [R_PPC_TPREL32] = { "R_PPC_TPREL32", exec }, - [R_PPC_DTPREL16] = { "R_PPC_DTPREL16", rel }, - [R_PPC_DTPREL16_LO] = { "R_PPC_DTPREL16_LO", rel }, - [R_PPC_DTPREL16_HI] = { "R_PPC_DTPREL16_HI", rel }, - [R_PPC_DTPREL16_HA] = { "R_PPC_DTPREL16_HA", rel }, - [R_PPC_DTPREL32] = { "R_PPC_DTPREL32", exec }, - [R_PPC_GOT_TLSGD16] = { "R_PPC_GOT_TLSGD16", exec }, - [R_PPC_GOT_TLSGD16_LO] = { "R_PPC_GOT_TLSGD16_LO", exec }, - [R_PPC_GOT_TLSGD16_HI] = { "R_PPC_GOT_TLSGD16_HI", exec }, - [R_PPC_GOT_TLSGD16_HA] = { "R_PPC_GOT_TLSGD16_HA", exec }, - [R_PPC_GOT_TLSLD16] = { "R_PPC_GOT_TLSLD16", exec }, - [R_PPC_GOT_TLSLD16_LO] = { "R_PPC_GOT_TLSLD16_LO", exec }, - [R_PPC_GOT_TLSLD16_HI] = { "R_PPC_GOT_TLSLD16_HI", exec }, - [R_PPC_GOT_TLSLD16_HA] = { "R_PPC_GOT_TLSLD16_HA", exec }, - [R_PPC_GOT_TPREL16] = { "R_PPC_GOT_TPREL16", exec }, - [R_PPC_GOT_TPREL16_LO] = { "R_PPC_GOT_TPREL16_LO", exec }, - [R_PPC_GOT_TPREL16_HI] = { "R_PPC_GOT_TPREL16_HI", exec }, - [R_PPC_GOT_TPREL16_HA] = { "R_PPC_GOT_TPREL16_HA", exec }, - [R_PPC_GOT_DTPREL16] = { "R_PPC_GOT_DTPREL16", exec }, - [R_PPC_GOT_DTPREL16_LO] = { "R_PPC_GOT_DTPREL16_LO", exec }, - [R_PPC_GOT_DTPREL16_HI] = { "R_PPC_GOT_DTPREL16_HI", exec }, - [R_PPC_GOT_DTPREL16_HA] = { "R_PPC_GOT_DTPREL16_HA", exec } - }; - - -/* Determine relocation type string for PPC. */ -const char * -ppc_reloc_type_name (int type, char *buf, size_t len) -{ - if (type < 0 || type >= R_PPC_NUM) - return NULL; - - return reloc_map_table[type].name; -} - - -/* Check for correct relocation type. */ -bool -ppc_reloc_type_check (int type) -{ - return (type >= R_PPC_NONE && type < R_PPC_NUM - && reloc_map_table[type].name != NULL) ? true : false; -} - - -/* Check for correct relocation type use. */ -bool -ppc_reloc_valid_use (Elf *elf, int type) -{ - if (type < R_PPC_NONE || type >= R_PPC_NUM - || reloc_map_table[type].name == NULL) - return false; - - Elf32_Ehdr *ehdr = elf32_getehdr (elf); - assert (ehdr != NULL); - - if (reloc_map_table[type].appear == rel) - return ehdr->e_type == ET_REL; - - if (reloc_map_table[type].appear == exec) - return ehdr->e_type != ET_REL; - - assert (reloc_map_table[type].appear == both); - return true; -} diff --git a/libebl/sh_destr.c b/libebl/sh_destr.c deleted file mode 100644 index f6b03b3a..00000000 --- a/libebl/sh_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for SH specific backend library. - Copyright (C) 2000. 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_sh.h> - - -void -sh_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/sh_init.c b/libebl/sh_init.c deleted file mode 100644 index cc26640b..00000000 --- a/libebl/sh_init.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Initialization of SH specific backend library. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_sh.h> - - -int -sh_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "Hitachi SH"; - eh->reloc_type_name = sh_reloc_type_name; - eh->destr = sh_destr; - - return 0; -} diff --git a/libebl/sh_symbol.c b/libebl/sh_symbol.c deleted file mode 100644 index 6211ab51..00000000 --- a/libebl/sh_symbol.c +++ /dev/null @@ -1,91 +0,0 @@ -/* SH specific relocation handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2000. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> - -#include <libebl_sh.h> - - -/* Return of the backend. */ -const char * -sh_backend_name (void) -{ - return "sh"; -} - - -/* Determine relocation type string for SH. */ -const char * -sh_reloc_type_name (int type, char *buf, size_t len) -{ - static const char *map_table1[] = - { - [R_SH_NONE] = "R_SH_NONE", - [R_SH_DIR32] = "R_SH_DIR32", - [R_SH_REL32] = "R_SH_REL32", - [R_SH_DIR8WPN] = "R_SH_DIR8WPN", - [R_SH_IND12W] = "R_SH_IND12W", - [R_SH_DIR8WPL] = "R_SH_DIR8WPL", - [R_SH_DIR8WPZ] = "R_SH_DIR8WPZ", - [R_SH_DIR8BP] = "R_SH_DIR8BP", - [R_SH_DIR8W] = "R_SH_DIR8W", - [R_SH_DIR8L] = "R_SH_DIR8L", - [R_SH_SWITCH16] = "R_SH_SWITCH16", - [R_SH_SWITCH32] = "R_SH_SWITCH32", - [R_SH_USES] = "R_SH_USES", - [R_SH_COUNT] = "R_SH_COUNT", - [R_SH_ALIGN] = "R_SH_ALIGN", - [R_SH_CODE] = "R_SH_CODE", - [R_SH_DATA] = "R_SH_DATA", - [R_SH_LABEL] = "R_SH_LABEL", - [R_SH_SWITCH8] = "R_SH_SWITCH8", - [R_SH_GNU_VTINHERIT] ="R_SH_GNU_VTINHERIT", - [R_SH_GNU_VTENTRY] = "R_SH_GNU_VTENTRY" - }; - static const char *map_table2[] = - { - [R_SH_TLS_GD_32] = "R_SH_TLS_GD_32", - [R_SH_TLS_LD_32] = "R_SH_TLS_LD_32", - [R_SH_TLS_LDO_32] = "R_SH_TLS_LDO_32", - [R_SH_TLS_IE_32] = "R_SH_TLS_IE_32", - [R_SH_TLS_LE_32] = "R_SH_TLS_LE_32", - [R_SH_TLS_DTPMOD32] = "R_SH_TLS_DTPMOD32", - [R_SH_TLS_DTPOFF32] = "R_SH_TLS_DTPOFF32", - [R_SH_TLS_TPOFF32] = "R_SH_TLS_TPOFF32", - [R_SH_GOT32 - R_SH_GOT32] = "R_SH_GOT32", - [R_SH_PLT32 - R_SH_GOT32] = "R_SH_PLT32", - [R_SH_COPY - R_SH_GOT32] = "R_SH_COPY", - [R_SH_GLOB_DAT - R_SH_GOT32] = "R_SH_GLOB_DAT", - [R_SH_JMP_SLOT - R_SH_GOT32] = "R_SH_JMP_SLOT", - [R_SH_RELATIVE - R_SH_GOT32] = "R_SH_RELATIVE", - [R_SH_GOTOFF - R_SH_GOT32] = "R_SH_GOTOFF", - [R_SH_GOTPC - R_SH_GOT32] = "R_SH_GOTPC" - }; - - if (type >= 0 - && (size_t) type < sizeof (map_table1) / sizeof (map_table1[0])) - return map_table1[type]; - - if ((type - R_SH_TLS_GD_32) >= 0 - && ((size_t) (type - R_SH_TLS_GD_32) - < sizeof (map_table2) / sizeof (map_table2[0]))) - return map_table2[type - R_SH_TLS_GD_32]; - - return NULL; -} diff --git a/libebl/sparc_destr.c b/libebl/sparc_destr.c deleted file mode 100644 index ced22917..00000000 --- a/libebl/sparc_destr.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Destructor for SPARC specific backend library. - Copyright (C) 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_sparc.h> - - -void -sparc_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/sparc_init.c b/libebl/sparc_init.c deleted file mode 100644 index 2bb1f790..00000000 --- a/libebl/sparc_init.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Initialization of SPARC specific backend library. - Copyright (C) 2002 Red Hat, Inc. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_sparc.h> - - -int -sparc_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - if (machine == EM_SPARCV9) - eh->name = "SPARC v9"; - else if (machine == EM_SPARC32PLUS) - eh->name = "SPARC v8+"; - else - eh->name = "SPARC"; - eh->reloc_type_name = sparc_reloc_type_name; - eh->reloc_type_check = sparc_reloc_type_check; - //eh->core_note = sparc_core_note; - eh->destr = sparc_destr; - - return 0; -} diff --git a/libebl/sparc_symbol.c b/libebl/sparc_symbol.c deleted file mode 100644 index eed31d11..00000000 --- a/libebl/sparc_symbol.c +++ /dev/null @@ -1,141 +0,0 @@ -/* SPARC specific symbolic name handling. - Copyright (C) 2002, 2003 Red Hat, Inc. - Written by Jakub Jelinek <jakub@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <elf.h> -#include <stddef.h> - -#include <libebl_sparc.h> - - -/* Return of the backend. */ -const char * -sparc_backend_name (void) -{ - return "sparc"; -} - - -/* Relocation mapping table. */ -static const char *reloc_map_table[] = - { - [R_SPARC_NONE] = "R_SPARC_NONE", - [R_SPARC_8] = "R_SPARC_8", - [R_SPARC_16] = "R_SPARC_16", - [R_SPARC_32] = "R_SPARC_32", - [R_SPARC_DISP8] = "R_SPARC_DISP8", - [R_SPARC_DISP16] = "R_SPARC_DISP16", - [R_SPARC_DISP32] = "R_SPARC_DISP32", - [R_SPARC_WDISP30] = "R_SPARC_WDISP30", - [R_SPARC_WDISP22] = "R_SPARC_WDISP22", - [R_SPARC_HI22] = "R_SPARC_HI22", - [R_SPARC_22] = "R_SPARC_22", - [R_SPARC_13] = "R_SPARC_13", - [R_SPARC_LO10] = "R_SPARC_LO10", - [R_SPARC_GOT10] = "R_SPARC_GOT10", - [R_SPARC_GOT13] = "R_SPARC_GOT13", - [R_SPARC_GOT22] = "R_SPARC_GOT22", - [R_SPARC_PC10] = "R_SPARC_PC10", - [R_SPARC_PC22] = "R_SPARC_PC22", - [R_SPARC_WPLT30] = "R_SPARC_WPLT30", - [R_SPARC_COPY] = "R_SPARC_COPY", - [R_SPARC_GLOB_DAT] = "R_SPARC_GLOB_DAT", - [R_SPARC_JMP_SLOT] = "R_SPARC_JMP_SLOT", - [R_SPARC_RELATIVE] = "R_SPARC_RELATIVE", - [R_SPARC_UA32] = "R_SPARC_UA32", - [R_SPARC_PLT32] = "R_SPARC_PLT32", - [R_SPARC_HIPLT22] = "R_SPARC_HIPLT22", - [R_SPARC_LOPLT10] = "R_SPARC_LOPLT10", - [R_SPARC_PCPLT32] = "R_SPARC_PCPLT32", - [R_SPARC_PCPLT22] = "R_SPARC_PCPLT22", - [R_SPARC_PCPLT10] = "R_SPARC_PCPLT10", - [R_SPARC_10] = "R_SPARC_10", - [R_SPARC_11] = "R_SPARC_11", - [R_SPARC_64] = "R_SPARC_64", - [R_SPARC_OLO10] = "R_SPARC_OLO10", - [R_SPARC_HH22] = "R_SPARC_HH22", - [R_SPARC_HM10] = "R_SPARC_HM10", - [R_SPARC_LM22] = "R_SPARC_LM22", - [R_SPARC_PC_HH22] = "R_SPARC_PC_HH22", - [R_SPARC_PC_HM10] = "R_SPARC_PC_HM10", - [R_SPARC_PC_LM22] = "R_SPARC_PC_LM22", - [R_SPARC_WDISP16] = "R_SPARC_WDISP16", - [R_SPARC_WDISP19] = "R_SPARC_WDISP19", - [R_SPARC_7] = "R_SPARC_7", - [R_SPARC_5] = "R_SPARC_5", - [R_SPARC_6] = "R_SPARC_6", - [R_SPARC_DISP64] = "R_SPARC_DISP64", - [R_SPARC_PLT64] = "R_SPARC_PLT64", - [R_SPARC_HIX22] = "R_SPARC_HIX22", - [R_SPARC_LOX10] = "R_SPARC_LOX10", - [R_SPARC_H44] = "R_SPARC_H44", - [R_SPARC_M44] = "R_SPARC_M44", - [R_SPARC_L44] = "R_SPARC_L44", - [R_SPARC_REGISTER] = "R_SPARC_REGISTER", - [R_SPARC_UA64] = "R_SPARC_UA64", - [R_SPARC_UA16] = "R_SPARC_UA16", - [R_SPARC_TLS_GD_HI22] = "R_SPARC_TLS_GD_HI22", - [R_SPARC_TLS_GD_LO10] = "R_SPARC_TLS_GD_LO10", - [R_SPARC_TLS_GD_ADD] = "R_SPARC_TLS_GD_ADD", - [R_SPARC_TLS_GD_CALL] = "R_SPARC_TLS_GD_CALL", - [R_SPARC_TLS_LDM_HI22] = "R_SPARC_TLS_LDM_HI22", - [R_SPARC_TLS_LDM_LO10] = "R_SPARC_TLS_LDM_LO10", - [R_SPARC_TLS_LDM_ADD] = "R_SPARC_TLS_LDM_ADD", - [R_SPARC_TLS_LDM_CALL] = "R_SPARC_TLS_LDM_CALL", - [R_SPARC_TLS_LDO_HIX22] = "R_SPARC_TLS_LDO_HIX22", - [R_SPARC_TLS_LDO_LOX10] = "R_SPARC_TLS_LDO_LOX10", - [R_SPARC_TLS_LDO_ADD] = "R_SPARC_TLS_LDO_ADD", - [R_SPARC_TLS_IE_HI22] = "R_SPARC_TLS_IE_HI22", - [R_SPARC_TLS_IE_LO10] = "R_SPARC_TLS_IE_LO10", - [R_SPARC_TLS_IE_LD] = "R_SPARC_TLS_IE_LD", - [R_SPARC_TLS_IE_LDX] = "R_SPARC_TLS_IE_LDX", - [R_SPARC_TLS_IE_ADD] = "R_SPARC_TLS_IE_ADD", - [R_SPARC_TLS_LE_HIX22] = "R_SPARC_TLS_LE_HIX22", - [R_SPARC_TLS_LE_LOX10] = "R_SPARC_TLS_LE_LOX10", - [R_SPARC_TLS_DTPMOD32] = "R_SPARC_TLS_DTPMOD32", - [R_SPARC_TLS_DTPMOD64] = "R_SPARC_TLS_DTPMOD64", - [R_SPARC_TLS_DTPOFF32] = "R_SPARC_TLS_DTPOFF32", - [R_SPARC_TLS_DTPOFF64] = "R_SPARC_TLS_DTPOFF64", - [R_SPARC_TLS_TPOFF32] = "R_SPARC_TLS_TPOFF32", - [R_SPARC_TLS_TPOFF64] = "R_SPARC_TLS_TPOFF64" - }; - - -/* Determine relocation type string for sparc. */ -const char * -sparc_reloc_type_name (int type, char *buf, size_t len) -{ - /* High 24 bits of r_type are used for second addend in R_SPARC_OLO10. */ - if ((type & 0xff) == R_SPARC_OLO10) - return reloc_map_table[type & 0xff]; - - if (type < 0 || type >= R_SPARC_NUM) - return NULL; - - return reloc_map_table[type]; -} - - -/* Check for correct relocation type. */ -bool -sparc_reloc_type_check (int type) -{ - if ((type & 0xff) == R_SPARC_OLO10) - return true; - return (type >= R_SPARC_NONE && type < R_SPARC_NUM - && reloc_map_table[type] != NULL) ? true : false; -} diff --git a/libebl/x86_64_destr.c b/libebl/x86_64_destr.c deleted file mode 100644 index 754ccc99..00000000 --- a/libebl/x86_64_destr.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Destructor for x86_64 specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_x86_64.h> - - -void -x86_64_destr (bh) - Ebl *bh; -{ - /* Nothing to do so far. */ -} diff --git a/libebl/x86_64_init.c b/libebl/x86_64_init.c deleted file mode 100644 index 5d922059..00000000 --- a/libebl/x86_64_init.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Initialization of x86-64 specific backend library. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <libebl_x86_64.h> - - -int -x86_64_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; - Ebl *eh; - size_t ehlen; -{ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return 1; - - /* We handle it. */ - eh->name = "AMD x86-64"; - eh->reloc_type_name = x86_64_reloc_type_name; - eh->reloc_type_check = x86_64_reloc_type_check; - eh->reloc_valid_use = x86_64_reloc_valid_use; - //eh->core_note = i386_core_note; - eh->destr = x86_64_destr; - - return 0; -} diff --git a/libebl/x86_64_symbol.c b/libebl/x86_64_symbol.c deleted file mode 100644 index b0f53ea9..00000000 --- a/libebl/x86_64_symbol.c +++ /dev/null @@ -1,107 +0,0 @@ -/* x86_64 specific symbolic name handling. - Copyright (C) 2002 Red Hat, Inc. - Written by Ulrich Drepper <drepper@redhat.com>, 2002. - - This program is Open Source software; you can redistribute it and/or - modify it under the terms of the Open Software License version 1.0 as - published by the Open Source Initiative. - - You should have received a copy of the Open Software License along - with this program; if not, you may obtain a copy of the Open Software - License version 1.0 from http://www.opensource.org/licenses/osl.php or - by writing the Open Source Initiative c/o Lawrence Rosen, Esq., - 3001 King Ranch Road, Ukiah, CA 95482. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <assert.h> -#include <elf.h> -#include <stddef.h> - -#include <libebl_x86_64.h> - - -/* Return of the backend. */ -const char * -x86_64_backend_name (void) -{ - return "x86-64"; -} - - -/* Relocation mapping table. */ -static struct -{ - const char *name; - enum { both = 0, rel = 1, exec = 2 } appear; -} reloc_map_table[] = - { - [R_X86_64_NONE] = { "R_X86_64_NONE", both }, - [R_X86_64_64] = { "R_X86_64_64", rel }, - [R_X86_64_PC32] = { "R_X86_64_PC32", rel }, - [R_X86_64_GOT32] = { "R_X86_64_GOT32", rel }, - [R_X86_64_PLT32] = { "R_X86_64_PLT32", rel }, - [R_X86_64_COPY] = { "R_X86_64_COPY", exec }, - [R_X86_64_GLOB_DAT] = { "R_X86_64_GLOB_DAT", exec }, - [R_X86_64_JUMP_SLOT] = { "R_X86_64_JUMP_SLOT", exec }, - [R_X86_64_RELATIVE] = { "R_X86_64_RELATIVE", exec }, - [R_X86_64_GOTPCREL] = { "R_X86_64_GOTPCREL", exec }, - [R_X86_64_32] = { "R_X86_64_32", rel }, - [R_X86_64_32S] = { "R_X86_64_32S", rel }, - [R_X86_64_16] = { "R_X86_64_16", rel }, - [R_X86_64_PC16] = { "R_X86_64_PC16", rel }, - [R_X86_64_8] = { "R_X86_64_8", rel }, - [R_X86_64_PC8] = { "R_X86_64_PC8", rel }, - [R_X86_64_DTPMOD64] = { "R_X86_64_DTPMOD64", rel }, - [R_X86_64_DTPOFF64] = { "R_X86_64_DTPOFF64", rel }, - [R_X86_64_TPOFF64] = { "R_X86_64_TPOFF64", rel }, - [R_X86_64_TLSGD] = { "R_X86_64_TLSGD", rel }, - [R_X86_64_TLSLD] = { "R_X86_64_TLSLD", rel }, - [R_X86_64_DTPOFF32] = { "R_X86_64_DTPOFF32", rel }, - [R_X86_64_GOTTPOFF] = { "R_X86_64_GOTTPOFF", rel }, - [R_X86_64_TPOFF32] = { "R_X86_64_TPOFF32", rel } - }; - - -/* Determine relocation type string for x86-64. */ -const char * -x86_64_reloc_type_name (int type, char *buf, size_t len) -{ - if (type < 0 || type >= R_X86_64_NUM) - return NULL; - - return reloc_map_table[type].name; -} - - -/* Check for correct relocation type. */ -bool -x86_64_reloc_type_check (int type) -{ - return (type >= R_X86_64_NONE && type < R_X86_64_NUM - && reloc_map_table[type].name != NULL) ? true : false; -} - - -/* Check for correct relocation type use. */ -bool -x86_64_reloc_valid_use (Elf *elf, int type) -{ - if (type < R_X86_64_NONE || type >= R_X86_64_NUM - || reloc_map_table[type].name == NULL) - return false; - - Elf64_Ehdr *ehdr = elf64_getehdr (elf); - assert (ehdr != NULL); - - if (reloc_map_table[type].appear == rel) - return ehdr->e_type == ET_REL; - - if (reloc_map_table[type].appear == exec) - return ehdr->e_type != ET_REL; - - assert (reloc_map_table[type].appear == both); - return true; -} |