Deleted Added
full compact
reloc.c (210629) reloc.c (211130)
1/* $NetBSD: mips_reloc.c,v 1.58 2010/01/14 11:57:06 skrll Exp $ */
2
3/*
4 * Copyright 1997 Michael L. Hitch <mhitch@montana.edu>
5 * Portions copyright 2002 Charles M. Hannum <root@ihack.net>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/* $NetBSD: mips_reloc.c,v 1.58 2010/01/14 11:57:06 skrll Exp $ */
2
3/*
4 * Copyright 1997 Michael L. Hitch <mhitch@montana.edu>
5 * Portions copyright 2002 Charles M. Hannum <root@ihack.net>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/libexec/rtld-elf/mips/reloc.c 210629 2010-07-29 20:18:52Z jchandra $");
32__FBSDID("$FreeBSD: head/libexec/rtld-elf/mips/reloc.c 211130 2010-08-10 05:15:35Z neel $");
33
34#include <sys/types.h>
35#include <sys/stat.h>
36#include <sys/endian.h>
37
38#include <stdlib.h>
39#include <string.h>
40

--- 29 unchanged lines hidden (view full) ---

70 * It is possible for the compiler to emit relocations for unaligned data.
71 * We handle this situation with these inlines.
72 */
73#ifdef __mips_n64
74/*
75 * ELF64 MIPS encodes the relocs uniquely. The first 32-bits of info contain
76 * the symbol index. The top 32-bits contain three relocation types encoded
77 * in big-endian integer with first relocation in LSB. This means for little
33
34#include <sys/types.h>
35#include <sys/stat.h>
36#include <sys/endian.h>
37
38#include <stdlib.h>
39#include <string.h>
40

--- 29 unchanged lines hidden (view full) ---

70 * It is possible for the compiler to emit relocations for unaligned data.
71 * We handle this situation with these inlines.
72 */
73#ifdef __mips_n64
74/*
75 * ELF64 MIPS encodes the relocs uniquely. The first 32-bits of info contain
76 * the symbol index. The top 32-bits contain three relocation types encoded
77 * in big-endian integer with first relocation in LSB. This means for little
78 * endian we have to byte swap that interger (r_type).
78 * endian we have to byte swap that integer (r_type).
79 */
80#define Elf_Sxword Elf64_Sxword
81#define ELF_R_NXTTYPE_64_P(r_type) ((((r_type) >> 8) & 0xff) == R_TYPE(64))
82#if BYTE_ORDER == LITTLE_ENDIAN
83#undef ELF_R_SYM
84#undef ELF_R_TYPE
85#define ELF_R_SYM(r_info) ((r_info) & 0xffffffff)
79 */
80#define Elf_Sxword Elf64_Sxword
81#define ELF_R_NXTTYPE_64_P(r_type) ((((r_type) >> 8) & 0xff) == R_TYPE(64))
82#if BYTE_ORDER == LITTLE_ENDIAN
83#undef ELF_R_SYM
84#undef ELF_R_TYPE
85#define ELF_R_SYM(r_info) ((r_info) & 0xffffffff)
86#define ELF_R_TYPE(r_info) bswap32((r_info) >> 32)
86#define ELF_R_TYPE(r_info) bswap32(((r_info) >> 32))
87#endif
88#else
89#define ELF_R_NXTTYPE_64_P(r_type) (0)
90#define Elf_Sxword Elf32_Sword
91#endif
92
93static __inline Elf_Sxword
94load_ptr(void *where, size_t len)

--- 424 unchanged lines hidden ---
87#endif
88#else
89#define ELF_R_NXTTYPE_64_P(r_type) (0)
90#define Elf_Sxword Elf32_Sword
91#endif
92
93static __inline Elf_Sxword
94load_ptr(void *where, size_t len)

--- 424 unchanged lines hidden ---