mailing list of musl libc
 help / color / mirror / code / Atom feed
dcc1bde052d0f5275a769f208f968744c17a7518 blob 2652 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
 
#ifndef _INTERNAL_RELOC_H
#define _INTERNAL_RELOC_H

#include <features.h>
#include <elf.h>
#include <stdint.h>

#if UINTPTR_MAX == 0xffffffff
typedef Elf32_Ehdr Ehdr;
typedef Elf32_Phdr Phdr;
typedef Elf32_Sym Sym;
#define R_TYPE(x) ((x)&255)
#define R_SYM(x) ((x)>>8)
#define R_INFO	ELF32_R_INFO
#else
typedef Elf64_Ehdr Ehdr;
typedef Elf64_Phdr Phdr;
typedef Elf64_Sym Sym;
#define R_TYPE(x) ((x)&0x7fffffff)
#define R_SYM(x) ((x)>>32)
#define R_INFO	ELF64_R_INFO
#define ELF64 1
#endif

#ifdef __mips64
#undef R_TYPE
#undef R_SYM
#undef R_INFO
#define R_TYPE(INFO) ({										\
	uint64_t r_info = (INFO);								\
	uint32_t *type, r_type;									\
	type = (((uint32_t*) &r_info) + 1);						\
	r_type = (uint32_t) *(((unsigned char*) type) + 3) |	\
	(uint32_t) *(((unsigned char*) type) + 2) << 8 |		\
	(uint32_t) *(((unsigned char*) type) + 1) << 16;		\
	r_type;													\
})

#define R_SYM(INFO) ({						\
	uint64_t r_info = (INFO);				\
	uint32_t symidx;						\
	symidx = *(((uint32_t*) &r_info) + 0);	\
	symidx;									\
})

#define R_INFO(SYM,TYPE1) ({					\
	uint32_t *pinfo;							\
	uint64_t r_info = 0;						\
	pinfo = ((uint32_t*) &r_info) + 1;			\
	*((uint32_t*) &r_info + 0) = (SYM);			\
	*((unsigned char*) pinfo + 3) = (TYPE1);	\
	r_info;										\
})
#endif


/* These enum constants provide unmatchable default values for
 * any relocation type the arch does not use. */
enum {
	REL_NONE = 0,
	REL_SYMBOLIC = -100,
	REL_GOT,
	REL_PLT,
	REL_RELATIVE,
	REL_OFFSET,
	REL_OFFSET32,
	REL_COPY,
	REL_SYM_OR_REL,
	REL_DTPMOD,
	REL_DTPOFF,
	REL_TPOFF,
	REL_TPOFF_NEG,
	REL_TLSDESC,
	REL_FUNCDESC,
	REL_FUNCDESC_VAL,
};

struct fdpic_loadseg {
	uintptr_t addr, p_vaddr, p_memsz;
};

struct fdpic_loadmap {
	unsigned short version, nsegs;
	struct fdpic_loadseg segs[];
};

struct fdpic_dummy_loadmap {
	unsigned short version, nsegs;
	struct fdpic_loadseg segs[1];
};

#include "reloc.h"

#ifndef FDPIC_CONSTDISP_FLAG
#define FDPIC_CONSTDISP_FLAG 0
#endif

#ifndef DL_FDPIC
#define DL_FDPIC 0
#endif

#ifndef DL_NOMMU_SUPPORT
#define DL_NOMMU_SUPPORT 0
#endif

#if !DL_FDPIC
#define IS_RELATIVE(x,s) ( \
	(R_TYPE(x) == REL_RELATIVE) || \
	(R_TYPE(x) == REL_SYM_OR_REL && !R_SYM(x)) )
#else
#define IS_RELATIVE(x,s) ( ( \
	(R_TYPE(x) == REL_FUNCDESC_VAL) || \
	(R_TYPE(x) == REL_SYMBOLIC) ) \
	&& (((s)[R_SYM(x)].st_info & 0xf) == STT_SECTION) )
#endif

#ifndef NEED_MIPS_GOT_RELOCS
#define NEED_MIPS_GOT_RELOCS 0
#endif

#ifndef DT_DEBUG_INDIRECT
#define DT_DEBUG_INDIRECT 0
#endif

#define AUX_CNT 32
#define DYN_CNT 32

typedef void (*stage2_func)(unsigned char *, size_t *);
typedef _Noreturn void (*stage3_func)(size_t *);

#endif
debug log:

solving dcc1bde ...
found dcc1bde in https://inbox.vuxu.org/musl/DE16056458B9894F9D46202EC1BBB28B3BE15ED6@PUMAIL01.pu.imgtec.org/
found 48890b2 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 48890b2db50ec5bc6178b506964c6eb900f6bdb4	src/internal/dynlink.h

applying [1/1] https://inbox.vuxu.org/musl/DE16056458B9894F9D46202EC1BBB28B3BE15ED6@PUMAIL01.pu.imgtec.org/
diff --git a/src/internal/dynlink.h b/src/internal/dynlink.h
index 48890b2..dcc1bde 100644

Checking patch src/internal/dynlink.h...
Applied patch src/internal/dynlink.h cleanly.

index at:
100644 dcc1bde052d0f5275a769f208f968744c17a7518	src/internal/dynlink.h

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).