Date: Fri, 9 Oct 2015 18:39:55 +0000 (UTC) From: Alexander Kabaev <kan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289076 - in head/contrib/elftoolchain: common readelf Message-ID: <201510091839.t99Idt4m061704@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kan Date: Fri Oct 9 18:39:55 2015 New Revision: 289076 URL: https://svnweb.freebsd.org/changeset/base/289076 Log: Add definitions for MIPS TLS relocations to elftoolchain. This makes our readelf more useful when looking for TLS-related issues. Modified: head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Oct 9 18:39:52 2015 (r289075) +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Oct 9 18:39:55 2015 (r289076) @@ -1659,25 +1659,38 @@ _ELF_DEFINE_RELOC(R_IA_64_DTPREL64MSB, _ELF_DEFINE_RELOC(R_IA_64_DTPREL64LSB, 0xB7) \ _ELF_DEFINE_RELOC(R_IA_64_LTOFF_DTPREL22, 0xBA) -#define _ELF_DEFINE_MIPS_RELOCATIONS() \ -_ELF_DEFINE_RELOC(R_MIPS_NONE, 0) \ -_ELF_DEFINE_RELOC(R_MIPS_16, 1) \ -_ELF_DEFINE_RELOC(R_MIPS_32, 2) \ -_ELF_DEFINE_RELOC(R_MIPS_REL32, 3) \ -_ELF_DEFINE_RELOC(R_MIPS_26, 4) \ -_ELF_DEFINE_RELOC(R_MIPS_HI16, 5) \ -_ELF_DEFINE_RELOC(R_MIPS_LO16, 6) \ -_ELF_DEFINE_RELOC(R_MIPS_GPREL16, 7) \ -_ELF_DEFINE_RELOC(R_MIPS_LITERAL, 8) \ -_ELF_DEFINE_RELOC(R_MIPS_GOT16, 9) \ -_ELF_DEFINE_RELOC(R_MIPS_PC16, 10) \ -_ELF_DEFINE_RELOC(R_MIPS_CALL16, 11) \ -_ELF_DEFINE_RELOC(R_MIPS_GPREL32, 12) \ -_ELF_DEFINE_RELOC(R_MIPS_64, 18) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTHI16, 21) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTLO16, 22) \ -_ELF_DEFINE_RELOC(R_MIPS_CALLHI16, 30) \ -_ELF_DEFINE_RELOC(R_MIPS_CALLLO16, 31) +#define _ELF_DEFINE_MIPS_RELOCATIONS() \ +_ELF_DEFINE_RELOC(R_MIPS_NONE, 0) \ +_ELF_DEFINE_RELOC(R_MIPS_16, 1) \ +_ELF_DEFINE_RELOC(R_MIPS_32, 2) \ +_ELF_DEFINE_RELOC(R_MIPS_REL32, 3) \ +_ELF_DEFINE_RELOC(R_MIPS_26, 4) \ +_ELF_DEFINE_RELOC(R_MIPS_HI16, 5) \ +_ELF_DEFINE_RELOC(R_MIPS_LO16, 6) \ +_ELF_DEFINE_RELOC(R_MIPS_GPREL16, 7) \ +_ELF_DEFINE_RELOC(R_MIPS_LITERAL, 8) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT16, 9) \ +_ELF_DEFINE_RELOC(R_MIPS_PC16, 10) \ +_ELF_DEFINE_RELOC(R_MIPS_CALL16, 11) \ +_ELF_DEFINE_RELOC(R_MIPS_GPREL32, 12) \ +_ELF_DEFINE_RELOC(R_MIPS_64, 18) \ +_ELF_DEFINE_RELOC(R_MIPS_GOTHI16, 21) \ +_ELF_DEFINE_RELOC(R_MIPS_GOTLO16, 22) \ +_ELF_DEFINE_RELOC(R_MIPS_CALLHI16, 30) \ +_ELF_DEFINE_RELOC(R_MIPS_CALLLO16, 31) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD32 38) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL32 39) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD64 40) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL64 41) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_GD 42) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_LDM 43) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL_HI16 44) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL_LO16 45) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_GOTTPREL 46) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL32 47) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL64 48) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL_HI16 49) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL_LO16 50) #define _ELF_DEFINE_PPC32_RELOCATIONS() \ _ELF_DEFINE_RELOC(R_PPC_NONE, 0) \ Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Oct 9 18:39:52 2015 (r289075) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Oct 9 18:39:55 2015 (r289076) @@ -1295,6 +1295,20 @@ r_type(unsigned int mach, unsigned int t case 22: return "R_MIPS_GOTLO16"; case 30: return "R_MIPS_CALLHI16"; case 31: return "R_MIPS_CALLLO16"; + case 38: return "R_MIPS_TLS_DTPMOD32"; + case 39: return "R_MIPS_TLS_DTPREL32"; + case 40: return "R_MIPS_TLS_DTPMOD64"; + case 41: return "R_MIPS_TLS_DTPREL64"; + case 42: return "R_MIPS_TLS_GD"; + case 43: return "R_MIPS_TLS_LDM"; + case 44: return "R_MIPS_TLS_DTPREL_HI16"; + case 45: return "R_MIPS_TLS_DTPREL_LO16"; + case 46: return "R_MIPS_TLS_GOTTPREL"; + case 47: return "R_MIPS_TLS_TPREL32"; + case 48: return "R_MIPS_TLS_TPREL64"; + case 49: return "R_MIPS_TLS_TPREL_HI16"; + case 50: return "R_MIPS_TLS_TPREL_LO16"; + default: return ""; } case EM_PPC:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510091839.t99Idt4m061704>