]> git.wh0rd.org - ICEs.git/blame - bfin-text-sect-attrs/ldso.i.0
more
[ICEs.git] / bfin-text-sect-attrs / ldso.i.0
CommitLineData
bd3239d2
MF
1# 1 "ldso/ldso/ldso.c"
2# 1 "<built-in>"
3#define __STDC__ 1
4#define __STDC_HOSTED__ 1
5#define __GNUC__ 4
6#define __GNUC_MINOR__ 5
7#define __GNUC_PATCHLEVEL__ 3
8#define __SIZE_TYPE__ long unsigned int
9#define __PTRDIFF_TYPE__ long int
10#define __WCHAR_TYPE__ int
11#define __WINT_TYPE__ unsigned int
12#define __INTMAX_TYPE__ long long int
13#define __UINTMAX_TYPE__ long long unsigned int
14#define __CHAR16_TYPE__ short unsigned int
15#define __CHAR32_TYPE__ unsigned int
16#define __SIG_ATOMIC_TYPE__ int
17#define __INT8_TYPE__ signed char
18#define __INT16_TYPE__ short int
19#define __INT32_TYPE__ int
20#define __INT64_TYPE__ long long int
21#define __UINT8_TYPE__ unsigned char
22#define __UINT16_TYPE__ short unsigned int
23#define __UINT32_TYPE__ unsigned int
24#define __UINT64_TYPE__ long long unsigned int
25#define __INT_LEAST8_TYPE__ signed char
26#define __INT_LEAST16_TYPE__ short int
27#define __INT_LEAST32_TYPE__ int
28#define __INT_LEAST64_TYPE__ long long int
29#define __UINT_LEAST8_TYPE__ unsigned char
30#define __UINT_LEAST16_TYPE__ short unsigned int
31#define __UINT_LEAST32_TYPE__ unsigned int
32#define __UINT_LEAST64_TYPE__ long long unsigned int
33#define __INT_FAST8_TYPE__ signed char
34#define __INT_FAST16_TYPE__ int
35#define __INT_FAST32_TYPE__ int
36#define __INT_FAST64_TYPE__ long long int
37#define __UINT_FAST8_TYPE__ unsigned char
38#define __UINT_FAST16_TYPE__ unsigned int
39#define __UINT_FAST32_TYPE__ unsigned int
40#define __UINT_FAST64_TYPE__ long long unsigned int
41#define __INTPTR_TYPE__ int
42#define __UINTPTR_TYPE__ unsigned int
43#define __GXX_ABI_VERSION 1002
44#define __SCHAR_MAX__ 127
45#define __SHRT_MAX__ 32767
46#define __INT_MAX__ 2147483647
47#define __LONG_MAX__ 2147483647L
48#define __LONG_LONG_MAX__ 9223372036854775807LL
49#define __WCHAR_MAX__ 2147483647
50#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
51#define __WINT_MAX__ 4294967295U
52#define __WINT_MIN__ 0U
53#define __PTRDIFF_MAX__ 2147483647L
54#define __SIZE_MAX__ 4294967295UL
55#define __CHAR_BIT__ 8
56#define __INTMAX_MAX__ 9223372036854775807LL
57#define __INTMAX_C(c) c ## LL
58#define __UINTMAX_MAX__ 18446744073709551615ULL
59#define __UINTMAX_C(c) c ## ULL
60#define __SIG_ATOMIC_MAX__ 2147483647
61#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
62#define __INT8_MAX__ 127
63#define __INT16_MAX__ 32767
64#define __INT32_MAX__ 2147483647
65#define __INT64_MAX__ 9223372036854775807LL
66#define __UINT8_MAX__ 255
67#define __UINT16_MAX__ 65535
68#define __UINT32_MAX__ 4294967295U
69#define __UINT64_MAX__ 18446744073709551615ULL
70#define __INT_LEAST8_MAX__ 127
71#define __INT8_C(c) c
72#define __INT_LEAST16_MAX__ 32767
73#define __INT16_C(c) c
74#define __INT_LEAST32_MAX__ 2147483647
75#define __INT32_C(c) c
76#define __INT_LEAST64_MAX__ 9223372036854775807LL
77#define __INT64_C(c) c ## LL
78#define __UINT_LEAST8_MAX__ 255
79#define __UINT8_C(c) c
80#define __UINT_LEAST16_MAX__ 65535
81#define __UINT16_C(c) c
82#define __UINT_LEAST32_MAX__ 4294967295U
83#define __UINT32_C(c) c ## U
84#define __UINT_LEAST64_MAX__ 18446744073709551615ULL
85#define __UINT64_C(c) c ## ULL
86#define __INT_FAST8_MAX__ 127
87#define __INT_FAST16_MAX__ 2147483647
88#define __INT_FAST32_MAX__ 2147483647
89#define __INT_FAST64_MAX__ 9223372036854775807LL
90#define __UINT_FAST8_MAX__ 255
91#define __UINT_FAST16_MAX__ 4294967295U
92#define __UINT_FAST32_MAX__ 4294967295U
93#define __UINT_FAST64_MAX__ 18446744073709551615ULL
94#define __INTPTR_MAX__ 2147483647
95#define __UINTPTR_MAX__ 4294967295U
96#define __FLT_EVAL_METHOD__ 0
97#define __DEC_EVAL_METHOD__ 2
98#define __FLT_RADIX__ 2
99#define __FLT_MANT_DIG__ 24
100#define __FLT_DIG__ 6
101#define __FLT_MIN_EXP__ (-125)
102#define __FLT_MIN_10_EXP__ (-37)
103#define __FLT_MAX_EXP__ 128
104#define __FLT_MAX_10_EXP__ 38
105#define __FLT_MAX__ 3.4028234663852886e+38F
106#define __FLT_MIN__ 1.1754943508222875e-38F
107#define __FLT_EPSILON__ 1.1920928955078125e-7F
108#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
109#define __FLT_HAS_DENORM__ 1
110#define __FLT_HAS_INFINITY__ 1
111#define __FLT_HAS_QUIET_NAN__ 1
112#define __DBL_MANT_DIG__ 53
113#define __DBL_DIG__ 15
114#define __DBL_MIN_EXP__ (-1021)
115#define __DBL_MIN_10_EXP__ (-307)
116#define __DBL_MAX_EXP__ 1024
117#define __DBL_MAX_10_EXP__ 308
118#define __DBL_MAX__ ((double)1.7976931348623157e+308L)
119#define __DBL_MIN__ ((double)2.2250738585072014e-308L)
120#define __DBL_EPSILON__ ((double)2.2204460492503131e-16L)
121#define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L)
122#define __DBL_HAS_DENORM__ 1
123#define __DBL_HAS_INFINITY__ 1
124#define __DBL_HAS_QUIET_NAN__ 1
125#define __LDBL_MANT_DIG__ 53
126#define __LDBL_DIG__ 15
127#define __LDBL_MIN_EXP__ (-1021)
128#define __LDBL_MIN_10_EXP__ (-307)
129#define __LDBL_MAX_EXP__ 1024
130#define __LDBL_MAX_10_EXP__ 308
131#define __DECIMAL_DIG__ 17
132#define __LDBL_MAX__ 1.7976931348623157e+308L
133#define __LDBL_MIN__ 2.2250738585072014e-308L
134#define __LDBL_EPSILON__ 2.2204460492503131e-16L
135#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
136#define __LDBL_HAS_DENORM__ 1
137#define __LDBL_HAS_INFINITY__ 1
138#define __LDBL_HAS_QUIET_NAN__ 1
139#define __DEC32_MANT_DIG__ 7
140#define __DEC32_MIN_EXP__ (-94)
141#define __DEC32_MAX_EXP__ 97
142#define __DEC32_MIN__ 1E-95DF
143#define __DEC32_MAX__ 9.999999E96DF
144#define __DEC32_EPSILON__ 1E-6DF
145#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
146#define __DEC64_MANT_DIG__ 16
147#define __DEC64_MIN_EXP__ (-382)
148#define __DEC64_MAX_EXP__ 385
149#define __DEC64_MIN__ 1E-383DD
150#define __DEC64_MAX__ 9.999999999999999E384DD
151#define __DEC64_EPSILON__ 1E-15DD
152#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
153#define __DEC128_MANT_DIG__ 34
154#define __DEC128_MIN_EXP__ (-6142)
155#define __DEC128_MAX_EXP__ 6145
156#define __DEC128_MIN__ 1E-6143DL
157#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
158#define __DEC128_EPSILON__ 1E-33DL
159#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
160#define __REGISTER_PREFIX__
161#define __USER_LABEL_PREFIX__ _
162#define __VERSION__ "4.5.3"
163#define __GNUC_GNU_INLINE__ 1
164#define __OPTIMIZE_SIZE__ 1
165#define __OPTIMIZE__ 1
166#define __FINITE_MATH_ONLY__ 0
167#define __pic__ 1
168#define __PIC__ 1
169#define __pie__ 1
170#define __PIE__ 1
171#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
172#define __PRAGMA_REDEFINE_EXTNAME 1
173#define __SIZEOF_INT__ 4
174#define __SIZEOF_LONG__ 4
175#define __SIZEOF_LONG_LONG__ 8
176#define __SIZEOF_SHORT__ 2
177#define __SIZEOF_FLOAT__ 4
178#define __SIZEOF_DOUBLE__ 8
179#define __SIZEOF_LONG_DOUBLE__ 8
180#define __SIZEOF_SIZE_T__ 4
181#define __SIZEOF_WCHAR_T__ 4
182#define __SIZEOF_WINT_T__ 4
183#define __SIZEOF_PTRDIFF_T__ 4
184#define __SIZEOF_POINTER__ 4
185#define __bfin 1
186#define __bfin__ 1
187#define bfin 1
188#define __BFIN 1
189#define __BFIN__ 1
190#define BFIN 1
191#define __ADSPBLACKFIN__ 1
192#define __ADSPLPBLACKFIN__ 1
193#define __SILICON_REVISION__ 0xffff
194#define __WORKAROUNDS_ENABLED 1
195#define __WORKAROUND_SPECULATIVE_LOADS 1
196#define __WORKAROUND_SPECULATIVE_SYNCS 1
197#define __WORKAROUND_RETS 1
198#define __WORKAROUND_UNSAFE_NULL_ADDR 1
199#define __BFIN_FDPIC__ 1
200#define __FDPIC__ 1
201#define __gnu_linux__ 1
202#define __linux 1
203#define __linux__ 1
204#define linux 1
205#define __unix 1
206#define __unix__ 1
207#define unix 1
208#define __ELF__ 1
209#define __BIGGEST_ALIGNMENT__ 4
210# 1 "<command-line>"
211#define NDEBUG 1
212#define __UCLIBC_UNDERSCORES__ 1
213#define NOT_IN_libc 1
214#define IS_IN_rtld 1
215#define UCLIBC_RUNTIME_PREFIX "/usr/bfin-linux-uclibc/"
216#define UCLIBC_LDSO "ld-uClibc.so.0"
217#define LDSO_ELFINTERP "bfin/elfinterp.c"
218#define NOT_IN_libc 1
219#define IS_IN_rtld 1
220#define UCLIBC_RUNTIME_PREFIX "/usr/bfin-linux-uclibc/"
221#define UCLIBC_LDSO "ld-uClibc.so.0"
222# 1 "././include/libc-symbols.h" 1
223# 23 "././include/libc-symbols.h"
224#define _LIBC_SYMBOLS_H 1
225# 32 "././include/libc-symbols.h"
226#define _LIBC 1
227# 51 "././include/libc-symbols.h"
228# 1 "./include/bits/uClibc_arch_features.h" 1
229
230
231
232
233
234#define _BITS_UCLIBC_ARCH_FEATURES_H
235
236
237#define __UCLIBC_ABORT_INSTRUCTION__ ".short 2"
238
239
240#define __UCLIBC_MMAP_HAS_6_ARGS__
241
242
243#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
244
245
246#undef __UCLIBC_BROKEN_CREATE_MODULE__
247
248
249#undef __UCLIBC_HANDLE_OLDER_RLIMIT__
250
251
252#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
253
254
255#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
256
257
258#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
259
260
261#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
262
263
264#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
265
266
267#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
268
269
270#define __UCLIBC_HAVE_SIGNED_ZERO__
271
272
273#undef __UCLIBC_ASM_LINE_SEP__
274# 52 "././include/libc-symbols.h" 2
275
276
277#define _GNU_SOURCE 1
278
279
280
281
282
283
284#define likely(x) __builtin_expect((!!(x)),1)
285
286
287#define unlikely(x) __builtin_expect((!!(x)),0)
288
289
290
291#define __cold __attribute__ ((__cold__))
292
293
294#define __hot __attribute__ ((__hot__))
295# 82 "././include/libc-symbols.h"
296#define __LINUX_COMPILER_H
297
298
299#define __cast__(_to)
300
301
302
303#define attribute_optimize(x) __attribute__ ((optimize(x)))
304
305
306
307
308#define attribute_unused __attribute__ ((unused))
309
310
311#define attribute_noreturn __attribute__ ((__noreturn__))
312
313
314
315
316#define libc_freeres_ptr(decl) __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
317
318
319#define __libc_freeres_fn_section __attribute__ ((section ("__libc_freeres_fn")))
320# 115 "././include/libc-symbols.h"
321#define __stringify_1(x) #x
322#define __stringify(x) __stringify_1(x)
323
324
325#define HAVE_ASM_SET_DIRECTIVE
326
327
328
329
330
331
332
333#define ASM_GLOBAL_DIRECTIVE .global
334
335
336
337#define HAVE_ASM_WEAK_DIRECTIVE
338
339
340
341
342
343
344
345#undef HAVE_ASM_WEAKEXT_DIRECTIVE
346
347
348
349
350
351#undef HAVE_ASM_GLOBAL_DOT_NAME
352
353
354
355
356
357#undef HAVE_ASM_CFI_DIRECTIVES
358
359
360
361#define HAVE_WEAK_SYMBOLS
362
363
364#undef C_SYMBOL_NAME
365
366
367
368
369#define C_SYMBOL_NAME(name) _ ##name
370
371
372
373
374
375
376#define ASM_LINE_SEP ;
377# 189 "././include/libc-symbols.h"
378#define strong_alias(name,aliasname) _strong_alias(name, aliasname)
379#define _strong_alias(name,aliasname) extern __typeof (name) aliasname __attribute__ ((alias (#name)));
380
381
382
383#define strong_alias_untyped(name,aliasname) _strong_alias_untyped(name, aliasname)
384
385#define _strong_alias_untyped(name,aliasname) extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
386
387
388
389
390#define weak_function __attribute__ ((weak))
391#define weak_const_function __attribute__ ((weak, __const__))
392
393
394
395
396
397#define weak_alias(name,aliasname) _weak_alias (name, aliasname)
398#define _weak_alias(name,aliasname) extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
399
400
401
402#define weak_extern(symbol) _weak_extern (weak symbol)
403#define _weak_extern(expr) _Pragma (#expr)
404# 317 "././include/libc-symbols.h"
405#define internal_function
406
407
408
409
410#define __make_section_unallocated(section_string) __asm__ (".section " section_string "\n\t.previous");
411# 331 "././include/libc-symbols.h"
412#define __sec_comment "\n#APP\n\t#"
413
414
415
416
417
418#define link_warning(symbol,msg) __make_section_unallocated (".gnu.warning." #symbol) static const char __evoke_link_warning_ ##symbol[] __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) = msg;
419# 360 "././include/libc-symbols.h"
420#define INTUSE(name) name
421#define INTDEF(name)
422#define INTVARDEF(name)
423#define INTDEF2(name,newname)
424#define INTVARDEF2(name,newname)
425# 471 "././include/libc-symbols.h"
426#define attribute_hidden __attribute__ ((visibility ("hidden")))
427#define attribute_protected __attribute__ ((visibility ("protected")))
428#define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
429# 483 "././include/libc-symbols.h"
430#define hidden_proto(name,attrs...) __hidden_proto(name, __GI_ ##name, ##attrs)
431#define __hidden_proto(name,internal,attrs...) extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) __hidden_proto_hiddenattr (attrs);
432
433
434#define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
435#define __hidden_asmname1(prefix,name) __hidden_asmname2(prefix, name)
436#define __hidden_asmname2(prefix,name) #prefix name
437#define __hidden_ver1(local,internal,name) extern __typeof (name) __EI_ ##name __asm__(__hidden_asmname (#internal)); extern __typeof (name) __EI_ ##name __attribute__((alias (__hidden_asmname1 (,#local))))
438
439
440#define hidden_ver(local,name) __hidden_ver1(local, __GI_ ##name, name);
441#define hidden_data_ver(local,name) hidden_ver(local, name)
442#define hidden_def(name) __hidden_ver1(__GI_ ##name, name, name);
443#define hidden_data_def(name) hidden_def(name)
444#define hidden_weak(name) __hidden_ver1(__GI_ ##name, name, name) __attribute__((weak));
445
446#define hidden_data_weak(name) hidden_weak(name)
447# 586 "././include/libc-symbols.h"
448#define versioned_symbol(lib,local,symbol,version)
449#undef hidden_ver
450#define hidden_ver(local,name)
451#undef hidden_data_ver
452#define hidden_data_ver(local,name)
453# 601 "././include/libc-symbols.h"
454#define libc_hidden_proto(name,attrs...)
455#define libc_hidden_def(name)
456#define libc_hidden_weak(name)
457#define libc_hidden_ver(local,name)
458#define libc_hidden_data_def(name)
459#define libc_hidden_data_weak(name)
460#define libc_hidden_data_ver(local,name)
461
462
463
464#define rtld_hidden_proto(name,attrs...) hidden_proto (name, ##attrs)
465#define rtld_hidden_def(name) hidden_def (name)
466#define rtld_hidden_weak(name) hidden_weak (name)
467#define rtld_hidden_ver(local,name) hidden_ver (local, name)
468#define rtld_hidden_data_def(name) hidden_data_def (name)
469#define rtld_hidden_data_weak(name) hidden_data_weak (name)
470#define rtld_hidden_data_ver(local,name) hidden_data_ver (local, name)
471# 637 "././include/libc-symbols.h"
472#define libm_hidden_proto(name,attrs...)
473#define libm_hidden_def(name)
474#define libm_hidden_weak(name)
475#define libm_hidden_ver(local,name)
476#define libm_hidden_data_def(name)
477#define libm_hidden_data_weak(name)
478#define libm_hidden_data_ver(local,name)
479# 655 "././include/libc-symbols.h"
480#define libresolv_hidden_proto(name,attrs...)
481#define libresolv_hidden_def(name)
482#define libresolv_hidden_weak(name)
483#define libresolv_hidden_ver(local,name)
484#define libresolv_hidden_data_def(name)
485#define libresolv_hidden_data_weak(name)
486#define libresolv_hidden_data_ver(local,name)
487# 673 "././include/libc-symbols.h"
488#define librt_hidden_proto(name,attrs...)
489#define librt_hidden_def(name)
490#define librt_hidden_weak(name)
491#define librt_hidden_ver(local,name)
492#define librt_hidden_data_def(name)
493#define librt_hidden_data_weak(name)
494#define librt_hidden_data_ver(local,name)
495# 691 "././include/libc-symbols.h"
496#define libdl_hidden_proto(name,attrs...)
497#define libdl_hidden_def(name)
498#define libdl_hidden_weak(name)
499#define libdl_hidden_ver(local,name)
500#define libdl_hidden_data_def(name)
501#define libdl_hidden_data_weak(name)
502#define libdl_hidden_data_ver(local,name)
503# 709 "././include/libc-symbols.h"
504#define libintl_hidden_proto(name,attrs...)
505#define libintl_hidden_def(name)
506#define libintl_hidden_weak(name)
507#define libintl_hidden_ver(local,name)
508#define libintl_hidden_data_def(name)
509#define libintl_hidden_data_weak(name)
510#define libintl_hidden_data_ver(local,name)
511# 727 "././include/libc-symbols.h"
512#define libnsl_hidden_proto(name,attrs...)
513#define libnsl_hidden_def(name)
514#define libnsl_hidden_weak(name)
515#define libnsl_hidden_ver(local,name)
516#define libnsl_hidden_data_def(name)
517#define libnsl_hidden_data_weak(name)
518#define libnsl_hidden_data_ver(local,name)
519# 745 "././include/libc-symbols.h"
520#define libutil_hidden_proto(name,attrs...)
521#define libutil_hidden_def(name)
522#define libutil_hidden_weak(name)
523#define libutil_hidden_ver(local,name)
524#define libutil_hidden_data_def(name)
525#define libutil_hidden_data_weak(name)
526#define libutil_hidden_data_ver(local,name)
527# 763 "././include/libc-symbols.h"
528#define libcrypt_hidden_proto(name,attrs...)
529#define libcrypt_hidden_def(name)
530#define libcrypt_hidden_weak(name)
531#define libcrypt_hidden_ver(local,name)
532#define libcrypt_hidden_data_def(name)
533#define libcrypt_hidden_data_weak(name)
534#define libcrypt_hidden_data_ver(local,name)
535# 781 "././include/libc-symbols.h"
536#define libpthread_hidden_proto(name,attrs...)
537#define libpthread_hidden_def(name)
538#define libpthread_hidden_weak(name)
539#define libpthread_hidden_ver(local,name)
540#define libpthread_hidden_data_def(name)
541#define libpthread_hidden_data_weak(name)
542#define libpthread_hidden_data_ver(local,name)
543# 1 "<command-line>" 2
544# 1 "ldso/ldso/ldso.c"
545# 33 "ldso/ldso/ldso.c"
546# 1 "./ldso/include/ldso.h" 1
547# 9 "./ldso/include/ldso.h"
548#define _LDSO_H_
549
550# 1 "./include/features.h" 1
551# 20 "./include/features.h"
552#define _FEATURES_H 1
553# 95 "./include/features.h"
554#undef __USE_ISOC99
555#undef __USE_ISOC95
556#undef __USE_POSIX
557#undef __USE_POSIX2
558#undef __USE_POSIX199309
559#undef __USE_POSIX199506
560#undef __USE_XOPEN
561#undef __USE_XOPEN_EXTENDED
562#undef __USE_UNIX98
563#undef __USE_XOPEN2K
564#undef __USE_XOPEN2K8
565#undef __USE_LARGEFILE
566#undef __USE_LARGEFILE64
567#undef __USE_FILE_OFFSET64
568#undef __USE_BSD
569#undef __USE_SVID
570#undef __USE_MISC
571#undef __USE_ATFILE
572#undef __USE_GNU
573#undef __USE_REENTRANT
574#undef __USE_FORTIFY_LEVEL
575#undef __FAVOR_BSD
576#undef __KERNEL_STRICT_NAMES
577
578
579
580
581#define __KERNEL_STRICT_NAMES
582
583
584
585#define __USE_ANSI 1
586# 136 "./include/features.h"
587#define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
588# 153 "./include/features.h"
589#undef _ISOC99_SOURCE
590#define _ISOC99_SOURCE 1
591#undef _POSIX_SOURCE
592#define _POSIX_SOURCE 1
593#undef _POSIX_C_SOURCE
594#define _POSIX_C_SOURCE 200809L
595#undef _XOPEN_SOURCE
596#define _XOPEN_SOURCE 700
597#undef _XOPEN_SOURCE_EXTENDED
598#define _XOPEN_SOURCE_EXTENDED 1
599#undef _LARGEFILE64_SOURCE
600#define _LARGEFILE64_SOURCE 1
601#undef _BSD_SOURCE
602#define _BSD_SOURCE 1
603#undef _SVID_SOURCE
604#define _SVID_SOURCE 1
605#undef _ATFILE_SOURCE
606#define _ATFILE_SOURCE 1
607
608
609
610
611
612#define __UCLIBC__ 1
613# 186 "./include/features.h"
614#define __need_uClibc_config_h
615# 1 "./include/bits/uClibc_config.h" 1
616
617
618
619
620#define __UCLIBC_MAJOR__ 0
621#define __UCLIBC_MINOR__ 9
622#define __UCLIBC_SUBLEVEL__ 34
623
624
625
626#undef __TARGET_alpha__
627#undef __TARGET_arm__
628#undef __TARGET_avr32__
629#define __TARGET_bfin__ 1
630#undef __TARGET_cris__
631#undef __TARGET_e1__
632#undef __TARGET_frv__
633#undef __TARGET_h8300__
634#undef __TARGET_hppa__
635#undef __TARGET_i386__
636#undef __TARGET_i960__
637#undef __TARGET_ia64__
638#undef __TARGET_m68k__
639#undef __TARGET_microblaze__
640#undef __TARGET_mips__
641#undef __TARGET_nios__
642#undef __TARGET_nios2__
643#undef __TARGET_powerpc__
644#undef __TARGET_sh__
645#undef __TARGET_sh64__
646#undef __TARGET_sparc__
647#undef __TARGET_v850__
648#undef __TARGET_vax__
649#undef __TARGET_x86_64__
650#undef __TARGET_xtensa__
651#undef __TARGET_c6x__
652
653
654#define __TARGET_ARCH__ "bfin"
655#define __FORCE_OPTIONS_FOR_ARCH__ 1
656#define __TARGET_SUBARCH__ ""
657#undef __UCLIBC_FORMAT_ELF__
658#define __UCLIBC_FORMAT_FDPIC_ELF__ 1
659#undef __UCLIBC_FORMAT_DSBT_ELF__
660#undef __UCLIBC_FORMAT_FLAT__
661#undef __UCLIBC_FORMAT_FLAT_SEP_DATA__
662#undef __UCLIBC_FORMAT_SHARED_FLAT__
663#define __ARCH_LITTLE_ENDIAN__ 1
664
665
666#define __ARCH_HAS_NO_MMU__ 1
667
668
669#define __UCLIBC_HAS_FLOATS__ 1
670#define __UCLIBC_HAS_FPU__ 1
671#undef __DO_C99_MATH__
672#undef __DO_XSI_MATH__
673#undef __UCLIBC_HAS_FENV__
674#define __KERNEL_HEADERS__ "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include"
675#define __UCLIBC_UCLINUX_BROKEN_MUNMAP__ 1
676#define __HAVE_DOT_CONFIG__ 1
677
678
679#define __DOPIC__ 1
680#define __HAVE_SHARED__ 1
681#undef __FORCE_SHAREABLE_TEXT_SEGMENTS__
682#define __LDSO_LDD_SUPPORT__ 1
683#define __LDSO_CACHE_SUPPORT__ 1
684#define __LDSO_PRELOAD_ENV_SUPPORT__ 1
685#undef __LDSO_PRELOAD_FILE_SUPPORT__
686#define __LDSO_BASE_FILENAME__ "ld.so"
687#undef __LDSO_STANDALONE_SUPPORT__
688#undef __LDSO_PRELINK_SUPPORT__
689#define __UCLIBC_STATIC_LDCONFIG__ 1
690#define __LDSO_RUNPATH__ 1
691#define __LDSO_SEARCH_INTERP_PATH__ 1
692#define __LDSO_LD_LIBRARY_PATH__ 1
693#undef __LDSO_NO_CLEANUP__
694#define __UCLIBC_CTOR_DTOR__ 1
695#undef __LDSO_GNU_HASH_SUPPORT__
696#define __HAS_NO_THREADS__ 1
697#undef __LINUXTHREADS_OLD__
698#undef __LINUXTHREADS_NEW__
699#undef __UCLIBC_HAS_THREADS_NATIVE__
700#define __UCLIBC_HAS_SYSLOG__ 1
701#define __UCLIBC_HAS_LFS__ 1
702#define __MALLOC__ 1
703#undef __MALLOC_SIMPLE__
704#undef __MALLOC_STANDARD__
705#undef __MALLOC_GLIBC_COMPAT__
706#define __UCLIBC_DYNAMIC_ATEXIT__ 1
707#undef __COMPAT_ATEXIT__
708#undef __UCLIBC_SUSV3_LEGACY__
709#undef __UCLIBC_SUSV3_LEGACY_MACROS__
710#undef __UCLIBC_SUSV4_LEGACY__
711#undef __UCLIBC_STRICT_HEADERS__
712#undef __UCLIBC_HAS_STUBS__
713#define __UCLIBC_HAS_SHADOW__ 1
714#undef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
715#define __UCLIBC_HAS_PTY__ 1
716#define __ASSUME_DEVPTS__ 1
717#define __UNIX98PTY_ONLY__ 1
718#undef __UCLIBC_HAS_GETPT__
719#undef __UCLIBC_HAS_LIBUTIL__
720#define __UCLIBC_HAS_TM_EXTENSIONS__ 1
721#define __UCLIBC_HAS_TZ_CACHING__ 1
722#define __UCLIBC_HAS_TZ_FILE__ 1
723#define __UCLIBC_HAS_TZ_FILE_READ_MANY__ 1
724#define __UCLIBC_TZ_FILE_PATH__ "/etc/TZ"
725#define __UCLIBC_FALLBACK_TO_ETC_LOCALTIME__ 1
726
727
728#define __UCLIBC_PWD_BUFFER_SIZE__ 256
729#define __UCLIBC_GRP_BUFFER_SIZE__ 256
730
731
732#define __UCLIBC_LINUX_MODULE_26__ 1
733#define __UCLIBC_LINUX_SPECIFIC__ 1
734#define __UCLIBC_HAS_GNU_ERROR__ 1
735#define __UCLIBC_BSD_SPECIFIC__ 1
736#define __UCLIBC_HAS_BSD_ERR__ 1
737#undef __UCLIBC_HAS_OBSOLETE_BSD_SIGNAL__
738#undef __UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL__
739#undef __UCLIBC_NTP_LEGACY__
740#undef __UCLIBC_SV4_DEPRECATED__
741#define __UCLIBC_HAS_REALTIME__ 1
742#define __UCLIBC_HAS_ADVANCED_REALTIME__ 1
743#define __UCLIBC_HAS_EPOLL__ 1
744#define __UCLIBC_HAS_XATTR__ 1
745#define __UCLIBC_HAS_PROFILING__ 1
746#define __UCLIBC_HAS_CRYPT_IMPL__ 1
747#undef __UCLIBC_HAS_SHA256_CRYPT_IMPL__
748#undef __UCLIBC_HAS_SHA512_CRYPT_IMPL__
749#define __UCLIBC_HAS_CRYPT__ 1
750#define __UCLIBC_HAS_NETWORK_SUPPORT__ 1
751#define __UCLIBC_HAS_SOCKET__ 1
752#define __UCLIBC_HAS_IPV4__ 1
753#undef __UCLIBC_HAS_IPV6__
754#undef __UCLIBC_HAS_RPC__
755#undef __UCLIBC_USE_NETLINK__
756#undef __UCLIBC_HAS_BSD_RES_CLOSE__
757#define __UCLIBC_HAS_COMPAT_RES_STATE__ 1
758#undef __UCLIBC_HAS_EXTRA_COMPAT_RES_STATE__
759#undef __UCLIBC_HAS_RESOLVER_SUPPORT__
760#undef __UCLIBC_HAS_LIBRESOLV_STUB__
761#undef __UCLIBC_HAS_LIBNSL_STUB__
762
763
764#define __UCLIBC_HAS_STRING_GENERIC_OPT__ 1
765#define __UCLIBC_HAS_STRING_ARCH_OPT__ 1
766#define __UCLIBC_HAS_CTYPE_TABLES__ 1
767#define __UCLIBC_HAS_CTYPE_SIGNED__ 1
768#define __UCLIBC_HAS_CTYPE_UNSAFE__ 1
769#undef __UCLIBC_HAS_CTYPE_CHECKED__
770#undef __UCLIBC_HAS_CTYPE_ENFORCED__
771#undef __UCLIBC_HAS_WCHAR__
772#undef __UCLIBC_HAS_LOCALE__
773#undef __UCLIBC_HAS_HEXADECIMAL_FLOATS__
774#undef __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__
775#undef __USE_OLD_VFPRINTF__
776#define __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ 9
777#undef __UCLIBC_HAS_SCANF_GLIBC_A_FLAG__
778#undef __UCLIBC_HAS_STDIO_BUFSIZ_NONE__
779#undef __UCLIBC_HAS_STDIO_BUFSIZ_256__
780#undef __UCLIBC_HAS_STDIO_BUFSIZ_512__
781#undef __UCLIBC_HAS_STDIO_BUFSIZ_1024__
782#undef __UCLIBC_HAS_STDIO_BUFSIZ_2048__
783#define __UCLIBC_HAS_STDIO_BUFSIZ_4096__ 1
784#undef __UCLIBC_HAS_STDIO_BUFSIZ_8192__
785#define __UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE__ 1
786#undef __UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4__
787#undef __UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8__
788#undef __UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT__
789#define __UCLIBC_HAS_STDIO_GETC_MACRO__ 1
790#define __UCLIBC_HAS_STDIO_PUTC_MACRO__ 1
791#define __UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION__ 1
792#undef __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__
793#undef __UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE__
794#undef __UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE__
795#undef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
796#undef __UCLIBC_HAS_PRINTF_M_SPEC__
797#define __UCLIBC_HAS_ERRNO_MESSAGES__ 1
798#undef __UCLIBC_HAS_SYS_ERRLIST__
799#define __UCLIBC_HAS_SIGNUM_MESSAGES__ 1
800#undef __UCLIBC_HAS_SYS_SIGLIST__
801#define __UCLIBC_HAS_GNU_GETOPT__ 1
802#define __UCLIBC_HAS_GNU_GETSUBOPT__ 1
803
804
805#define __UCLIBC_HAS_REGEX__ 1
806#define __UCLIBC_HAS_REGEX_OLD__ 1
807#define __UCLIBC_HAS_FNMATCH__ 1
808#define __UCLIBC_HAS_FNMATCH_OLD__ 1
809#undef __UCLIBC_HAS_WORDEXP__
810#undef __UCLIBC_HAS_NFTW__
811#undef __UCLIBC_HAS_FTS__
812#define __UCLIBC_HAS_GLOB__ 1
813#undef __UCLIBC_HAS_GNU_GLOB__
814#undef __UCLIBC_HAS_UTMPX__
815
816
817#define __RUNTIME_PREFIX__ "/usr/$(TARGET_ARCH)-linux-uclibc/"
818#define __DEVEL_PREFIX__ "/usr/$(TARGET_ARCH)-linux-uclibc/usr/"
819#define __MULTILIB_DIR__ "lib"
820#define __HARDWIRED_ABSPATH__ 1
821
822
823#undef __UCLIBC_HAS_ARC4RANDOM__
824#undef __UCLIBC_HAS_SSP__
825#define __UCLIBC_BUILD_RELRO__ 1
826#undef __UCLIBC_BUILD_NOW__
827#define __UCLIBC_BUILD_NOEXECSTACK__ 1
828
829
830#define __CROSS_COMPILER_PREFIX__ "bfin-linux-uclibc-"
831#define __UCLIBC_EXTRA_CFLAGS__ ""
832#undef __DODEBUG__
833#define __DOSTRIP__ 1
834#undef __DOASSERTS__
835#undef __SUPPORT_LD_DEBUG__
836#undef __SUPPORT_LD_DEBUG_EARLY__
837#undef __UCLIBC_MALLOC_DEBUGGING__
838#undef __UCLIBC_HAS_BACKTRACE__
839#define __WARNINGS__ "-Wall"
840#undef __EXTRA_WARNINGS__
841#undef __DOMULTI__
842#undef __UCLIBC_MJN3_ONLY__
843# 188 "./include/features.h" 2
844#undef __need_uClibc_config_h
845# 198 "./include/features.h"
846#define __OPTIMIZE_SIZE__ 1
847
848
849#undef __LDBL_COMPAT
850
851
852#undef _FORTIFY_SOURCE
853# 243 "./include/features.h"
854#define __USE_ISOC99 1
855
856
857
858
859
860#define __USE_ISOC95 1
861# 270 "./include/features.h"
862#define __USE_POSIX 1
863
864
865
866#define __USE_POSIX2 1
867
868
869
870#define __USE_POSIX199309 1
871
872
873
874#define __USE_POSIX199506 1
875
876
877
878#define __USE_XOPEN2K 1
879#undef __USE_ISOC99
880#define __USE_ISOC99 1
881
882
883
884#define __USE_XOPEN2K8 1
885#undef _ATFILE_SOURCE
886#define _ATFILE_SOURCE 1
887
888
889
890#define __USE_XOPEN 1
891
892#define __USE_XOPEN_EXTENDED 1
893#define __USE_UNIX98 1
894#undef _LARGEFILE_SOURCE
895#define _LARGEFILE_SOURCE 1
896
897
898#define __USE_XOPEN2K8 1
899
900#define __USE_XOPEN2K 1
901#undef __USE_ISOC99
902#define __USE_ISOC99 1
903# 320 "./include/features.h"
904#define __USE_LARGEFILE 1
905
906
907
908#define __USE_LARGEFILE64 1
909
910
911
912
913
914
915
916#define __USE_MISC 1
917
918
919
920#define __USE_BSD 1
921
922
923
924#define __USE_SVID 1
925
926
927
928#define __USE_ATFILE 1
929
930
931
932#define __USE_GNU 1
933# 363 "./include/features.h"
934#define __USE_FORTIFY_LEVEL 0
935
936
937
938
939#define __STDC_IEC_559__ 1
940#define __STDC_IEC_559_COMPLEX__ 1
941# 400 "./include/features.h"
942#define __GLIBC_PREREQ(maj,min) ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
943# 416 "./include/features.h"
944# 1 "./include/sys/cdefs.h" 1
945# 21 "./include/sys/cdefs.h"
946#define _SYS_CDEFS_H 1
947# 36 "./include/sys/cdefs.h"
948#undef __P
949#undef __PMT
950# 47 "./include/sys/cdefs.h"
951#define __THROW __attribute__ ((__nothrow__))
952#define __NTH(fct) __attribute__ ((__nothrow__)) fct
953# 74 "./include/sys/cdefs.h"
954#define __P(args) args
955#define __PMT(args) args
956
957
958
959
960#define __CONCAT(x,y) x ## y
961#define __STRING(x) #x
962
963
964#define __ptr_t void *
965#define __long_double_t long double
966
967
968
969
970
971
972
973#define __BEGIN_DECLS
974#define __END_DECLS
975# 114 "./include/sys/cdefs.h"
976#define __BEGIN_NAMESPACE_STD
977#define __END_NAMESPACE_STD
978#define __USING_NAMESPACE_STD(name)
979#define __BEGIN_NAMESPACE_C99
980#define __END_NAMESPACE_C99
981#define __USING_NAMESPACE_C99(name)
982
983
984
985
986#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
987#define __bos0(ptr) __builtin_object_size (ptr, 0)
988
989
990#define __warndecl(name,msg) extern void name (void) __attribute__((__warning__ (msg)))
991
992#define __warnattr(msg) __attribute__((__warning__ (msg)))
993#define __errordecl(name,msg) extern void name (void) __attribute__((__error__ (msg)))
994# 142 "./include/sys/cdefs.h"
995#define __flexarr []
996# 169 "./include/sys/cdefs.h"
997#define __REDIRECT(name,proto,alias) name proto __asm__ (__ASMNAME (#alias))
998
999
1000
1001
1002#define __REDIRECT_NTH(name,proto,alias) name proto __asm__ (__ASMNAME (#alias)) __THROW
1003
1004
1005#define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
1006#define __ASMNAME2(prefix,cname) __STRING (prefix) cname
1007# 198 "./include/sys/cdefs.h"
1008#define __attribute_aligned__(size) __attribute__ ((__aligned__ (size)))
1009# 207 "./include/sys/cdefs.h"
1010#define __attribute_malloc__ __attribute__ ((__malloc__))
1011# 216 "./include/sys/cdefs.h"
1012#define __attribute_pure__ __attribute__ ((__pure__))
1013# 225 "./include/sys/cdefs.h"
1014#define __attribute_used__ __attribute__ ((__used__))
1015#define __attribute_noinline__ __attribute__ ((__noinline__))
1016
1017
1018
1019
1020
1021
1022
1023#define __attribute_deprecated__ __attribute__ ((__deprecated__))
1024# 246 "./include/sys/cdefs.h"
1025#define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
1026# 256 "./include/sys/cdefs.h"
1027#define __attribute_format_strfmon__(a,b) __attribute__ ((__format__ (__strfmon__, a, b)))
1028# 265 "./include/sys/cdefs.h"
1029#define __nonnull(params) __attribute__ ((__nonnull__ params))
1030
1031
1032
1033
1034
1035
1036
1037#define __attribute_warn_unused_result__ __attribute__ ((__warn_unused_result__))
1038# 282 "./include/sys/cdefs.h"
1039#define __wur
1040
1041
1042
1043
1044#define __always_inline __inline __attribute__ ((__always_inline__))
1045# 298 "./include/sys/cdefs.h"
1046#define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
1047
1048#define __extern_always_inline extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
1049# 315 "./include/sys/cdefs.h"
1050#define __va_arg_pack() __builtin_va_arg_pack ()
1051#define __va_arg_pack_len() __builtin_va_arg_pack_len ()
1052# 336 "./include/sys/cdefs.h"
1053#define __restrict_arr __restrict
1054# 417 "./include/features.h" 2
1055# 445 "./include/features.h"
1056#undef _FILE_OFFSET_BITS
1057#undef __USE_FILE_OFFSET64
1058
1059# 1 "./include/libc-internal.h" 1
1060# 20 "./include/libc-internal.h"
1061#define _LIBC_INTERNAL_H 1
1062
1063# 1 "./include/features.h" 1
1064# 23 "./include/libc-internal.h" 2
1065
1066
1067#define attribute_relro __attribute__ ((section (".data.rel.ro")))
1068# 77 "./include/libc-internal.h"
1069#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
1070# 449 "./include/features.h" 2
1071# 12 "./ldso/include/ldso.h" 2
1072# 28 "./ldso/include/ldso.h"
1073# 1 "./include/stdlib.h" 1
1074# 28 "./include/stdlib.h"
1075#define __need_size_t
1076
1077
1078
1079
1080#define __need_NULL
1081
1082# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 1 3 4
1083# 186 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1084#define __size_t__
1085#define __SIZE_T__
1086#define _SIZE_T
1087#define _SYS_SIZE_T_H
1088#define _T_SIZE_
1089#define _T_SIZE
1090#define __SIZE_T
1091#define _SIZE_T_
1092#define _BSD_SIZE_T_
1093#define _SIZE_T_DEFINED_
1094#define _SIZE_T_DEFINED
1095#define _BSD_SIZE_T_DEFINED_
1096#define _SIZE_T_DECLARED
1097#define ___int_size_t_h
1098#define _GCC_SIZE_T
1099#define _SIZET_
1100
1101
1102
1103#define __size_t
1104
1105
1106
1107
1108
1109typedef long unsigned int size_t;
1110# 233 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1111#undef __need_size_t
1112# 395 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1113#undef NULL
1114
1115
1116
1117
1118#define NULL ((void *)0)
1119
1120
1121
1122
1123
1124#undef __need_NULL
1125# 36 "./include/stdlib.h" 2
1126
1127
1128
1129
1130#define _STDLIB_H 1
1131
1132
1133
1134# 1 "./include/bits/waitflags.h" 1
1135# 26 "./include/bits/waitflags.h"
1136#define WNOHANG 1
1137#define WUNTRACED 2
1138
1139
1140#define WSTOPPED 2
1141#define WEXITED 4
1142#define WCONTINUED 8
1143#define WNOWAIT 0x01000000
1144
1145#define __WNOTHREAD 0x20000000
1146
1147#define __WALL 0x40000000
1148#define __WCLONE 0x80000000
1149# 45 "./include/stdlib.h" 2
1150# 1 "./include/bits/waitstatus.h" 1
1151# 29 "./include/bits/waitstatus.h"
1152#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
1153
1154
1155#define __WTERMSIG(status) ((status) & 0x7f)
1156
1157
1158#define __WSTOPSIG(status) __WEXITSTATUS(status)
1159
1160
1161#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
1162
1163
1164#define __WIFSIGNALED(status) (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
1165
1166
1167
1168#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
1169
1170
1171
1172
1173#define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
1174
1175
1176
1177#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
1178
1179
1180#define __W_EXITCODE(ret,sig) ((ret) << 8 | (sig))
1181#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
1182#define __W_CONTINUED 0xffff
1183#define __WCOREFLAG 0x80
1184
1185
1186
1187
1188# 1 "./include/endian.h" 1
1189# 20 "./include/endian.h"
1190#define _ENDIAN_H 1
1191# 32 "./include/endian.h"
1192#define __LITTLE_ENDIAN 1234
1193#define __BIG_ENDIAN 4321
1194#define __PDP_ENDIAN 3412
1195
1196
1197# 1 "./include/bits/endian.h" 1
1198
1199
1200
1201
1202
1203
1204#define __BYTE_ORDER __LITTLE_ENDIAN
1205# 38 "./include/endian.h" 2
1206
1207
1208
1209
1210#define __FLOAT_WORD_ORDER __BYTE_ORDER
1211
1212
1213
1214#define LITTLE_ENDIAN __LITTLE_ENDIAN
1215#define BIG_ENDIAN __BIG_ENDIAN
1216#define PDP_ENDIAN __PDP_ENDIAN
1217#define BYTE_ORDER __BYTE_ORDER
1218
1219
1220
1221#define __LONG_LONG_PAIR(HI,LO) LO, HI
1222
1223
1224
1225
1226
1227
1228
1229# 1 "./include/byteswap.h" 1
1230# 20 "./include/byteswap.h"
1231#define _BYTESWAP_H 1
1232
1233
1234# 1 "./include/bits/byteswap.h" 1
1235# 11 "./include/bits/byteswap.h"
1236#define _ASM_BITS_BYTESWAP_H 1
1237
1238#define __bswap_non_constant_16(x) (__extension__ ({ register unsigned short int __v; __asm__ ("%0 = PACK (%1.L, %1.L);" "%0 >>= 8;" : "=d" (__v) : "d" (x)); __v; }))
1239# 22 "./include/bits/byteswap.h"
1240#define __bswap_non_constant_32(x) (__extension__ ({ register unsigned int __v; __asm__ ("%1 = %0 >> 8 (V);" "%0 = %0 << 8 (V);" "%0 = %0 | %1;" "%1 = PACK(%0.L, %0.H);" : "+d"(x), "=&d"(__v)); __v; }))
1241# 34 "./include/bits/byteswap.h"
1242# 1 "./include/bits/byteswap-common.h" 1
1243# 25 "./include/bits/byteswap-common.h"
1244#define _BITS_BYTESWAP_H 1
1245
1246
1247#define __bswap_constant_16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
1248
1249
1250
1251
1252
1253
1254#define __bswap_16(x) (__extension__ ({ unsigned short int __bsv, __bsx = (x); if (__builtin_constant_p (__bsx)) __bsv = __bswap_constant_16 (__bsx); else __bsv = __bswap_non_constant_16 (__bsx); __bsv; }))
1255# 52 "./include/bits/byteswap-common.h"
1256#define __bswap_constant_32(x) ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
1257
1258
1259
1260
1261
1262
1263
1264#define __bswap_32(x) (__extension__ ({ unsigned int __bsv, __bsx = (x); if (__builtin_constant_p (__bsx)) __bsv = __bswap_constant_32 (__bsx); else __bsv = __bswap_non_constant_32 (__bsx); __bsv; }))
1265# 78 "./include/bits/byteswap-common.h"
1266#define __bswap_constant_64(x) ((((x) & 0xff00000000000000ull) >> 56) | (((x) & 0x00ff000000000000ull) >> 40) | (((x) & 0x0000ff0000000000ull) >> 24) | (((x) & 0x000000ff00000000ull) >> 8) | (((x) & 0x00000000ff000000ull) << 8) | (((x) & 0x0000000000ff0000ull) << 24) | (((x) & 0x000000000000ff00ull) << 40) | (((x) & 0x00000000000000ffull) << 56))
1267# 89 "./include/bits/byteswap-common.h"
1268#define __bswap_non_constant_64(x) (__extension__ ({ union { __extension__ unsigned long long int __ll; unsigned int __l[2]; } __w, __r; __w.__ll = (x); __r.__l[0] = __bswap_non_constant_32 (__w.__l[1]); __r.__l[1] = __bswap_non_constant_32 (__w.__l[0]); __r.__ll; }))
1269# 98 "./include/bits/byteswap-common.h"
1270#define __bswap_64(x) (__extension__ ({ __extension__ unsigned long long int __ll; if (__builtin_constant_p (x)) __ll = __bswap_constant_64 (x); else __ll = __bswap_non_constant_64 (x); __ll; }))
1271# 34 "./include/bits/byteswap.h" 2
1272# 24 "./include/byteswap.h" 2
1273
1274
1275
1276
1277
1278
1279#define bswap_16(x) __bswap_16 (x)
1280
1281
1282#define bswap_32(x) __bswap_32 (x)
1283
1284
1285
1286#define bswap_64(x) __bswap_64 (x)
1287# 62 "./include/endian.h" 2
1288
1289
1290#define htobe16(x) __bswap_16 (x)
1291#define htole16(x) (x)
1292#define be16toh(x) __bswap_16 (x)
1293#define le16toh(x) (x)
1294
1295#define htobe32(x) __bswap_32 (x)
1296#define htole32(x) (x)
1297#define be32toh(x) __bswap_32 (x)
1298#define le32toh(x) (x)
1299
1300#define htobe64(x) __bswap_64 (x)
1301#define htole64(x) (x)
1302#define be64toh(x) __bswap_64 (x)
1303#define le64toh(x) (x)
1304# 66 "./include/bits/waitstatus.h" 2
1305
1306union wait
1307 {
1308 int w_status;
1309 struct
1310 {
1311
1312 unsigned int __w_termsig:7;
1313 unsigned int __w_coredump:1;
1314 unsigned int __w_retcode:8;
1315 unsigned int:16;
1316
1317
1318
1319
1320
1321
1322
1323 } __wait_terminated;
1324 struct
1325 {
1326
1327 unsigned int __w_stopval:8;
1328 unsigned int __w_stopsig:8;
1329 unsigned int:16;
1330
1331
1332
1333
1334
1335
1336 } __wait_stopped;
1337 };
1338
1339#define w_termsig __wait_terminated.__w_termsig
1340#define w_coredump __wait_terminated.__w_coredump
1341#define w_retcode __wait_terminated.__w_retcode
1342#define w_stopsig __wait_stopped.__w_stopsig
1343#define w_stopval __wait_stopped.__w_stopval
1344# 46 "./include/stdlib.h" 2
1345
1346
1347
1348
1349
1350
1351
1352#define __WAIT_INT(status) (__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))
1353# 70 "./include/stdlib.h"
1354typedef union
1355 {
1356 union wait *__uptr;
1357 int *__iptr;
1358 } __WAIT_STATUS __attribute__ ((__transparent_union__));
1359#define __WAIT_STATUS_DEFN int *
1360# 87 "./include/stdlib.h"
1361#define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status))
1362#define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status))
1363#define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status))
1364#define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
1365#define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
1366#define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
1367
1368#define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
1369
1370
1371
1372
1373
1374typedef struct
1375 {
1376 int quot;
1377 int rem;
1378 } div_t;
1379
1380
1381
1382typedef struct
1383 {
1384 long int quot;
1385 long int rem;
1386 } ldiv_t;
1387#define __ldiv_t_defined 1
1388
1389
1390
1391
1392
1393
1394__extension__ typedef struct
1395 {
1396 long long int quot;
1397 long long int rem;
1398 } lldiv_t;
1399#define __lldiv_t_defined 1
1400
1401
1402
1403
1404
1405#define RAND_MAX 2147483647
1406
1407
1408
1409
1410#define EXIT_FAILURE 1
1411#define EXIT_SUCCESS 0
1412# 150 "./include/stdlib.h"
1413#define MB_CUR_MAX 1
1414
1415
1416
1417
1418
1419
1420
1421extern double atof (__const char *__nptr)
1422 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1423
1424
1425extern int atoi (__const char *__nptr)
1426 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1427
1428
1429extern long int atol (__const char *__nptr)
1430 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1431
1432
1433
1434
1435
1436__extension__ extern long long int atoll (__const char *__nptr)
1437 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1438
1439
1440
1441
1442
1443
1444extern double strtod (__const char *__restrict __nptr,
1445 char **__restrict __endptr)
1446 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1447
1448
1449
1450
1451
1452
1453extern float strtof (__const char *__restrict __nptr,
1454 char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1455
1456extern long double strtold (__const char *__restrict __nptr,
1457 char **__restrict __endptr)
1458 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1459
1460
1461
1462
1463
1464
1465extern long int strtol (__const char *__restrict __nptr,
1466 char **__restrict __endptr, int __base)
1467 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1468
1469
1470extern unsigned long int strtoul (__const char *__restrict __nptr,
1471 char **__restrict __endptr, int __base)
1472 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1473
1474
1475
1476
1477# 1 "./include/sys/types.h" 1
1478# 25 "./include/sys/types.h"
1479#define _SYS_TYPES_H 1
1480
1481
1482
1483
1484
1485# 1 "./include/bits/types.h" 1
1486# 25 "./include/bits/types.h"
1487#define _BITS_TYPES_H 1
1488
1489
1490# 1 "./include/bits/wordsize.h" 1
1491# 19 "./include/bits/wordsize.h"
1492#define __WORDSIZE 32
1493# 29 "./include/bits/types.h" 2
1494
1495#define __need_size_t
1496# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 1 3 4
1497# 233 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1498#undef __need_size_t
1499# 406 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1500#undef __need_NULL
1501# 32 "./include/bits/types.h" 2
1502
1503# 1 "./include/bits/kernel_types.h" 1
1504# 9 "./include/bits/kernel_types.h"
1505#define __ARCH_BFIN_POSIX_TYPES_H
1506typedef unsigned short __kernel_dev_t;
1507typedef unsigned long __kernel_ino_t;
1508typedef unsigned short __kernel_mode_t;
1509typedef unsigned short __kernel_nlink_t;
1510typedef long __kernel_off_t;
1511typedef int __kernel_pid_t;
1512typedef unsigned int __kernel_ipc_pid_t;
1513typedef unsigned int __kernel_uid_t;
1514typedef unsigned int __kernel_gid_t;
1515typedef unsigned int __kernel_size_t;
1516typedef int __kernel_ssize_t;
1517typedef int __kernel_ptrdiff_t;
1518typedef long __kernel_time_t;
1519typedef long __kernel_suseconds_t;
1520typedef long __kernel_clock_t;
1521typedef int __kernel_daddr_t;
1522typedef char * __kernel_caddr_t;
1523typedef unsigned short __kernel_uid16_t;
1524typedef unsigned short __kernel_gid16_t;
1525typedef unsigned int __kernel_uid32_t;
1526typedef unsigned int __kernel_gid32_t;
1527typedef unsigned short __kernel_old_uid_t;
1528typedef unsigned short __kernel_old_gid_t;
1529typedef long long __kernel_loff_t;
1530typedef __kernel_dev_t __kernel_old_dev_t;
1531
1532typedef struct {
1533
1534
1535
1536 int __val[2];
1537
1538} __kernel_fsid_t;
1539# 34 "./include/bits/types.h" 2
1540
1541
1542
1543typedef unsigned char __u_char;
1544typedef unsigned short int __u_short;
1545typedef unsigned int __u_int;
1546typedef unsigned long int __u_long;
1547
1548
1549typedef signed char __int8_t;
1550typedef unsigned char __uint8_t;
1551typedef signed short int __int16_t;
1552typedef unsigned short int __uint16_t;
1553typedef signed int __int32_t;
1554typedef unsigned int __uint32_t;
1555
1556
1557
1558
1559__extension__ typedef signed long long int __int64_t;
1560__extension__ typedef unsigned long long int __uint64_t;
1561
1562
1563
1564
1565
1566
1567
1568__extension__ typedef long long int __quad_t;
1569__extension__ typedef unsigned long long int __u_quad_t;
1570# 105 "./include/bits/types.h"
1571#define __S16_TYPE short int
1572#define __U16_TYPE unsigned short int
1573#define __S32_TYPE int
1574#define __U32_TYPE unsigned int
1575#define __SLONGWORD_TYPE long int
1576#define __ULONGWORD_TYPE unsigned long int
1577
1578#define __SQUAD_TYPE __quad_t
1579#define __UQUAD_TYPE __u_quad_t
1580#define __SWORD_TYPE int
1581#define __UWORD_TYPE unsigned int
1582#define __SLONG32_TYPE long int
1583#define __ULONG32_TYPE unsigned long int
1584#define __S64_TYPE __quad_t
1585#define __U64_TYPE __u_quad_t
1586
1587
1588#define __STD_TYPE __extension__ typedef
1589# 137 "./include/bits/types.h"
1590# 1 "./include/bits/typesizes.h" 1
1591# 25 "./include/bits/typesizes.h"
1592#define _BITS_TYPESIZES_H 1
1593
1594
1595
1596
1597#define __DEV_T_TYPE __UQUAD_TYPE
1598#define __UID_T_TYPE __U32_TYPE
1599#define __GID_T_TYPE __U32_TYPE
1600#define __INO_T_TYPE __ULONGWORD_TYPE
1601#define __INO64_T_TYPE __UQUAD_TYPE
1602#define __MODE_T_TYPE __U32_TYPE
1603#define __NLINK_T_TYPE __UWORD_TYPE
1604#define __OFF_T_TYPE __SLONGWORD_TYPE
1605#define __OFF64_T_TYPE __SQUAD_TYPE
1606#define __PID_T_TYPE __S32_TYPE
1607#define __RLIM_T_TYPE __ULONGWORD_TYPE
1608#define __RLIM64_T_TYPE __UQUAD_TYPE
1609#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
1610#define __BLKCNT64_T_TYPE __SQUAD_TYPE
1611#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
1612#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
1613#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
1614#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
1615#define __ID_T_TYPE __U32_TYPE
1616#define __CLOCK_T_TYPE __SLONGWORD_TYPE
1617#define __TIME_T_TYPE __SLONGWORD_TYPE
1618#define __USECONDS_T_TYPE __U32_TYPE
1619#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
1620#define __DADDR_T_TYPE __S32_TYPE
1621#define __SWBLK_T_TYPE __SLONGWORD_TYPE
1622#define __KEY_T_TYPE __S32_TYPE
1623#define __CLOCKID_T_TYPE __S32_TYPE
1624#define __TIMER_T_TYPE void *
1625#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
1626#define __FSID_T_TYPE struct { int __val[2]; }
1627#define __SSIZE_T_TYPE __SLONGWORD_TYPE
1628
1629
1630#define __FD_SETSIZE 1024
1631# 138 "./include/bits/types.h" 2
1632
1633
1634__extension__ typedef __u_quad_t __dev_t;
1635__extension__ typedef unsigned int __uid_t;
1636__extension__ typedef unsigned int __gid_t;
1637__extension__ typedef unsigned long int __ino_t;
1638__extension__ typedef __u_quad_t __ino64_t;
1639__extension__ typedef unsigned int __mode_t;
1640__extension__ typedef unsigned int __nlink_t;
1641__extension__ typedef long int __off_t;
1642__extension__ typedef __quad_t __off64_t;
1643__extension__ typedef int __pid_t;
1644__extension__ typedef struct { int __val[2]; } __fsid_t;
1645__extension__ typedef long int __clock_t;
1646__extension__ typedef unsigned long int __rlim_t;
1647__extension__ typedef __u_quad_t __rlim64_t;
1648__extension__ typedef unsigned int __id_t;
1649__extension__ typedef long int __time_t;
1650__extension__ typedef unsigned int __useconds_t;
1651__extension__ typedef long int __suseconds_t;
1652
1653__extension__ typedef int __daddr_t;
1654__extension__ typedef long int __swblk_t;
1655__extension__ typedef int __key_t;
1656
1657
1658__extension__ typedef int __clockid_t;
1659
1660
1661__extension__ typedef void * __timer_t;
1662
1663
1664__extension__ typedef long int __blksize_t;
1665
1666
1667
1668
1669__extension__ typedef long int __blkcnt_t;
1670__extension__ typedef __quad_t __blkcnt64_t;
1671
1672
1673__extension__ typedef unsigned long int __fsblkcnt_t;
1674__extension__ typedef __u_quad_t __fsblkcnt64_t;
1675
1676
1677__extension__ typedef unsigned long int __fsfilcnt_t;
1678__extension__ typedef __u_quad_t __fsfilcnt64_t;
1679
1680__extension__ typedef long int __ssize_t;
1681
1682
1683
1684typedef __off64_t __loff_t;
1685typedef __quad_t *__qaddr_t;
1686typedef char *__caddr_t;
1687
1688
1689__extension__ typedef int __intptr_t;
1690
1691
1692__extension__ typedef unsigned int __socklen_t;
1693
1694
1695#undef __STD_TYPE
1696# 32 "./include/sys/types.h" 2
1697
1698
1699
1700typedef __u_char u_char;
1701typedef __u_short u_short;
1702typedef __u_int u_int;
1703typedef __u_long u_long;
1704typedef __quad_t quad_t;
1705typedef __u_quad_t u_quad_t;
1706typedef __fsid_t fsid_t;
1707#define __u_char_defined
1708
1709
1710
1711typedef __loff_t loff_t;
1712
1713
1714
1715typedef __ino_t ino_t;
1716
1717
1718
1719#define __ino_t_defined
1720
1721
1722typedef __ino64_t ino64_t;
1723#define __ino64_t_defined
1724
1725
1726
1727typedef __dev_t dev_t;
1728#define __dev_t_defined
1729
1730
1731
1732typedef __gid_t gid_t;
1733#define __gid_t_defined
1734
1735
1736
1737typedef __mode_t mode_t;
1738#define __mode_t_defined
1739
1740
1741
1742typedef __nlink_t nlink_t;
1743#define __nlink_t_defined
1744
1745
1746
1747typedef __uid_t uid_t;
1748#define __uid_t_defined
1749
1750
1751
1752
1753typedef __off_t off_t;
1754
1755
1756
1757#define __off_t_defined
1758
1759
1760typedef __off64_t off64_t;
1761#define __off64_t_defined
1762
1763
1764
1765typedef __pid_t pid_t;
1766#define __pid_t_defined
1767
1768
1769
1770typedef __id_t id_t;
1771#define __id_t_defined
1772
1773
1774
1775typedef __ssize_t ssize_t;
1776#define __ssize_t_defined
1777
1778
1779
1780
1781typedef __daddr_t daddr_t;
1782typedef __caddr_t caddr_t;
1783#define __daddr_t_defined
1784
1785
1786
1787
1788typedef __key_t key_t;
1789#define __key_t_defined
1790
1791
1792
1793#define __need_clock_t
1794
1795#define __need_time_t
1796#define __need_timer_t
1797#define __need_clockid_t
1798# 1 "./include/time.h" 1
1799# 55 "./include/time.h"
1800#define __clock_t_defined 1
1801
1802
1803
1804
1805
1806typedef __clock_t clock_t;
1807
1808
1809
1810
1811
1812
1813#undef __need_clock_t
1814
1815
1816#define __time_t_defined 1
1817
1818
1819
1820
1821
1822typedef __time_t time_t;
1823
1824
1825
1826
1827
1828
1829#undef __need_time_t
1830
1831
1832
1833#define __clockid_t_defined 1
1834
1835
1836
1837
1838typedef __clockid_t clockid_t;
1839
1840
1841#undef __clockid_time_t
1842
1843
1844
1845#define __timer_t_defined 1
1846
1847
1848
1849
1850typedef __timer_t timer_t;
1851
1852
1853#undef __need_timer_t
1854# 128 "./include/time.h"
1855#undef __need_timespec
1856# 134 "./include/sys/types.h" 2
1857
1858
1859
1860typedef __useconds_t useconds_t;
1861#define __useconds_t_defined
1862
1863
1864typedef __suseconds_t suseconds_t;
1865#define __suseconds_t_defined
1866
1867
1868
1869#define __need_size_t
1870# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 1 3 4
1871# 233 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1872#undef __need_size_t
1873# 406 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
1874#undef __need_NULL
1875# 148 "./include/sys/types.h" 2
1876
1877
1878
1879typedef unsigned long int ulong;
1880typedef unsigned short int ushort;
1881typedef unsigned int uint;
1882# 188 "./include/sys/types.h"
1883#define __intN_t(N,MODE) typedef int int ##N ##_t __attribute__ ((__mode__ (MODE)))
1884
1885#define __u_intN_t(N,MODE) typedef unsigned int u_int ##N ##_t __attribute__ ((__mode__ (MODE)))
1886
1887
1888
1889#define __int8_t_defined
1890typedef int int8_t __attribute__ ((__mode__ (__QI__)));
1891typedef int int16_t __attribute__ ((__mode__ (__HI__)));
1892typedef int int32_t __attribute__ ((__mode__ (__SI__)));
1893typedef int int64_t __attribute__ ((__mode__ (__DI__)));
1894
1895
1896typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
1897typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
1898typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
1899typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
1900
1901typedef int register_t __attribute__ ((__mode__ (__word__)));
1902
1903
1904
1905
1906
1907#define __BIT_TYPES_DEFINED__ 1
1908
1909
1910
1911
1912
1913
1914
1915# 1 "./include/sys/select.h" 1
1916# 23 "./include/sys/select.h"
1917#define _SYS_SELECT_H 1
1918
1919
1920
1921
1922
1923
1924
1925# 1 "./include/bits/select.h" 1
1926# 26 "./include/bits/select.h"
1927#define __FD_ZERO(s) do { unsigned int __i; fd_set *__arr = (s); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) __FDS_BITS (__arr)[__i] = 0; } while (0)
1928
1929
1930
1931
1932
1933
1934#define __FD_SET(d,s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
1935#define __FD_CLR(d,s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
1936#define __FD_ISSET(d,s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
1937# 32 "./include/sys/select.h" 2
1938
1939
1940# 1 "./include/bits/sigset.h" 1
1941# 21 "./include/bits/sigset.h"
1942#define _SIGSET_H_types 1
1943
1944typedef int __sig_atomic_t;
1945# 38 "./include/bits/sigset.h"
1946#define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long)))
1947
1948typedef struct {
1949 unsigned long __val[(64 / (8 * sizeof (unsigned long)))];
1950} __sigset_t;
1951# 35 "./include/sys/select.h" 2
1952
1953
1954#define __sigset_t_defined
1955typedef __sigset_t sigset_t;
1956
1957
1958
1959#define __need_time_t
1960#define __need_timespec
1961# 1 "./include/time.h" 1
1962# 68 "./include/time.h"
1963#undef __need_clock_t
1964# 84 "./include/time.h"
1965#undef __need_time_t
1966# 96 "./include/time.h"
1967#undef __clockid_time_t
1968# 108 "./include/time.h"
1969#undef __need_timer_t
1970
1971
1972
1973
1974
1975
1976#define __timespec_defined 1
1977
1978
1979
1980
1981
1982struct timespec
1983 {
1984 __time_t tv_sec;
1985 long int tv_nsec;
1986 };
1987
1988
1989#undef __need_timespec
1990# 45 "./include/sys/select.h" 2
1991#define __need_timeval
1992# 1 "./include/bits/time.h" 1
1993# 66 "./include/bits/time.h"
1994#undef __need_timeval
1995
1996#define _STRUCT_TIMEVAL 1
1997
1998
1999
2000
2001struct timeval
2002 {
2003 __time_t tv_sec;
2004 __suseconds_t tv_usec;
2005 };
2006# 47 "./include/sys/select.h" 2
2007# 55 "./include/sys/select.h"
2008typedef long int __fd_mask;
2009
2010
2011#undef __NFDBITS
2012#undef __FDELT
2013#undef __FDMASK
2014
2015#define __NFDBITS (8 * sizeof (__fd_mask))
2016#define __FDELT(d) ((d) / __NFDBITS)
2017#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
2018
2019
2020typedef struct
2021 {
2022
2023
2024
2025 __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))];
2026#define __FDS_BITS(set) ((set)->fds_bits)
2027
2028
2029
2030
2031 } fd_set;
2032
2033
2034#define FD_SETSIZE __FD_SETSIZE
2035
2036
2037
2038typedef __fd_mask fd_mask;
2039
2040
2041#define NFDBITS __NFDBITS
2042
2043
2044
2045
2046#define FD_SET(fd,fdsetp) __FD_SET (fd, fdsetp)
2047#define FD_CLR(fd,fdsetp) __FD_CLR (fd, fdsetp)
2048#define FD_ISSET(fd,fdsetp) __FD_ISSET (fd, fdsetp)
2049#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
2050
2051
2052
2053# 109 "./include/sys/select.h"
2054extern int select (int __nfds, fd_set *__restrict __readfds,
2055 fd_set *__restrict __writefds,
2056 fd_set *__restrict __exceptfds,
2057 struct timeval *__restrict __timeout);
2058
2059# 122 "./include/sys/select.h"
2060extern int pselect (int __nfds, fd_set *__restrict __readfds,
2061 fd_set *__restrict __writefds,
2062 fd_set *__restrict __exceptfds,
2063 const struct timespec *__restrict __timeout,
2064 const __sigset_t *__restrict __sigmask);
2065
2066
2067
2068# 221 "./include/sys/types.h" 2
2069
2070
2071# 1 "./include/sys/sysmacros.h" 1
2072# 21 "./include/sys/sysmacros.h"
2073#define _SYS_SYSMACROS_H 1
2074
2075
2076
2077
2078
2079
2080
2081__extension__
2082static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
2083 __attribute__ ((__nothrow__));
2084__extension__
2085static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
2086 __attribute__ ((__nothrow__));
2087__extension__
2088static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
2089 unsigned int __minor)
2090 __attribute__ ((__nothrow__));
2091
2092
2093__extension__ static __inline unsigned int
2094__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
2095{
2096 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
2097}
2098
2099__extension__ static __inline unsigned int
2100__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
2101{
2102 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
2103}
2104
2105__extension__ static __inline unsigned long long int
2106__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
2107{
2108 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
2109 | (((unsigned long long int) (__minor & ~0xff)) << 12)
2110 | (((unsigned long long int) (__major & ~0xfff)) << 32));
2111}
2112
2113
2114
2115
2116#define major(dev) gnu_dev_major (dev)
2117#define minor(dev) gnu_dev_minor (dev)
2118#define makedev(maj,min) gnu_dev_makedev (maj, min)
2119# 224 "./include/sys/types.h" 2
2120
2121
2122
2123
2124typedef __blksize_t blksize_t;
2125#define __blksize_t_defined
2126
2127
2128
2129
2130
2131typedef __blkcnt_t blkcnt_t;
2132#define __blkcnt_t_defined
2133
2134
2135typedef __fsblkcnt_t fsblkcnt_t;
2136#define __fsblkcnt_t_defined
2137
2138
2139typedef __fsfilcnt_t fsfilcnt_t;
2140#define __fsfilcnt_t_defined
2141# 262 "./include/sys/types.h"
2142typedef __blkcnt64_t blkcnt64_t;
2143typedef __fsblkcnt64_t fsblkcnt64_t;
2144typedef __fsfilcnt64_t fsfilcnt64_t;
2145# 273 "./include/sys/types.h"
2146
2147# 215 "./include/stdlib.h" 2
2148
2149
2150__extension__
2151extern quad_t strtoq (__const char *__restrict __nptr,
2152 char **__restrict __endptr, int __base)
2153 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2154
2155__extension__
2156extern u_quad_t strtouq (__const char *__restrict __nptr,
2157 char **__restrict __endptr, int __base)
2158 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2159
2160
2161
2162
2163
2164__extension__
2165extern long long int strtoll (__const char *__restrict __nptr,
2166 char **__restrict __endptr, int __base)
2167 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2168
2169
2170__extension__
2171extern unsigned long long int strtoull (__const char *__restrict __nptr,
2172 char **__restrict __endptr, int __base)
2173 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2174
2175# 307 "./include/stdlib.h"
2176extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;
2177
2178
2179extern long int a64l (__const char *__s)
2180 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
2181# 323 "./include/stdlib.h"
2182extern long int random (void) __attribute__ ((__nothrow__));
2183
2184
2185
2186extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
2187
2188
2189
2190
2191
2192extern char *initstate (unsigned int __seed, char *__statebuf,
2193 size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2194
2195
2196
2197extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2198
2199
2200
2201
2202
2203
2204
2205struct random_data
2206 {
2207 int32_t *fptr;
2208 int32_t *rptr;
2209 int32_t *state;
2210
2211
2212
2213
2214
2215
2216 int8_t rand_type;
2217 int8_t rand_deg;
2218 int8_t rand_sep;
2219
2220 int32_t *end_ptr;
2221 };
2222
2223extern int random_r (struct random_data *__restrict __buf,
2224 int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2225
2226
2227extern int srandom_r (unsigned int __seed, struct random_data *__buf)
2228 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2229
2230
2231extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
2232 size_t __statelen,
2233 struct random_data *__restrict __buf)
2234 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
2235
2236
2237extern int setstate_r (char *__restrict __statebuf,
2238 struct random_data *__restrict __buf)
2239 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2240
2241
2242
2243
2244
2245
2246
2247extern int rand (void) __attribute__ ((__nothrow__));
2248
2249extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
2250
2251
2252
2253
2254extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
2255# 404 "./include/stdlib.h"
2256extern double drand48 (void) __attribute__ ((__nothrow__));
2257extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2258
2259
2260
2261extern long int lrand48 (void) __attribute__ ((__nothrow__));
2262extern long int nrand48 (unsigned short int __xsubi[3])
2263 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2264
2265
2266extern long int mrand48 (void) __attribute__ ((__nothrow__));
2267extern long int jrand48 (unsigned short int __xsubi[3])
2268 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2269
2270
2271extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
2272extern unsigned short int *seed48 (unsigned short int __seed16v[3])
2273 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2274extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2275
2276
2277
2278
2279
2280struct drand48_data
2281 {
2282 unsigned short int __x[3];
2283 unsigned short int __old_x[3];
2284 unsigned short int __c;
2285 unsigned short int __init;
2286 unsigned long long int __a;
2287 };
2288
2289
2290
2291extern int drand48_r (struct drand48_data *__restrict __buffer,
2292 double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2293extern int erand48_r (unsigned short int __xsubi[3],
2294 struct drand48_data *__restrict __buffer,
2295 double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2296
2297
2298
2299
2300extern int lrand48_r (struct drand48_data *__restrict __buffer,
2301 long int *__restrict __result)
2302 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2303
2304extern int nrand48_r (unsigned short int __xsubi[3],
2305 struct drand48_data *__restrict __buffer,
2306 long int *__restrict __result)
2307 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2308
2309
2310
2311extern int mrand48_r (struct drand48_data *__restrict __buffer,
2312 long int *__restrict __result)
2313 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2314extern int jrand48_r (unsigned short int __xsubi[3],
2315 struct drand48_data *__restrict __buffer,
2316 long int *__restrict __result)
2317 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2318
2319
2320
2321extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
2322 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2323
2324
2325extern int seed48_r (unsigned short int __seed16v[3],
2326 struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2327
2328
2329extern int lcong48_r (unsigned short int __param[7],
2330 struct drand48_data *__buffer)
2331 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2332
2333
2334
2335
2336
2337
2338#define __malloc_and_calloc_defined
2339
2340
2341extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
2342
2343
2344
2345extern void *calloc (size_t __nmemb, size_t __size)
2346 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357extern void *realloc (void *__ptr, size_t __size)
2358 __attribute__ ((__nothrow__)) ;
2359
2360extern void free (void *__ptr) __attribute__ ((__nothrow__));
2361
2362
2363
2364
2365
2366
2367
2368
2369# 1 "./include/alloca.h" 1
2370# 20 "./include/alloca.h"
2371#define _ALLOCA_H 1
2372
2373
2374
2375#define __need_size_t
2376# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 1 3 4
2377# 233 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2378#undef __need_size_t
2379# 406 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2380#undef __need_NULL
2381# 26 "./include/alloca.h" 2
2382
2383
2384
2385
2386#undef alloca
2387
2388
2389extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
2390
2391
2392#define alloca(size) __builtin_alloca (size)
2393
2394
2395
2396#define __MAX_ALLOCA_CUTOFF 65536
2397
2398# 1 "./include/bits/stackinfo.h" 1
2399# 23 "./include/bits/stackinfo.h"
2400#define _STACKINFO_H 1
2401
2402
2403#define _STACK_GROWS_DOWN 1
2404# 43 "./include/alloca.h" 2
2405
2406#define extend_alloca(buf,len,newlen) (__typeof (buf)) ({ size_t __newlen = (newlen); char *__newbuf = alloca (__newlen); if (__newbuf + __newlen == (char *) buf) len += __newlen; else len = __newlen; __newbuf; })
2407# 71 "./include/alloca.h"
2408extern int __libc_alloca_cutoff (size_t size);
2409
2410
2411
2412# 518 "./include/stdlib.h" 2
2413
2414
2415
2416
2417extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
2418
2419
2420
2421
2422extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
2423 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2424
2425
2426
2427
2428extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2429
2430
2431
2432
2433extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2434
2435
2436
2437
2438
2439extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
2440 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2441
2442
2443
2444
2445
2446
2447extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2448
2449
2450
2451
2452
2453
2454
2455extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2456
2457
2458
2459
2460
2461
2462extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2463
2464
2465# 582 "./include/stdlib.h"
2466extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2467
2468
2469
2470
2471
2472extern int setenv (__const char *__name, __const char *__value, int __replace)
2473 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2474
2475
2476
2477extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__));
2478
2479
2480
2481
2482
2483
2484#define __UCLIBC_MAX_ATEXIT INT_MAX
2485# 610 "./include/stdlib.h"
2486extern int clearenv (void) __attribute__ ((__nothrow__));
2487# 632 "./include/stdlib.h"
2488extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
2489# 642 "./include/stdlib.h"
2490extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
2491# 652 "./include/stdlib.h"
2492extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2493
2494
2495
2496
2497
2498
2499
2500
2501extern int system (__const char *__command) ;
2502
2503
2504
2505
2506
2507
2508extern char *canonicalize_file_name (__const char *__name)
2509 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
2510# 678 "./include/stdlib.h"
2511extern char *realpath (__const char *__restrict __name,
2512 char *__restrict __resolved) __attribute__ ((__nothrow__)) ;
2513
2514
2515
2516
2517
2518
2519#define __COMPAR_FN_T
2520typedef int (*__compar_fn_t) (__const void *, __const void *);
2521
2522
2523typedef __compar_fn_t comparison_fn_t;
2524
2525
2526
2527typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *);
2528
2529
2530
2531
2532
2533extern void *bsearch (__const void *__key, __const void *__base,
2534 size_t __nmemb, size_t __size, __compar_fn_t __compar)
2535 __attribute__ ((__nonnull__ (1, 2, 5))) ;
2536
2537
2538
2539extern void qsort (void *__base, size_t __nmemb, size_t __size,
2540 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
2541
2542
2543extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
2544 __compar_d_fn_t __compar, void *__arg)
2545 __attribute__ ((__nonnull__ (1, 4)));
2546
2547
2548
2549
2550extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
2551extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
2552
2553
2554
2555__extension__ extern long long int llabs (long long int __x)
2556 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
2557
2558
2559
2560
2561
2562
2563
2564extern div_t div (int __numer, int __denom)
2565 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
2566extern ldiv_t ldiv (long int __numer, long int __denom)
2567 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
2568
2569
2570
2571
2572__extension__ extern lldiv_t lldiv (long long int __numer,
2573 long long int __denom)
2574 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
2575
2576# 847 "./include/stdlib.h"
2577extern int getsubopt (char **__restrict __optionp,
2578 char *__const *__restrict __tokens,
2579 char **__restrict __valuep)
2580 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
2581
2582
2583
2584
2585
2586
2587extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2588# 866 "./include/stdlib.h"
2589extern int posix_openpt (int __oflag) ;
2590
2591# 876 "./include/stdlib.h"
2592extern int grantpt (int __fd) __attribute__ ((__nothrow__));
2593
2594
2595
2596extern int unlockpt (int __fd) __attribute__ ((__nothrow__));
2597
2598
2599
2600
2601extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) ;
2602# 894 "./include/stdlib.h"
2603extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
2604 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2605
2606# 920 "./include/stdlib.h"
2607extern int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer) __attribute__ ((visibility ("hidden")));
2608
2609
2610extern struct drand48_data __libc_drand48_data __attribute__ ((visibility ("hidden")));
2611
2612
2613
2614#undef __need_malloc_and_calloc
2615
2616
2617# 29 "./ldso/include/ldso.h" 2
2618# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stdarg.h" 1 3 4
2619# 31 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stdarg.h" 3 4
2620#define _STDARG_H
2621#define _ANSI_STDARG_H_
2622
2623#undef __need___va_list
2624
2625
2626
2627
2628#define __GNUC_VA_LIST
2629typedef __builtin_va_list __gnuc_va_list;
2630
2631
2632
2633
2634
2635
2636#define va_start(v,l) __builtin_va_start(v,l)
2637#define va_end(v) __builtin_va_end(v)
2638#define va_arg(v,l) __builtin_va_arg(v,l)
2639
2640#define va_copy(d,s) __builtin_va_copy(d,s)
2641
2642#define __va_copy(d,s) __builtin_va_copy(d,s)
2643# 102 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stdarg.h" 3 4
2644typedef __gnuc_va_list va_list;
2645
2646
2647
2648
2649
2650#define _VA_LIST_
2651
2652
2653#define _VA_LIST
2654
2655
2656#define _VA_LIST_DEFINED
2657
2658
2659#define _VA_LIST_T_H
2660
2661
2662#define __va_list__
2663# 30 "./ldso/include/ldso.h" 2
2664# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 1 3 4
2665# 40 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2666#define _STDDEF_H
2667#define _STDDEF_H_
2668
2669#define _ANSI_STDDEF_H
2670
2671#define __STDDEF_H__
2672# 138 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2673#define _PTRDIFF_T
2674#define _T_PTRDIFF_
2675#define _T_PTRDIFF
2676#define __PTRDIFF_T
2677#define _PTRDIFF_T_
2678#define _BSD_PTRDIFF_T_
2679#define ___int_ptrdiff_t_h
2680#define _GCC_PTRDIFF_T
2681
2682
2683
2684typedef long int ptrdiff_t;
2685# 160 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2686#undef __need_ptrdiff_t
2687# 233 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2688#undef __need_size_t
2689# 262 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2690#define __wchar_t__
2691#define __WCHAR_T__
2692#define _WCHAR_T
2693#define _T_WCHAR_
2694#define _T_WCHAR
2695#define __WCHAR_T
2696#define _WCHAR_T_
2697#define _BSD_WCHAR_T_
2698#define _WCHAR_T_DEFINED_
2699#define _WCHAR_T_DEFINED
2700#define _WCHAR_T_H
2701#define ___int_wchar_t_h
2702#define __INT_WCHAR_T_H
2703#define _GCC_WCHAR_T
2704#define _WCHAR_T_DECLARED
2705# 289 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2706#undef _BSD_WCHAR_T_
2707# 323 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2708typedef int wchar_t;
2709# 342 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2710#undef __need_wchar_t
2711# 395 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
2712#undef NULL
2713
2714
2715
2716
2717#define NULL ((void *)0)
2718
2719
2720
2721
2722
2723#undef __need_NULL
2724
2725
2726
2727
2728#define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
2729# 31 "./ldso/include/ldso.h" 2
2730# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stdbool.h" 1 3 4
2731# 29 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stdbool.h" 3 4
2732#define _STDBOOL_H
2733
2734
2735
2736#define bool _Bool
2737#define true 1
2738#define false 0
2739# 48 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stdbool.h" 3 4
2740#define __bool_true_false_are_defined 1
2741# 32 "./ldso/include/ldso.h" 2
2742#define _FCNTL_H
2743# 1 "./include/bits/fcntl.h" 1
2744# 27 "./include/bits/fcntl.h"
2745# 1 "./include/bits/uio.h" 1
2746# 24 "./include/bits/uio.h"
2747#define _BITS_UIO_H 1
2748# 40 "./include/bits/uio.h"
2749#define UIO_MAXIOV 1024
2750#define UIO_FASTIOV 8
2751
2752
2753
2754struct iovec
2755 {
2756 void *iov_base;
2757 size_t iov_len;
2758 };
2759# 28 "./include/bits/fcntl.h" 2
2760
2761
2762
2763
2764#define O_ACCMODE 0003
2765#define O_RDONLY 00
2766#define O_WRONLY 01
2767#define O_RDWR 02
2768#define O_CREAT 0100
2769#define O_EXCL 0200
2770#define O_NOCTTY 0400
2771#define O_TRUNC 01000
2772#define O_APPEND 02000
2773#define O_NONBLOCK 04000
2774#define O_NDELAY O_NONBLOCK
2775#define O_SYNC 010000
2776#define O_FSYNC O_SYNC
2777#define O_ASYNC 020000
2778
2779
2780#define O_DIRECTORY 040000
2781#define O_NOFOLLOW 0100000
2782#define O_DIRECT 0200000
2783#define O_NOATIME 01000000
2784#define O_CLOEXEC 02000000
2785
2786
2787
2788
2789
2790
2791#define O_DSYNC O_SYNC
2792#define O_RSYNC O_SYNC
2793
2794
2795
2796#define O_LARGEFILE 0400000
2797
2798
2799
2800#define F_DUPFD 0
2801#define F_GETFD 1
2802#define F_SETFD 2
2803#define F_GETFL 3
2804#define F_SETFL 4
2805
2806#define F_GETLK 5
2807#define F_SETLK 6
2808#define F_SETLKW 7
2809
2810
2811
2812
2813
2814#define F_GETLK64 12
2815#define F_SETLK64 13
2816#define F_SETLKW64 14
2817
2818
2819#define F_SETOWN 8
2820#define F_GETOWN 9
2821
2822
2823
2824#define F_SETSIG 10
2825#define F_GETSIG 11
2826
2827
2828
2829#define F_SETLEASE 1024
2830#define F_GETLEASE 1025
2831#define F_NOTIFY 1026
2832#define F_DUPFD_CLOEXEC 1030
2833
2834
2835
2836
2837#define FD_CLOEXEC 1
2838
2839
2840#define F_RDLCK 0
2841#define F_WRLCK 1
2842#define F_UNLCK 2
2843
2844
2845#define F_EXLCK 4
2846#define F_SHLCK 8
2847
2848
2849
2850#define LOCK_SH 1
2851#define LOCK_EX 2
2852#define LOCK_NB 4
2853
2854#define LOCK_UN 8
2855
2856
2857
2858#define LOCK_MAND 32
2859#define LOCK_READ 64
2860#define LOCK_WRITE 128
2861#define LOCK_RW 192
2862
2863
2864
2865
2866#define DN_ACCESS 0x00000001
2867#define DN_MODIFY 0x00000002
2868#define DN_CREATE 0x00000004
2869#define DN_DELETE 0x00000008
2870#define DN_RENAME 0x00000010
2871#define DN_ATTRIB 0x00000020
2872#define DN_MULTISHOT 0x80000000
2873
2874
2875struct flock
2876 {
2877 short int l_type;
2878 short int l_whence;
2879
2880 __off_t l_start;
2881 __off_t l_len;
2882
2883
2884
2885
2886 __pid_t l_pid;
2887 };
2888
2889
2890struct flock64
2891 {
2892 short int l_type;
2893 short int l_whence;
2894 __off64_t l_start;
2895 __off64_t l_len;
2896 __pid_t l_pid;
2897 };
2898
2899
2900
2901
2902
2903#define FAPPEND O_APPEND
2904#define FFSYNC O_FSYNC
2905#define FASYNC O_ASYNC
2906#define FNONBLOCK O_NONBLOCK
2907#define FNDELAY O_NDELAY
2908
2909
2910
2911
2912#define POSIX_FADV_NORMAL 0
2913#define POSIX_FADV_RANDOM 1
2914#define POSIX_FADV_SEQUENTIAL 2
2915#define POSIX_FADV_WILLNEED 3
2916#define POSIX_FADV_DONTNEED 4
2917#define POSIX_FADV_NOREUSE 5
2918
2919
2920
2921
2922
2923#define SYNC_FILE_RANGE_WAIT_BEFORE 1
2924
2925
2926#define SYNC_FILE_RANGE_WRITE 2
2927
2928
2929#define SYNC_FILE_RANGE_WAIT_AFTER 4
2930
2931
2932
2933
2934#define SPLICE_F_MOVE 1
2935#define SPLICE_F_NONBLOCK 2
2936
2937
2938#define SPLICE_F_MORE 4
2939#define SPLICE_F_GIFT 8
2940
2941
2942
2943
2944
2945
2946
2947extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
2948 __attribute__ ((__nothrow__));
2949
2950
2951
2952extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
2953 unsigned int __flags);
2954
2955
2956extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
2957 size_t __count, unsigned int __flags);
2958
2959
2960extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
2961 __off64_t *__offout, size_t __len,
2962 unsigned int __flags);
2963
2964
2965extern ssize_t tee (int __fdin, int __fdout, size_t __len,
2966 unsigned int __flags);
2967
2968
2969
2970# 34 "./ldso/include/ldso.h" 2
2971# 1 "./include/bits/wordsize.h" 1
2972# 19 "./include/bits/wordsize.h"
2973#define __WORDSIZE 32
2974# 35 "./ldso/include/ldso.h" 2
2975
2976
2977
2978# 1 "./include/bits/uClibc_page.h" 1
2979# 22 "./include/bits/uClibc_page.h"
2980#define _UCLIBC_PAGE_H
2981
2982
2983#define PAGE_SHIFT 12
2984#define PAGE_SIZE (1UL << PAGE_SHIFT)
2985#define PAGE_MASK (~(PAGE_SIZE-1))
2986# 39 "./ldso/include/ldso.h" 2
2987
2988# 1 "./include/sys/param.h" 1
2989# 20 "./include/sys/param.h"
2990#define _SYS_PARAM_H 1
2991
2992
2993#define __undef_ARG_MAX
2994
2995
2996# 1 "./include/limits.h" 1
2997# 25 "./include/limits.h"
2998#define _LIBC_LIMITS_H_ 1
2999
3000
3001
3002
3003
3004
3005
3006#define MB_LEN_MAX 16
3007# 125 "./include/limits.h"
3008# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/limits.h" 1
3009# 124 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/limits.h"
3010# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include-fixed/limits.h" 1 3 4
3011# 30 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include-fixed/limits.h" 3 4
3012#define _GCC_LIMITS_H_
3013# 61 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include-fixed/limits.h" 3 4
3014#define _LIMITS_H___
3015
3016
3017#undef CHAR_BIT
3018#define CHAR_BIT __CHAR_BIT__
3019
3020
3021
3022
3023
3024
3025
3026#undef SCHAR_MIN
3027#define SCHAR_MIN (-SCHAR_MAX - 1)
3028#undef SCHAR_MAX
3029#define SCHAR_MAX __SCHAR_MAX__
3030
3031
3032#undef UCHAR_MAX
3033
3034
3035
3036#define UCHAR_MAX (SCHAR_MAX * 2 + 1)
3037# 97 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include-fixed/limits.h" 3 4
3038#undef CHAR_MIN
3039#define CHAR_MIN SCHAR_MIN
3040#undef CHAR_MAX
3041#define CHAR_MAX SCHAR_MAX
3042
3043
3044
3045#undef SHRT_MIN
3046#define SHRT_MIN (-SHRT_MAX - 1)
3047#undef SHRT_MAX
3048#define SHRT_MAX __SHRT_MAX__
3049
3050
3051#undef USHRT_MAX
3052
3053
3054
3055#define USHRT_MAX (SHRT_MAX * 2 + 1)
3056
3057
3058
3059#undef INT_MIN
3060#define INT_MIN (-INT_MAX - 1)
3061#undef INT_MAX
3062#define INT_MAX __INT_MAX__
3063
3064
3065#undef UINT_MAX
3066#define UINT_MAX (INT_MAX * 2U + 1U)
3067
3068
3069
3070#undef LONG_MIN
3071#define LONG_MIN (-LONG_MAX - 1L)
3072#undef LONG_MAX
3073#define LONG_MAX __LONG_MAX__
3074
3075
3076#undef ULONG_MAX
3077#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
3078# 152 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include-fixed/limits.h" 3 4
3079#undef LONG_LONG_MIN
3080#define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
3081#undef LONG_LONG_MAX
3082#define LONG_LONG_MAX __LONG_LONG_MAX__
3083
3084
3085#undef ULONG_LONG_MAX
3086#define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
3087# 125 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/limits.h" 2
3088
3089
3090
3091
3092
3093
3094#define LLONG_MIN LONG_LONG_MIN
3095
3096
3097#define LLONG_MAX LONG_LONG_MAX
3098
3099
3100#define ULLONG_MAX ULONG_LONG_MAX
3101
3102
3103
3104
3105
3106
3107# 1 "./include/bits/posix1_lim.h" 1
3108# 26 "./include/bits/posix1_lim.h"
3109#define _BITS_POSIX1_LIM_H 1
3110
3111
3112
3113
3114
3115#define _POSIX_AIO_LISTIO_MAX 2
3116
3117
3118#define _POSIX_AIO_MAX 1
3119
3120
3121#define _POSIX_ARG_MAX 4096
3122
3123
3124
3125#define _POSIX_CHILD_MAX 25
3126
3127
3128
3129
3130
3131#define _POSIX_DELAYTIMER_MAX 32
3132
3133
3134
3135#define _POSIX_HOST_NAME_MAX 255
3136
3137
3138#define _POSIX_LINK_MAX 8
3139
3140
3141#define _POSIX_LOGIN_NAME_MAX 9
3142
3143
3144#define _POSIX_MAX_CANON 255
3145
3146
3147
3148#define _POSIX_MAX_INPUT 255
3149
3150
3151#define _POSIX_MQ_OPEN_MAX 8
3152
3153
3154#define _POSIX_MQ_PRIO_MAX 32
3155
3156
3157#define _POSIX_NAME_MAX 14
3158
3159
3160
3161#define _POSIX_NGROUPS_MAX 8
3162
3163
3164
3165
3166
3167
3168#define _POSIX_OPEN_MAX 20
3169
3170
3171
3172
3173
3174
3175#define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
3176
3177
3178#define _POSIX_PATH_MAX 256
3179
3180
3181#define _POSIX_PIPE_BUF 512
3182
3183
3184
3185#define _POSIX_RE_DUP_MAX 255
3186
3187
3188#define _POSIX_RTSIG_MAX 8
3189
3190
3191#define _POSIX_SEM_NSEMS_MAX 256
3192
3193
3194#define _POSIX_SEM_VALUE_MAX 32767
3195
3196
3197#define _POSIX_SIGQUEUE_MAX 32
3198
3199
3200#define _POSIX_SSIZE_MAX 32767
3201
3202
3203#define _POSIX_STREAM_MAX 8
3204
3205
3206#define _POSIX_SYMLINK_MAX 255
3207
3208
3209
3210#define _POSIX_SYMLOOP_MAX 8
3211
3212
3213#define _POSIX_TIMER_MAX 32
3214
3215
3216#define _POSIX_TTY_NAME_MAX 9
3217
3218
3219#define _POSIX_TZNAME_MAX 6
3220
3221
3222#define _POSIX_QLIMIT 1
3223
3224
3225
3226#define _POSIX_HIWAT _POSIX_PIPE_BUF
3227
3228
3229#define _POSIX_UIO_MAXIOV 16
3230
3231
3232#define _POSIX_CLOCKRES_MIN 20000000
3233
3234
3235
3236# 1 "./include/bits/local_lim.h" 1
3237# 26 "./include/bits/local_lim.h"
3238#define __undef_NR_OPEN
3239
3240
3241#define __undef_LINK_MAX
3242
3243
3244#define __undef_OPEN_MAX
3245
3246
3247#define __undef_ARG_MAX
3248
3249
3250
3251# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/linux/limits.h" 1
3252
3253#define _LINUX_LIMITS_H
3254
3255#define NR_OPEN 1024
3256
3257#define NGROUPS_MAX 65536
3258#define ARG_MAX 131072
3259#define LINK_MAX 127
3260#define MAX_CANON 255
3261#define MAX_INPUT 255
3262#define NAME_MAX 255
3263#define PATH_MAX 4096
3264#define PIPE_BUF 4096
3265#define XATTR_NAME_MAX 255
3266#define XATTR_SIZE_MAX 65536
3267#define XATTR_LIST_MAX 65536
3268
3269#define RTSIG_MAX 32
3270# 40 "./include/bits/local_lim.h" 2
3271
3272
3273
3274#undef NR_OPEN
3275#undef __undef_NR_OPEN
3276
3277
3278
3279#undef LINK_MAX
3280#undef __undef_LINK_MAX
3281
3282
3283
3284#undef OPEN_MAX
3285#undef __undef_OPEN_MAX
3286
3287
3288
3289#undef ARG_MAX
3290#undef __undef_ARG_MAX
3291
3292
3293
3294#define _POSIX_THREAD_KEYS_MAX 128
3295
3296#define PTHREAD_KEYS_MAX 1024
3297
3298
3299#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
3300
3301#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
3302
3303
3304#define _POSIX_THREAD_THREADS_MAX 64
3305
3306
3307
3308#define AIO_PRIO_DELTA_MAX 20
3309
3310
3311#define PTHREAD_STACK_MIN 16384
3312
3313
3314#define DELAYTIMER_MAX 2147483647
3315
3316
3317#define TTY_NAME_MAX 32
3318
3319
3320#define LOGIN_NAME_MAX 256
3321
3322
3323#define HOST_NAME_MAX 64
3324
3325
3326#define MQ_PRIO_MAX 32768
3327# 154 "./include/bits/posix1_lim.h" 2
3328# 1 "./include/bits/uClibc_local_lim.h" 1
3329# 11 "./include/bits/uClibc_local_lim.h"
3330#define _BITS_UCLIBC_LOCAL_LIM_H 1
3331# 25 "./include/bits/uClibc_local_lim.h"
3332#undef _POSIX_THREAD_KEYS_MAX
3333#undef PTHREAD_KEYS_MAX
3334#undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
3335#undef PTHREAD_DESTRUCTOR_ITERATIONS
3336#undef PTHREAD_STACK_MIN
3337#undef DELAYTIMER_MAX
3338# 155 "./include/bits/posix1_lim.h" 2
3339
3340
3341
3342#define SSIZE_MAX LONG_MAX
3343# 145 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/limits.h" 2
3344
3345
3346
3347# 1 "./include/bits/posix2_lim.h" 1
3348# 24 "./include/bits/posix2_lim.h"
3349#define _BITS_POSIX2_LIM_H 1
3350
3351
3352
3353#define _POSIX2_BC_BASE_MAX 99
3354
3355
3356#define _POSIX2_BC_DIM_MAX 2048
3357
3358
3359#define _POSIX2_BC_SCALE_MAX 99
3360
3361
3362#define _POSIX2_BC_STRING_MAX 1000
3363
3364
3365
3366#define _POSIX2_COLL_WEIGHTS_MAX 2
3367
3368
3369
3370#define _POSIX2_EXPR_NEST_MAX 32
3371
3372
3373#define _POSIX2_LINE_MAX 2048
3374
3375
3376
3377#define _POSIX2_RE_DUP_MAX 255
3378
3379
3380
3381#define _POSIX2_CHARCLASS_NAME_MAX 14
3382
3383
3384
3385
3386
3387
3388
3389#define BC_BASE_MAX _POSIX2_BC_BASE_MAX
3390
3391
3392#define BC_DIM_MAX _POSIX2_BC_DIM_MAX
3393
3394
3395#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
3396
3397
3398#define BC_STRING_MAX _POSIX2_BC_STRING_MAX
3399
3400
3401#define COLL_WEIGHTS_MAX 255
3402
3403
3404#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
3405
3406
3407#define LINE_MAX _POSIX2_LINE_MAX
3408
3409
3410#define CHARCLASS_NAME_MAX 2048
3411
3412
3413
3414#define RE_DUP_MAX (0x7fff)
3415# 149 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/limits.h" 2
3416
3417
3418
3419# 1 "./include/bits/xopen_lim.h" 1
3420# 31 "./include/bits/xopen_lim.h"
3421#define _XOPEN_LIM_H 1
3422
3423#define __need_IOV_MAX
3424# 1 "./include/bits/stdio_lim.h" 1
3425# 42 "./include/bits/stdio_lim.h"
3426#define IOV_MAX 1024
3427# 35 "./include/bits/xopen_lim.h" 2
3428# 66 "./include/bits/xopen_lim.h"
3429#define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
3430# 76 "./include/bits/xopen_lim.h"
3431#define NL_ARGMAX __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__
3432
3433
3434
3435#define NL_LANGMAX _POSIX2_LINE_MAX
3436
3437
3438#define NL_MSGMAX INT_MAX
3439
3440
3441
3442#define NL_NMAX INT_MAX
3443
3444
3445#define NL_SETMAX INT_MAX
3446
3447
3448#define NL_TEXTMAX INT_MAX
3449
3450
3451#define NZERO 20
3452# 105 "./include/bits/xopen_lim.h"
3453#define WORD_BIT 32
3454# 129 "./include/bits/xopen_lim.h"
3455#define LONG_BIT 32
3456# 153 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/limits.h" 2
3457# 126 "./include/limits.h" 2
3458# 27 "./include/sys/param.h" 2
3459
3460# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/linux/param.h" 1
3461
3462#define _LINUX_PARAM_H
3463
3464# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm/param.h" 1
3465# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm-generic/param.h" 1
3466
3467#define __ASM_GENERIC_PARAM_H
3468
3469
3470
3471#define HZ 100
3472
3473
3474
3475#define EXEC_PAGESIZE 4096
3476
3477
3478
3479#define NOGROUP (-1)
3480
3481
3482#define MAXHOSTNAMELEN 64
3483# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm/param.h" 2
3484# 5 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/linux/param.h" 2
3485# 29 "./include/sys/param.h" 2
3486
3487
3488
3489#undef ARG_MAX
3490#undef __undef_ARG_MAX
3491
3492
3493
3494
3495#define NBBY CHAR_BIT
3496
3497#define NGROUPS NGROUPS_MAX
3498
3499#define MAXSYMLINKS 20
3500#define CANBSIZ MAX_CANON
3501#define MAXPATHLEN PATH_MAX
3502
3503
3504
3505#define NOFILE 256
3506#define NCARGS 131072
3507
3508
3509
3510
3511
3512#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
3513#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
3514#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
3515#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
3516
3517
3518
3519#define howmany(x,y) (((x) + ((y) - 1)) / (y))
3520
3521
3522#define roundup(x,y) (__builtin_constant_p (y) && powerof2 (y) ? (((x) + (y) - 1) & ~((y) - 1)) : ((((x) + ((y) - 1)) / (y)) * (y)))
3523
3524
3525
3526
3527
3528#define powerof2(x) ((((x) - 1) & (x)) == 0)
3529
3530
3531#define MIN(a,b) (((a)<(b))?(a):(b))
3532#define MAX(a,b) (((a)>(b))?(a):(b))
3533
3534
3535
3536#define DEV_BSIZE 512
3537# 41 "./ldso/include/ldso.h" 2
3538
3539
3540# 1 "./ldso/include/dl-syscall.h" 1
3541# 9 "./ldso/include/dl-syscall.h"
3542#define _LD_SYSCALL_H_
3543
3544
3545
3546# 1 "./include/sys/syscall.h" 1
3547# 20 "./include/sys/syscall.h"
3548#define _SYSCALL_H 1
3549
3550
3551
3552
3553# 1 "./include/bits/sysnum.h" 1
3554
3555
3556
3557#define _BITS_SYSNUM_H
3558
3559
3560
3561
3562
3563#undef __NR_restart_syscall
3564#define __NR_restart_syscall 0
3565#define SYS_restart_syscall __NR_restart_syscall
3566#undef __NR_exit
3567#define __NR_exit 1
3568#define SYS_exit __NR_exit
3569#undef __NR_fork
3570#define __NR_fork 2
3571#define SYS_fork __NR_fork
3572#undef __NR_read
3573#define __NR_read 3
3574#define SYS_read __NR_read
3575#undef __NR_write
3576#define __NR_write 4
3577#define SYS_write __NR_write
3578#undef __NR_open
3579#define __NR_open 5
3580#define SYS_open __NR_open
3581#undef __NR_close
3582#define __NR_close 6
3583#define SYS_close __NR_close
3584#undef __NR_creat
3585#define __NR_creat 8
3586#define SYS_creat __NR_creat
3587#undef __NR_link
3588#define __NR_link 9
3589#define SYS_link __NR_link
3590#undef __NR_unlink
3591#define __NR_unlink 10
3592#define SYS_unlink __NR_unlink
3593#undef __NR_execve
3594#define __NR_execve 11
3595#define SYS_execve __NR_execve
3596#undef __NR_chdir
3597#define __NR_chdir 12
3598#define SYS_chdir __NR_chdir
3599#undef __NR_time
3600#define __NR_time 13
3601#define SYS_time __NR_time
3602#undef __NR_mknod
3603#define __NR_mknod 14
3604#define SYS_mknod __NR_mknod
3605#undef __NR_chmod
3606#define __NR_chmod 15
3607#define SYS_chmod __NR_chmod
3608#undef __NR_chown
3609#define __NR_chown 16
3610#define SYS_chown __NR_chown
3611#undef __NR_lseek
3612#define __NR_lseek 19
3613#define SYS_lseek __NR_lseek
3614#undef __NR_getpid
3615#define __NR_getpid 20
3616#define SYS_getpid __NR_getpid
3617#undef __NR_mount
3618#define __NR_mount 21
3619#define SYS_mount __NR_mount
3620#undef __NR_setuid
3621#define __NR_setuid 23
3622#define SYS_setuid __NR_setuid
3623#undef __NR_getuid
3624#define __NR_getuid 24
3625#define SYS_getuid __NR_getuid
3626#undef __NR_stime
3627#define __NR_stime 25
3628#define SYS_stime __NR_stime
3629#undef __NR_ptrace
3630#define __NR_ptrace 26
3631#define SYS_ptrace __NR_ptrace
3632#undef __NR_alarm
3633#define __NR_alarm 27
3634#define SYS_alarm __NR_alarm
3635#undef __NR_pause
3636#define __NR_pause 29
3637#define SYS_pause __NR_pause
3638#undef __NR_access
3639#define __NR_access 33
3640#define SYS_access __NR_access
3641#undef __NR_nice
3642#define __NR_nice 34
3643#define SYS_nice __NR_nice
3644#undef __NR_sync
3645#define __NR_sync 36
3646#define SYS_sync __NR_sync
3647#undef __NR_kill
3648#define __NR_kill 37
3649#define SYS_kill __NR_kill
3650#undef __NR_rename
3651#define __NR_rename 38
3652#define SYS_rename __NR_rename
3653#undef __NR_mkdir
3654#define __NR_mkdir 39
3655#define SYS_mkdir __NR_mkdir
3656#undef __NR_rmdir
3657#define __NR_rmdir 40
3658#define SYS_rmdir __NR_rmdir
3659#undef __NR_dup
3660#define __NR_dup 41
3661#define SYS_dup __NR_dup
3662#undef __NR_pipe
3663#define __NR_pipe 42
3664#define SYS_pipe __NR_pipe
3665#undef __NR_times
3666#define __NR_times 43
3667#define SYS_times __NR_times
3668#undef __NR_brk
3669#define __NR_brk 45
3670#define SYS_brk __NR_brk
3671#undef __NR_setgid
3672#define __NR_setgid 46
3673#define SYS_setgid __NR_setgid
3674#undef __NR_getgid
3675#define __NR_getgid 47
3676#define SYS_getgid __NR_getgid
3677#undef __NR_geteuid
3678#define __NR_geteuid 49
3679#define SYS_geteuid __NR_geteuid
3680#undef __NR_getegid
3681#define __NR_getegid 50
3682#define SYS_getegid __NR_getegid
3683#undef __NR_acct
3684#define __NR_acct 51
3685#define SYS_acct __NR_acct
3686#undef __NR_umount2
3687#define __NR_umount2 52
3688#define SYS_umount2 __NR_umount2
3689#undef __NR_ioctl
3690#define __NR_ioctl 54
3691#define SYS_ioctl __NR_ioctl
3692#undef __NR_fcntl
3693#define __NR_fcntl 55
3694#define SYS_fcntl __NR_fcntl
3695#undef __NR_setpgid
3696#define __NR_setpgid 57
3697#define SYS_setpgid __NR_setpgid
3698#undef __NR_umask
3699#define __NR_umask 60
3700#define SYS_umask __NR_umask
3701#undef __NR_chroot
3702#define __NR_chroot 61
3703#define SYS_chroot __NR_chroot
3704#undef __NR_ustat
3705#define __NR_ustat 62
3706#define SYS_ustat __NR_ustat
3707#undef __NR_dup2
3708#define __NR_dup2 63
3709#define SYS_dup2 __NR_dup2
3710#undef __NR_getppid
3711#define __NR_getppid 64
3712#define SYS_getppid __NR_getppid
3713#undef __NR_getpgrp
3714#define __NR_getpgrp 65
3715#define SYS_getpgrp __NR_getpgrp
3716#undef __NR_setsid
3717#define __NR_setsid 66
3718#define SYS_setsid __NR_setsid
3719#undef __NR_sgetmask
3720#define __NR_sgetmask 68
3721#define SYS_sgetmask __NR_sgetmask
3722#undef __NR_ssetmask
3723#define __NR_ssetmask 69
3724#define SYS_ssetmask __NR_ssetmask
3725#undef __NR_setreuid
3726#define __NR_setreuid 70
3727#define SYS_setreuid __NR_setreuid
3728#undef __NR_setregid
3729#define __NR_setregid 71
3730#define SYS_setregid __NR_setregid
3731#undef __NR_sethostname
3732#define __NR_sethostname 74
3733#define SYS_sethostname __NR_sethostname
3734#undef __NR_setrlimit
3735#define __NR_setrlimit 75
3736#define SYS_setrlimit __NR_setrlimit
3737#undef __NR_getrusage
3738#define __NR_getrusage 77
3739#define SYS_getrusage __NR_getrusage
3740#undef __NR_gettimeofday
3741#define __NR_gettimeofday 78
3742#define SYS_gettimeofday __NR_gettimeofday
3743#undef __NR_settimeofday
3744#define __NR_settimeofday 79
3745#define SYS_settimeofday __NR_settimeofday
3746#undef __NR_getgroups
3747#define __NR_getgroups 80
3748#define SYS_getgroups __NR_getgroups
3749#undef __NR_setgroups
3750#define __NR_setgroups 81
3751#define SYS_setgroups __NR_setgroups
3752#undef __NR_symlink
3753#define __NR_symlink 83
3754#define SYS_symlink __NR_symlink
3755#undef __NR_readlink
3756#define __NR_readlink 85
3757#define SYS_readlink __NR_readlink
3758#undef __NR_reboot
3759#define __NR_reboot 88
3760#define SYS_reboot __NR_reboot
3761#undef __NR_munmap
3762#define __NR_munmap 91
3763#define SYS_munmap __NR_munmap
3764#undef __NR_truncate
3765#define __NR_truncate 92
3766#define SYS_truncate __NR_truncate
3767#undef __NR_ftruncate
3768#define __NR_ftruncate 93
3769#define SYS_ftruncate __NR_ftruncate
3770#undef __NR_fchmod
3771#define __NR_fchmod 94
3772#define SYS_fchmod __NR_fchmod
3773#undef __NR_fchown
3774#define __NR_fchown 95
3775#define SYS_fchown __NR_fchown
3776#undef __NR_getpriority
3777#define __NR_getpriority 96
3778#define SYS_getpriority __NR_getpriority
3779#undef __NR_setpriority
3780#define __NR_setpriority 97
3781#define SYS_setpriority __NR_setpriority
3782#undef __NR_statfs
3783#define __NR_statfs 99
3784#define SYS_statfs __NR_statfs
3785#undef __NR_fstatfs
3786#define __NR_fstatfs 100
3787#define SYS_fstatfs __NR_fstatfs
3788#undef __NR_syslog
3789#define __NR_syslog 103
3790#define SYS_syslog __NR_syslog
3791#undef __NR_setitimer
3792#define __NR_setitimer 104
3793#define SYS_setitimer __NR_setitimer
3794#undef __NR_getitimer
3795#define __NR_getitimer 105
3796#define SYS_getitimer __NR_getitimer
3797#undef __NR_stat
3798#define __NR_stat 106
3799#define SYS_stat __NR_stat
3800#undef __NR_lstat
3801#define __NR_lstat 107
3802#define SYS_lstat __NR_lstat
3803#undef __NR_fstat
3804#define __NR_fstat 108
3805#define SYS_fstat __NR_fstat
3806#undef __NR_vhangup
3807#define __NR_vhangup 111
3808#define SYS_vhangup __NR_vhangup
3809#undef __NR_wait4
3810#define __NR_wait4 114
3811#define SYS_wait4 __NR_wait4
3812#undef __NR_sysinfo
3813#define __NR_sysinfo 116
3814#define SYS_sysinfo __NR_sysinfo
3815#undef __NR_fsync
3816#define __NR_fsync 118
3817#define SYS_fsync __NR_fsync
3818#undef __NR_clone
3819#define __NR_clone 120
3820#define SYS_clone __NR_clone
3821#undef __NR_setdomainname
3822#define __NR_setdomainname 121
3823#define SYS_setdomainname __NR_setdomainname
3824#undef __NR_uname
3825#define __NR_uname 122
3826#define SYS_uname __NR_uname
3827#undef __NR_adjtimex
3828#define __NR_adjtimex 124
3829#define SYS_adjtimex __NR_adjtimex
3830#undef __NR_mprotect
3831#define __NR_mprotect 125
3832#define SYS_mprotect __NR_mprotect
3833#undef __NR_init_module
3834#define __NR_init_module 128
3835#define SYS_init_module __NR_init_module
3836#undef __NR_delete_module
3837#define __NR_delete_module 129
3838#define SYS_delete_module __NR_delete_module
3839#undef __NR_quotactl
3840#define __NR_quotactl 131
3841#define SYS_quotactl __NR_quotactl
3842#undef __NR_getpgid
3843#define __NR_getpgid 132
3844#define SYS_getpgid __NR_getpgid
3845#undef __NR_fchdir
3846#define __NR_fchdir 133
3847#define SYS_fchdir __NR_fchdir
3848#undef __NR_bdflush
3849#define __NR_bdflush 134
3850#define SYS_bdflush __NR_bdflush
3851#undef __NR_personality
3852#define __NR_personality 136
3853#define SYS_personality __NR_personality
3854#undef __NR_setfsuid
3855#define __NR_setfsuid 138
3856#define SYS_setfsuid __NR_setfsuid
3857#undef __NR_setfsgid
3858#define __NR_setfsgid 139
3859#define SYS_setfsgid __NR_setfsgid
3860#undef __NR__llseek
3861#define __NR__llseek 140
3862#define SYS__llseek __NR__llseek
3863#undef __NR_getdents
3864#define __NR_getdents 141
3865#define SYS_getdents __NR_getdents
3866#undef __NR_flock
3867#define __NR_flock 143
3868#define SYS_flock __NR_flock
3869#undef __NR_readv
3870#define __NR_readv 145
3871#define SYS_readv __NR_readv
3872#undef __NR_writev
3873#define __NR_writev 146
3874#define SYS_writev __NR_writev
3875#undef __NR_getsid
3876#define __NR_getsid 147
3877#define SYS_getsid __NR_getsid
3878#undef __NR_fdatasync
3879#define __NR_fdatasync 148
3880#define SYS_fdatasync __NR_fdatasync
3881#undef __NR__sysctl
3882#define __NR__sysctl 149
3883#define SYS__sysctl __NR__sysctl
3884#undef __NR_sched_setparam
3885#define __NR_sched_setparam 154
3886#define SYS_sched_setparam __NR_sched_setparam
3887#undef __NR_sched_getparam
3888#define __NR_sched_getparam 155
3889#define SYS_sched_getparam __NR_sched_getparam
3890#undef __NR_sched_setscheduler
3891#define __NR_sched_setscheduler 156
3892#define SYS_sched_setscheduler __NR_sched_setscheduler
3893#undef __NR_sched_getscheduler
3894#define __NR_sched_getscheduler 157
3895#define SYS_sched_getscheduler __NR_sched_getscheduler
3896#undef __NR_sched_yield
3897#define __NR_sched_yield 158
3898#define SYS_sched_yield __NR_sched_yield
3899#undef __NR_sched_get_priority_max
3900#define __NR_sched_get_priority_max 159
3901#define SYS_sched_get_priority_max __NR_sched_get_priority_max
3902#undef __NR_sched_get_priority_min
3903#define __NR_sched_get_priority_min 160
3904#define SYS_sched_get_priority_min __NR_sched_get_priority_min
3905#undef __NR_sched_rr_get_interval
3906#define __NR_sched_rr_get_interval 161
3907#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
3908#undef __NR_nanosleep
3909#define __NR_nanosleep 162
3910#define SYS_nanosleep __NR_nanosleep
3911#undef __NR_mremap
3912#define __NR_mremap 163
3913#define SYS_mremap __NR_mremap
3914#undef __NR_setresuid
3915#define __NR_setresuid 164
3916#define SYS_setresuid __NR_setresuid
3917#undef __NR_getresuid
3918#define __NR_getresuid 165
3919#define SYS_getresuid __NR_getresuid
3920#undef __NR_nfsservctl
3921#define __NR_nfsservctl 169
3922#define SYS_nfsservctl __NR_nfsservctl
3923#undef __NR_setresgid
3924#define __NR_setresgid 170
3925#define SYS_setresgid __NR_setresgid
3926#undef __NR_getresgid
3927#define __NR_getresgid 171
3928#define SYS_getresgid __NR_getresgid
3929#undef __NR_prctl
3930#define __NR_prctl 172
3931#define SYS_prctl __NR_prctl
3932#undef __NR_rt_sigreturn
3933#define __NR_rt_sigreturn 173
3934#define SYS_rt_sigreturn __NR_rt_sigreturn
3935#undef __NR_rt_sigaction
3936#define __NR_rt_sigaction 174
3937#define SYS_rt_sigaction __NR_rt_sigaction
3938#undef __NR_rt_sigprocmask
3939#define __NR_rt_sigprocmask 175
3940#define SYS_rt_sigprocmask __NR_rt_sigprocmask
3941#undef __NR_rt_sigpending
3942#define __NR_rt_sigpending 176
3943#define SYS_rt_sigpending __NR_rt_sigpending
3944#undef __NR_rt_sigtimedwait
3945#define __NR_rt_sigtimedwait 177
3946#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
3947#undef __NR_rt_sigqueueinfo
3948#define __NR_rt_sigqueueinfo 178
3949#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
3950#undef __NR_rt_sigsuspend
3951#define __NR_rt_sigsuspend 179
3952#define SYS_rt_sigsuspend __NR_rt_sigsuspend
3953#undef __NR_pread
3954#define __NR_pread 180
3955#define SYS_pread __NR_pread
3956#undef __NR_pwrite
3957#define __NR_pwrite 181
3958#define SYS_pwrite __NR_pwrite
3959#undef __NR_lchown
3960#define __NR_lchown 182
3961#define SYS_lchown __NR_lchown
3962#undef __NR_getcwd
3963#define __NR_getcwd 183
3964#define SYS_getcwd __NR_getcwd
3965#undef __NR_capget
3966#define __NR_capget 184
3967#define SYS_capget __NR_capget
3968#undef __NR_capset
3969#define __NR_capset 185
3970#define SYS_capset __NR_capset
3971#undef __NR_sigaltstack
3972#define __NR_sigaltstack 186
3973#define SYS_sigaltstack __NR_sigaltstack
3974#undef __NR_sendfile
3975#define __NR_sendfile 187
3976#define SYS_sendfile __NR_sendfile
3977#undef __NR_vfork
3978#define __NR_vfork 190
3979#define SYS_vfork __NR_vfork
3980#undef __NR_getrlimit
3981#define __NR_getrlimit 191
3982#define SYS_getrlimit __NR_getrlimit
3983#undef __NR_mmap2
3984#define __NR_mmap2 192
3985#define SYS_mmap2 __NR_mmap2
3986#undef __NR_truncate64
3987#define __NR_truncate64 193
3988#define SYS_truncate64 __NR_truncate64
3989#undef __NR_ftruncate64
3990#define __NR_ftruncate64 194
3991#define SYS_ftruncate64 __NR_ftruncate64
3992#undef __NR_stat64
3993#define __NR_stat64 195
3994#define SYS_stat64 __NR_stat64
3995#undef __NR_lstat64
3996#define __NR_lstat64 196
3997#define SYS_lstat64 __NR_lstat64
3998#undef __NR_fstat64
3999#define __NR_fstat64 197
4000#define SYS_fstat64 __NR_fstat64
4001#undef __NR_chown32
4002#define __NR_chown32 198
4003#define SYS_chown32 __NR_chown32
4004#undef __NR_getuid32
4005#define __NR_getuid32 199
4006#define SYS_getuid32 __NR_getuid32
4007#undef __NR_getgid32
4008#define __NR_getgid32 200
4009#define SYS_getgid32 __NR_getgid32
4010#undef __NR_geteuid32
4011#define __NR_geteuid32 201
4012#define SYS_geteuid32 __NR_geteuid32
4013#undef __NR_getegid32
4014#define __NR_getegid32 202
4015#define SYS_getegid32 __NR_getegid32
4016#undef __NR_setreuid32
4017#define __NR_setreuid32 203
4018#define SYS_setreuid32 __NR_setreuid32
4019#undef __NR_setregid32
4020#define __NR_setregid32 204
4021#define SYS_setregid32 __NR_setregid32
4022#undef __NR_getgroups32
4023#define __NR_getgroups32 205
4024#define SYS_getgroups32 __NR_getgroups32
4025#undef __NR_setgroups32
4026#define __NR_setgroups32 206
4027#define SYS_setgroups32 __NR_setgroups32
4028#undef __NR_fchown32
4029#define __NR_fchown32 207
4030#define SYS_fchown32 __NR_fchown32
4031#undef __NR_setresuid32
4032#define __NR_setresuid32 208
4033#define SYS_setresuid32 __NR_setresuid32
4034#undef __NR_getresuid32
4035#define __NR_getresuid32 209
4036#define SYS_getresuid32 __NR_getresuid32
4037#undef __NR_setresgid32
4038#define __NR_setresgid32 210
4039#define SYS_setresgid32 __NR_setresgid32
4040#undef __NR_getresgid32
4041#define __NR_getresgid32 211
4042#define SYS_getresgid32 __NR_getresgid32
4043#undef __NR_lchown32
4044#define __NR_lchown32 212
4045#define SYS_lchown32 __NR_lchown32
4046#undef __NR_setuid32
4047#define __NR_setuid32 213
4048#define SYS_setuid32 __NR_setuid32
4049#undef __NR_setgid32
4050#define __NR_setgid32 214
4051#define SYS_setgid32 __NR_setgid32
4052#undef __NR_setfsuid32
4053#define __NR_setfsuid32 215
4054#define SYS_setfsuid32 __NR_setfsuid32
4055#undef __NR_setfsgid32
4056#define __NR_setfsgid32 216
4057#define SYS_setfsgid32 __NR_setfsgid32
4058#undef __NR_pivot_root
4059#define __NR_pivot_root 217
4060#define SYS_pivot_root __NR_pivot_root
4061#undef __NR_getdents64
4062#define __NR_getdents64 220
4063#define SYS_getdents64 __NR_getdents64
4064#undef __NR_fcntl64
4065#define __NR_fcntl64 221
4066#define SYS_fcntl64 __NR_fcntl64
4067#undef __NR_gettid
4068#define __NR_gettid 224
4069#define SYS_gettid __NR_gettid
4070#undef __NR_readahead
4071#define __NR_readahead 225
4072#define SYS_readahead __NR_readahead
4073#undef __NR_setxattr
4074#define __NR_setxattr 226
4075#define SYS_setxattr __NR_setxattr
4076#undef __NR_lsetxattr
4077#define __NR_lsetxattr 227
4078#define SYS_lsetxattr __NR_lsetxattr
4079#undef __NR_fsetxattr
4080#define __NR_fsetxattr 228
4081#define SYS_fsetxattr __NR_fsetxattr
4082#undef __NR_getxattr
4083#define __NR_getxattr 229
4084#define SYS_getxattr __NR_getxattr
4085#undef __NR_lgetxattr
4086#define __NR_lgetxattr 230
4087#define SYS_lgetxattr __NR_lgetxattr
4088#undef __NR_fgetxattr
4089#define __NR_fgetxattr 231
4090#define SYS_fgetxattr __NR_fgetxattr
4091#undef __NR_listxattr
4092#define __NR_listxattr 232
4093#define SYS_listxattr __NR_listxattr
4094#undef __NR_llistxattr
4095#define __NR_llistxattr 233
4096#define SYS_llistxattr __NR_llistxattr
4097#undef __NR_flistxattr
4098#define __NR_flistxattr 234
4099#define SYS_flistxattr __NR_flistxattr
4100#undef __NR_removexattr
4101#define __NR_removexattr 235
4102#define SYS_removexattr __NR_removexattr
4103#undef __NR_lremovexattr
4104#define __NR_lremovexattr 236
4105#define SYS_lremovexattr __NR_lremovexattr
4106#undef __NR_fremovexattr
4107#define __NR_fremovexattr 237
4108#define SYS_fremovexattr __NR_fremovexattr
4109#undef __NR_tkill
4110#define __NR_tkill 238
4111#define SYS_tkill __NR_tkill
4112#undef __NR_sendfile64
4113#define __NR_sendfile64 239
4114#define SYS_sendfile64 __NR_sendfile64
4115#undef __NR_futex
4116#define __NR_futex 240
4117#define SYS_futex __NR_futex
4118#undef __NR_sched_setaffinity
4119#define __NR_sched_setaffinity 241
4120#define SYS_sched_setaffinity __NR_sched_setaffinity
4121#undef __NR_sched_getaffinity
4122#define __NR_sched_getaffinity 242
4123#define SYS_sched_getaffinity __NR_sched_getaffinity
4124#undef __NR_io_setup
4125#define __NR_io_setup 245
4126#define SYS_io_setup __NR_io_setup
4127#undef __NR_io_destroy
4128#define __NR_io_destroy 246
4129#define SYS_io_destroy __NR_io_destroy
4130#undef __NR_io_getevents
4131#define __NR_io_getevents 247
4132#define SYS_io_getevents __NR_io_getevents
4133#undef __NR_io_submit
4134#define __NR_io_submit 248
4135#define SYS_io_submit __NR_io_submit
4136#undef __NR_io_cancel
4137#define __NR_io_cancel 249
4138#define SYS_io_cancel __NR_io_cancel
4139#undef __NR_exit_group
4140#define __NR_exit_group 252
4141#define SYS_exit_group __NR_exit_group
4142#undef __NR_lookup_dcookie
4143#define __NR_lookup_dcookie 253
4144#define SYS_lookup_dcookie __NR_lookup_dcookie
4145#undef __NR_bfin_spinlock
4146#define __NR_bfin_spinlock 254
4147#define SYS_bfin_spinlock __NR_bfin_spinlock
4148#undef __NR_epoll_create
4149#define __NR_epoll_create 255
4150#define SYS_epoll_create __NR_epoll_create
4151#undef __NR_epoll_ctl
4152#define __NR_epoll_ctl 256
4153#define SYS_epoll_ctl __NR_epoll_ctl
4154#undef __NR_epoll_wait
4155#define __NR_epoll_wait 257
4156#define SYS_epoll_wait __NR_epoll_wait
4157#undef __NR_set_tid_address
4158#define __NR_set_tid_address 259
4159#define SYS_set_tid_address __NR_set_tid_address
4160#undef __NR_timer_create
4161#define __NR_timer_create 260
4162#define SYS_timer_create __NR_timer_create
4163#undef __NR_timer_settime
4164#define __NR_timer_settime 261
4165#define SYS_timer_settime __NR_timer_settime
4166#undef __NR_timer_gettime
4167#define __NR_timer_gettime 262
4168#define SYS_timer_gettime __NR_timer_gettime
4169#undef __NR_timer_getoverrun
4170#define __NR_timer_getoverrun 263
4171#define SYS_timer_getoverrun __NR_timer_getoverrun
4172#undef __NR_timer_delete
4173#define __NR_timer_delete 264
4174#define SYS_timer_delete __NR_timer_delete
4175#undef __NR_clock_settime
4176#define __NR_clock_settime 265
4177#define SYS_clock_settime __NR_clock_settime
4178#undef __NR_clock_gettime
4179#define __NR_clock_gettime 266
4180#define SYS_clock_gettime __NR_clock_gettime
4181#undef __NR_clock_getres
4182#define __NR_clock_getres 267
4183#define SYS_clock_getres __NR_clock_getres
4184#undef __NR_clock_nanosleep
4185#define __NR_clock_nanosleep 268
4186#define SYS_clock_nanosleep __NR_clock_nanosleep
4187#undef __NR_statfs64
4188#define __NR_statfs64 269
4189#define SYS_statfs64 __NR_statfs64
4190#undef __NR_fstatfs64
4191#define __NR_fstatfs64 270
4192#define SYS_fstatfs64 __NR_fstatfs64
4193#undef __NR_tgkill
4194#define __NR_tgkill 271
4195#define SYS_tgkill __NR_tgkill
4196#undef __NR_utimes
4197#define __NR_utimes 272
4198#define SYS_utimes __NR_utimes
4199#undef __NR_fadvise64_64
4200#define __NR_fadvise64_64 273
4201#define SYS_fadvise64_64 __NR_fadvise64_64
4202#undef __NR_mq_open
4203#define __NR_mq_open 278
4204#define SYS_mq_open __NR_mq_open
4205#undef __NR_mq_unlink
4206#define __NR_mq_unlink 279
4207#define SYS_mq_unlink __NR_mq_unlink
4208#undef __NR_mq_timedsend
4209#define __NR_mq_timedsend 280
4210#define SYS_mq_timedsend __NR_mq_timedsend
4211#undef __NR_mq_timedreceive
4212#define __NR_mq_timedreceive 281
4213#define SYS_mq_timedreceive __NR_mq_timedreceive
4214#undef __NR_mq_notify
4215#define __NR_mq_notify 282
4216#define SYS_mq_notify __NR_mq_notify
4217#undef __NR_mq_getsetattr
4218#define __NR_mq_getsetattr 283
4219#define SYS_mq_getsetattr __NR_mq_getsetattr
4220#undef __NR_kexec_load
4221#define __NR_kexec_load 284
4222#define SYS_kexec_load __NR_kexec_load
4223#undef __NR_waitid
4224#define __NR_waitid 285
4225#define SYS_waitid __NR_waitid
4226#undef __NR_add_key
4227#define __NR_add_key 286
4228#define SYS_add_key __NR_add_key
4229#undef __NR_request_key
4230#define __NR_request_key 287
4231#define SYS_request_key __NR_request_key
4232#undef __NR_keyctl
4233#define __NR_keyctl 288
4234#define SYS_keyctl __NR_keyctl
4235#undef __NR_ioprio_set
4236#define __NR_ioprio_set 289
4237#define SYS_ioprio_set __NR_ioprio_set
4238#undef __NR_ioprio_get
4239#define __NR_ioprio_get 290
4240#define SYS_ioprio_get __NR_ioprio_get
4241#undef __NR_inotify_init
4242#define __NR_inotify_init 291
4243#define SYS_inotify_init __NR_inotify_init
4244#undef __NR_inotify_add_watch
4245#define __NR_inotify_add_watch 292
4246#define SYS_inotify_add_watch __NR_inotify_add_watch
4247#undef __NR_inotify_rm_watch
4248#define __NR_inotify_rm_watch 293
4249#define SYS_inotify_rm_watch __NR_inotify_rm_watch
4250#undef __NR_openat
4251#define __NR_openat 295
4252#define SYS_openat __NR_openat
4253#undef __NR_mkdirat
4254#define __NR_mkdirat 296
4255#define SYS_mkdirat __NR_mkdirat
4256#undef __NR_mknodat
4257#define __NR_mknodat 297
4258#define SYS_mknodat __NR_mknodat
4259#undef __NR_fchownat
4260#define __NR_fchownat 298
4261#define SYS_fchownat __NR_fchownat
4262#undef __NR_futimesat
4263#define __NR_futimesat 299
4264#define SYS_futimesat __NR_futimesat
4265#undef __NR_fstatat64
4266#define __NR_fstatat64 300
4267#define SYS_fstatat64 __NR_fstatat64
4268#undef __NR_unlinkat
4269#define __NR_unlinkat 301
4270#define SYS_unlinkat __NR_unlinkat
4271#undef __NR_renameat
4272#define __NR_renameat 302
4273#define SYS_renameat __NR_renameat
4274#undef __NR_linkat
4275#define __NR_linkat 303
4276#define SYS_linkat __NR_linkat
4277#undef __NR_symlinkat
4278#define __NR_symlinkat 304
4279#define SYS_symlinkat __NR_symlinkat
4280#undef __NR_readlinkat
4281#define __NR_readlinkat 305
4282#define SYS_readlinkat __NR_readlinkat
4283#undef __NR_fchmodat
4284#define __NR_fchmodat 306
4285#define SYS_fchmodat __NR_fchmodat
4286#undef __NR_faccessat
4287#define __NR_faccessat 307
4288#define SYS_faccessat __NR_faccessat
4289#undef __NR_pselect6
4290#define __NR_pselect6 308
4291#define SYS_pselect6 __NR_pselect6
4292#undef __NR_ppoll
4293#define __NR_ppoll 309
4294#define SYS_ppoll __NR_ppoll
4295#undef __NR_unshare
4296#define __NR_unshare 310
4297#define SYS_unshare __NR_unshare
4298#undef __NR_sram_alloc
4299#define __NR_sram_alloc 311
4300#define SYS_sram_alloc __NR_sram_alloc
4301#undef __NR_sram_free
4302#define __NR_sram_free 312
4303#define SYS_sram_free __NR_sram_free
4304#undef __NR_dma_memcpy
4305#define __NR_dma_memcpy 313
4306#define SYS_dma_memcpy __NR_dma_memcpy
4307#undef __NR_accept
4308#define __NR_accept 314
4309#define SYS_accept __NR_accept
4310#undef __NR_bind
4311#define __NR_bind 315
4312#define SYS_bind __NR_bind
4313#undef __NR_connect
4314#define __NR_connect 316
4315#define SYS_connect __NR_connect
4316#undef __NR_getpeername
4317#define __NR_getpeername 317
4318#define SYS_getpeername __NR_getpeername
4319#undef __NR_getsockname
4320#define __NR_getsockname 318
4321#define SYS_getsockname __NR_getsockname
4322#undef __NR_getsockopt
4323#define __NR_getsockopt 319
4324#define SYS_getsockopt __NR_getsockopt
4325#undef __NR_listen
4326#define __NR_listen 320
4327#define SYS_listen __NR_listen
4328#undef __NR_recv
4329#define __NR_recv 321
4330#define SYS_recv __NR_recv
4331#undef __NR_recvfrom
4332#define __NR_recvfrom 322
4333#define SYS_recvfrom __NR_recvfrom
4334#undef __NR_recvmsg
4335#define __NR_recvmsg 323
4336#define SYS_recvmsg __NR_recvmsg
4337#undef __NR_send
4338#define __NR_send 324
4339#define SYS_send __NR_send
4340#undef __NR_sendmsg
4341#define __NR_sendmsg 325
4342#define SYS_sendmsg __NR_sendmsg
4343#undef __NR_sendto
4344#define __NR_sendto 326
4345#define SYS_sendto __NR_sendto
4346#undef __NR_setsockopt
4347#define __NR_setsockopt 327
4348#define SYS_setsockopt __NR_setsockopt
4349#undef __NR_shutdown
4350#define __NR_shutdown 328
4351#define SYS_shutdown __NR_shutdown
4352#undef __NR_socket
4353#define __NR_socket 329
4354#define SYS_socket __NR_socket
4355#undef __NR_socketpair
4356#define __NR_socketpair 330
4357#define SYS_socketpair __NR_socketpair
4358#undef __NR_semctl
4359#define __NR_semctl 331
4360#define SYS_semctl __NR_semctl
4361#undef __NR_semget
4362#define __NR_semget 332
4363#define SYS_semget __NR_semget
4364#undef __NR_semop
4365#define __NR_semop 333
4366#define SYS_semop __NR_semop
4367#undef __NR_msgctl
4368#define __NR_msgctl 334
4369#define SYS_msgctl __NR_msgctl
4370#undef __NR_msgget
4371#define __NR_msgget 335
4372#define SYS_msgget __NR_msgget
4373#undef __NR_msgrcv
4374#define __NR_msgrcv 336
4375#define SYS_msgrcv __NR_msgrcv
4376#undef __NR_msgsnd
4377#define __NR_msgsnd 337
4378#define SYS_msgsnd __NR_msgsnd
4379#undef __NR_shmat
4380#define __NR_shmat 338
4381#define SYS_shmat __NR_shmat
4382#undef __NR_shmctl
4383#define __NR_shmctl 339
4384#define SYS_shmctl __NR_shmctl
4385#undef __NR_shmdt
4386#define __NR_shmdt 340
4387#define SYS_shmdt __NR_shmdt
4388#undef __NR_shmget
4389#define __NR_shmget 341
4390#define SYS_shmget __NR_shmget
4391#undef __NR_splice
4392#define __NR_splice 342
4393#define SYS_splice __NR_splice
4394#undef __NR_sync_file_range
4395#define __NR_sync_file_range 343
4396#define SYS_sync_file_range __NR_sync_file_range
4397#undef __NR_tee
4398#define __NR_tee 344
4399#define SYS_tee __NR_tee
4400#undef __NR_vmsplice
4401#define __NR_vmsplice 345
4402#define SYS_vmsplice __NR_vmsplice
4403#undef __NR_epoll_pwait
4404#define __NR_epoll_pwait 346
4405#define SYS_epoll_pwait __NR_epoll_pwait
4406#undef __NR_utimensat
4407#define __NR_utimensat 347
4408#define SYS_utimensat __NR_utimensat
4409#undef __NR_signalfd
4410#define __NR_signalfd 348
4411#define SYS_signalfd __NR_signalfd
4412#undef __NR_timerfd_create
4413#define __NR_timerfd_create 349
4414#define SYS_timerfd_create __NR_timerfd_create
4415#undef __NR_eventfd
4416#define __NR_eventfd 350
4417#define SYS_eventfd __NR_eventfd
4418#undef __NR_pread64
4419#define __NR_pread64 351
4420#define SYS_pread64 __NR_pread64
4421#undef __NR_pwrite64
4422#define __NR_pwrite64 352
4423#define SYS_pwrite64 __NR_pwrite64
4424#undef __NR_fadvise64
4425#define __NR_fadvise64 353
4426#define SYS_fadvise64 __NR_fadvise64
4427#undef __NR_set_robust_list
4428#define __NR_set_robust_list 354
4429#define SYS_set_robust_list __NR_set_robust_list
4430#undef __NR_get_robust_list
4431#define __NR_get_robust_list 355
4432#define SYS_get_robust_list __NR_get_robust_list
4433#undef __NR_fallocate
4434#define __NR_fallocate 356
4435#define SYS_fallocate __NR_fallocate
4436#undef __NR_semtimedop
4437#define __NR_semtimedop 357
4438#define SYS_semtimedop __NR_semtimedop
4439#undef __NR_timerfd_settime
4440#define __NR_timerfd_settime 358
4441#define SYS_timerfd_settime __NR_timerfd_settime
4442#undef __NR_timerfd_gettime
4443#define __NR_timerfd_gettime 359
4444#define SYS_timerfd_gettime __NR_timerfd_gettime
4445#undef __NR_signalfd4
4446#define __NR_signalfd4 360
4447#define SYS_signalfd4 __NR_signalfd4
4448#undef __NR_eventfd2
4449#define __NR_eventfd2 361
4450#define SYS_eventfd2 __NR_eventfd2
4451#undef __NR_epoll_create1
4452#define __NR_epoll_create1 362
4453#define SYS_epoll_create1 __NR_epoll_create1
4454#undef __NR_dup3
4455#define __NR_dup3 363
4456#define SYS_dup3 __NR_dup3
4457#undef __NR_pipe2
4458#define __NR_pipe2 364
4459#define SYS_pipe2 __NR_pipe2
4460#undef __NR_inotify_init1
4461#define __NR_inotify_init1 365
4462#define SYS_inotify_init1 __NR_inotify_init1
4463#undef __NR_preadv
4464#define __NR_preadv 366
4465#define SYS_preadv __NR_preadv
4466#undef __NR_pwritev
4467#define __NR_pwritev 367
4468#define SYS_pwritev __NR_pwritev
4469#undef __NR_rt_tgsigqueueinfo
4470#define __NR_rt_tgsigqueueinfo 368
4471#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
4472#undef __NR_perf_event_open
4473#define __NR_perf_event_open 369
4474#define SYS_perf_event_open __NR_perf_event_open
4475#undef __NR_recvmmsg
4476#define __NR_recvmmsg 370
4477#define SYS_recvmmsg __NR_recvmmsg
4478#undef __NR_fanotify_init
4479#define __NR_fanotify_init 371
4480#define SYS_fanotify_init __NR_fanotify_init
4481#undef __NR_fanotify_mark
4482#define __NR_fanotify_mark 372
4483#define SYS_fanotify_mark __NR_fanotify_mark
4484#undef __NR_prlimit64
4485#define __NR_prlimit64 373
4486#define SYS_prlimit64 __NR_prlimit64
4487#undef __NR_cacheflush
4488#define __NR_cacheflush 374
4489#define SYS_cacheflush __NR_cacheflush
4490#undef __NR_name_to_handle_at
4491#define __NR_name_to_handle_at 375
4492#define SYS_name_to_handle_at __NR_name_to_handle_at
4493#undef __NR_open_by_handle_at
4494#define __NR_open_by_handle_at 376
4495#define SYS_open_by_handle_at __NR_open_by_handle_at
4496#undef __NR_clock_adjtime
4497#define __NR_clock_adjtime 377
4498#define SYS_clock_adjtime __NR_clock_adjtime
4499#undef __NR_syncfs
4500#define __NR_syncfs 378
4501#define SYS_syncfs __NR_syncfs
4502#undef __NR_setns
4503#define __NR_setns 379
4504#define SYS_setns __NR_setns
4505#undef __NR_sendmmsg
4506#define __NR_sendmmsg 380
4507#define SYS_sendmmsg __NR_sendmmsg
4508#undef __NR_process_vm_readv
4509#define __NR_process_vm_readv 381
4510#define SYS_process_vm_readv __NR_process_vm_readv
4511#undef __NR_process_vm_writev
4512#define __NR_process_vm_writev 382
4513#define SYS_process_vm_writev __NR_process_vm_writev
4514#undef __NR_syscall
4515#define __NR_syscall 383
4516#define SYS_syscall __NR_syscall
4517# 26 "./include/sys/syscall.h" 2
4518# 34 "./include/sys/syscall.h"
4519# 1 "./include/bits/syscalls.h" 1
4520
4521#define _BITS_SYSCALLS_H
4522
4523
4524
4525
4526
4527
4528#define INTERNAL_SYSCALL_NCS(name,err,nr,args...) (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (name) ASMFMT_ ##nr(args) : "memory","CC"); __res; }) )
4529# 21 "./include/bits/syscalls.h"
4530#define ASMFMT_0()
4531
4532#define ASMFMT_1(arg1) , "q0" ((long)(arg1))
4533
4534
4535#define ASMFMT_2(arg1,arg2) ASMFMT_1(arg1) , "q1" ((long)(arg2))
4536
4537
4538
4539#define ASMFMT_3(arg1,arg2,arg3) ASMFMT_2(arg1, arg2) , "q2" ((long)(arg3))
4540
4541
4542
4543#define ASMFMT_4(arg1,arg2,arg3,arg4) ASMFMT_3(arg1, arg2, arg3) , "q3" ((long)(arg4))
4544
4545
4546
4547#define ASMFMT_5(arg1,arg2,arg3,arg4,arg5) ASMFMT_4(arg1, arg2, arg3, arg4) , "q4" ((long)(arg5))
4548
4549
4550
4551#define ASMFMT_6(arg1,arg2,arg3,arg4,arg5,arg6) ASMFMT_5(arg1, arg2, arg3, arg4, arg5) , "q5" ((long)(arg6))
4552# 35 "./include/sys/syscall.h" 2
4553# 1 "./include/bits/syscalls-common.h" 1
4554
4555
4556
4557
4558
4559
4560
4561#define _SYSCALLS_COMMON_H 1
4562
4563
4564
4565
4566
4567
4568#define SYS_ify(syscall_name) (__NR_ ##syscall_name)
4569
4570
4571
4572
4573# 1 "./include/errno.h" 1
4574# 28 "./include/errno.h"
4575#define _ERRNO_H 1
4576
4577
4578
4579
4580
4581
4582
4583# 1 "./include/bits/errno.h" 1
4584# 22 "./include/bits/errno.h"
4585#undef EDOM
4586#undef EILSEQ
4587#undef ERANGE
4588# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/linux/errno.h" 1
4589
4590#define _LINUX_ERRNO_H
4591
4592# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm/errno.h" 1
4593# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm-generic/errno.h" 1
4594
4595#define _ASM_GENERIC_ERRNO_H
4596
4597# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm-generic/errno-base.h" 1
4598
4599#define _ASM_GENERIC_ERRNO_BASE_H
4600
4601#define EPERM 1
4602#define ENOENT 2
4603#define ESRCH 3
4604#define EINTR 4
4605#define EIO 5
4606#define ENXIO 6
4607#define E2BIG 7
4608#define ENOEXEC 8
4609#define EBADF 9
4610#define ECHILD 10
4611#define EAGAIN 11
4612#define ENOMEM 12
4613#define EACCES 13
4614#define EFAULT 14
4615#define ENOTBLK 15
4616#define EBUSY 16
4617#define EEXIST 17
4618#define EXDEV 18
4619#define ENODEV 19
4620#define ENOTDIR 20
4621#define EISDIR 21
4622#define EINVAL 22
4623#define ENFILE 23
4624#define EMFILE 24
4625#define ENOTTY 25
4626#define ETXTBSY 26
4627#define EFBIG 27
4628#define ENOSPC 28
4629#define ESPIPE 29
4630#define EROFS 30
4631#define EMLINK 31
4632#define EPIPE 32
4633#define EDOM 33
4634#define ERANGE 34
4635# 5 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm-generic/errno.h" 2
4636
4637#define EDEADLK 35
4638#define ENAMETOOLONG 36
4639#define ENOLCK 37
4640#define ENOSYS 38
4641#define ENOTEMPTY 39
4642#define ELOOP 40
4643#define EWOULDBLOCK EAGAIN
4644#define ENOMSG 42
4645#define EIDRM 43
4646#define ECHRNG 44
4647#define EL2NSYNC 45
4648#define EL3HLT 46
4649#define EL3RST 47
4650#define ELNRNG 48
4651#define EUNATCH 49
4652#define ENOCSI 50
4653#define EL2HLT 51
4654#define EBADE 52
4655#define EBADR 53
4656#define EXFULL 54
4657#define ENOANO 55
4658#define EBADRQC 56
4659#define EBADSLT 57
4660
4661#define EDEADLOCK EDEADLK
4662
4663#define EBFONT 59
4664#define ENOSTR 60
4665#define ENODATA 61
4666#define ETIME 62
4667#define ENOSR 63
4668#define ENONET 64
4669#define ENOPKG 65
4670#define EREMOTE 66
4671#define ENOLINK 67
4672#define EADV 68
4673#define ESRMNT 69
4674#define ECOMM 70
4675#define EPROTO 71
4676#define EMULTIHOP 72
4677#define EDOTDOT 73
4678#define EBADMSG 74
4679#define EOVERFLOW 75
4680#define ENOTUNIQ 76
4681#define EBADFD 77
4682#define EREMCHG 78
4683#define ELIBACC 79
4684#define ELIBBAD 80
4685#define ELIBSCN 81
4686#define ELIBMAX 82
4687#define ELIBEXEC 83
4688#define EILSEQ 84
4689#define ERESTART 85
4690#define ESTRPIPE 86
4691#define EUSERS 87
4692#define ENOTSOCK 88
4693#define EDESTADDRREQ 89
4694#define EMSGSIZE 90
4695#define EPROTOTYPE 91
4696#define ENOPROTOOPT 92
4697#define EPROTONOSUPPORT 93
4698#define ESOCKTNOSUPPORT 94
4699#define EOPNOTSUPP 95
4700#define EPFNOSUPPORT 96
4701#define EAFNOSUPPORT 97
4702#define EADDRINUSE 98
4703#define EADDRNOTAVAIL 99
4704#define ENETDOWN 100
4705#define ENETUNREACH 101
4706#define ENETRESET 102
4707#define ECONNABORTED 103
4708#define ECONNRESET 104
4709#define ENOBUFS 105
4710#define EISCONN 106
4711#define ENOTCONN 107
4712#define ESHUTDOWN 108
4713#define ETOOMANYREFS 109
4714#define ETIMEDOUT 110
4715#define ECONNREFUSED 111
4716#define EHOSTDOWN 112
4717#define EHOSTUNREACH 113
4718#define EALREADY 114
4719#define EINPROGRESS 115
4720#define ESTALE 116
4721#define EUCLEAN 117
4722#define ENOTNAM 118
4723#define ENAVAIL 119
4724#define EISNAM 120
4725#define EREMOTEIO 121
4726#define EDQUOT 122
4727
4728#define ENOMEDIUM 123
4729#define EMEDIUMTYPE 124
4730#define ECANCELED 125
4731#define ENOKEY 126
4732#define EKEYEXPIRED 127
4733#define EKEYREVOKED 128
4734#define EKEYREJECTED 129
4735
4736
4737#define EOWNERDEAD 130
4738#define ENOTRECOVERABLE 131
4739
4740#define ERFKILL 132
4741
4742#define EHWPOISON 133
4743# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/asm/errno.h" 2
4744# 5 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/include/linux/errno.h" 2
4745# 26 "./include/bits/errno.h" 2
4746
4747
4748
4749#define ENOTSUP EOPNOTSUPP
4750# 45 "./include/bits/errno.h"
4751extern int *__errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
4752
4753# 37 "./include/errno.h" 2
4754#undef __need_Emath
4755# 47 "./include/errno.h"
4756extern int errno;
4757# 59 "./include/errno.h"
4758
4759
4760
4761
4762#undef errno
4763#define errno _dl_errno
4764extern int _dl_errno;
4765# 79 "./include/errno.h"
4766#define __set_errno(val) (errno = (val))
4767# 91 "./include/errno.h"
4768typedef int error_t;
4769#define __error_t_defined 1
4770
4771#undef __need_error_t
4772# 21 "./include/bits/syscalls-common.h" 2
4773
4774
4775#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
4776
4777
4778#define INTERNAL_SYSCALL_ERROR_P(val,err) ((unsigned long)val >= (unsigned long)(-4095))
4779
4780
4781#define INTERNAL_SYSCALL_ERRNO(val,err) (-(val))
4782
4783
4784
4785
4786#define INLINE_SYSCALL(name,nr,args...) INLINE_SYSCALL_NCS(__NR_ ##name, nr, args)
4787
4788
4789#define INLINE_SYSCALL_NOERR(name,nr,args...) INLINE_SYSCALL_NOERR_NCS(__NR_ ##name, nr, args)
4790
4791
4792
4793
4794#define INLINE_SYSCALL_NCS(name,nr,args...) (__extension__ ({ INTERNAL_SYSCALL_DECL(__err); (__extension__ ({ long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args); if (unlikely(INTERNAL_SYSCALL_ERROR_P(__res, __err))) { __set_errno(INTERNAL_SYSCALL_ERRNO(__res, __err)); __res = -1L; } __res; }) ); }) )
4795# 60 "./include/bits/syscalls-common.h"
4796#define INLINE_SYSCALL_NOERR_NCS(name,nr,args...) ({ INTERNAL_SYSCALL_DECL(__err); long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args); __res; })
4797# 70 "./include/bits/syscalls-common.h"
4798#define INTERNAL_SYSCALL(name,err,nr,args...) INTERNAL_SYSCALL_NCS(__NR_ ##name, err, nr, args)
4799# 79 "./include/bits/syscalls-common.h"
4800#define C_DECL_ARGS_0() void
4801#define C_DECL_ARGS_1(t,v) t v
4802#define C_DECL_ARGS_2(t,v,args...) t v, C_DECL_ARGS_1(args)
4803#define C_DECL_ARGS_3(t,v,args...) t v, C_DECL_ARGS_2(args)
4804#define C_DECL_ARGS_4(t,v,args...) t v, C_DECL_ARGS_3(args)
4805#define C_DECL_ARGS_5(t,v,args...) t v, C_DECL_ARGS_4(args)
4806#define C_DECL_ARGS_6(t,v,args...) t v, C_DECL_ARGS_5(args)
4807
4808#define C_ARGS_0()
4809#define C_ARGS_1(t,v) v
4810#define C_ARGS_2(t,v,args...) v, C_ARGS_1(args)
4811#define C_ARGS_3(t,v,args...) v, C_ARGS_2(args)
4812#define C_ARGS_4(t,v,args...) v, C_ARGS_3(args)
4813#define C_ARGS_5(t,v,args...) v, C_ARGS_4(args)
4814#define C_ARGS_6(t,v,args...) v, C_ARGS_5(args)
4815
4816#define SYSCALL_FUNC(nargs,type,name,args...) type name(C_DECL_ARGS_ ##nargs(args)) { return (type)INLINE_SYSCALL(name, nargs, C_ARGS_ ##nargs(args)); }
4817
4818
4819
4820
4821#define SYSCALL_NOERR_FUNC(nargs,type,name,args...) type name(C_DECL_ARGS_ ##nargs(args)) { return (type)INLINE_SYSCALL_NOERR(name, nargs, C_ARGS_ ##nargs(args)); }
4822
4823
4824
4825
4826#define _syscall0(args...) SYSCALL_FUNC(0, args)
4827#define _syscall_noerr0(args...) SYSCALL_NOERR_FUNC(0, args)
4828#define _syscall1(args...) SYSCALL_FUNC(1, args)
4829#define _syscall_noerr1(args...) SYSCALL_NOERR_FUNC(1, args)
4830#define _syscall2(args...) SYSCALL_FUNC(2, args)
4831#define _syscall3(args...) SYSCALL_FUNC(3, args)
4832#define _syscall4(args...) SYSCALL_FUNC(4, args)
4833#define _syscall5(args...) SYSCALL_FUNC(5, args)
4834#define _syscall6(args...) SYSCALL_FUNC(6, args)
4835# 36 "./include/sys/syscall.h" 2
4836# 14 "./ldso/include/dl-syscall.h" 2
4837extern int _dl_errno;
4838#undef __set_errno
4839#define __set_errno(X) {(_dl_errno) = (X);}
4840
4841
4842# 1 "./ldso/ldso/bfin/dl-syscalls.h" 1
4843# 22 "./ldso/ldso/bfin/dl-syscalls.h"
4844#define __NR__dl_sram_alloc __NR_sram_alloc
4845static __inline __attribute__ ((__always_inline__)) void * _dl_sram_alloc(
4846 size_t len, unsigned long flags) { return (void *)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (311) , "q0" ((long)(len)) , "q1" ((long)(flags)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
4847
4848
4849
4850#define __NR__dl_sram_free __NR_sram_free
4851static __inline __attribute__ ((__always_inline__)) int _dl_sram_free(void * addr) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (312) , "q0" ((long)(addr)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
4852
4853
4854
4855#define __NR__dl_dma_memcpy __NR_dma_memcpy
4856static __inline __attribute__ ((__always_inline__)) void * _dl_dma_memcpy(
4857 void * dest, void * src, size_t len) { return (void *)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (313) , "q0" ((long)(dest)) , "q1" ((long)(src)) , "q2" ((long)(len)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
4858
4859
4860#define __UCLIBC_MMAP_HAS_6_ARGS__
4861# 20 "./ldso/include/dl-syscall.h" 2
4862
4863#define _SYS_MMAN_H 1
4864# 1 "./include/bits/mman.h" 1
4865# 1 "./include/bits/mman-common.h" 1
4866# 33 "./include/bits/mman-common.h"
4867#define PROT_READ 0x1
4868#define PROT_WRITE 0x2
4869#define PROT_EXEC 0x4
4870#define PROT_NONE 0x0
4871#define PROT_GROWSDOWN 0x01000000
4872
4873#define PROT_GROWSUP 0x02000000
4874
4875
4876
4877#define MAP_SHARED 0x01
4878#define MAP_PRIVATE 0x02
4879
4880#define MAP_TYPE 0x0f
4881
4882
4883
4884#define MAP_FIXED 0x10
4885
4886#define MAP_FILE 0
4887#define MAP_ANONYMOUS 0x20
4888#define MAP_ANON MAP_ANONYMOUS
4889
4890
4891
4892
4893#define MAP_GROWSDOWN 0x00100
4894#define MAP_DENYWRITE 0x00800
4895#define MAP_EXECUTABLE 0x01000
4896#define MAP_LOCKED 0x02000
4897#define MAP_NORESERVE 0x04000
4898#define MAP_POPULATE 0x08000
4899#define MAP_NONBLOCK 0x10000
4900#define MAP_STACK 0x20000
4901#define MAP_UNINITIALIZE 0x4000000
4902
4903
4904
4905
4906#define MS_ASYNC 1
4907#define MS_SYNC 4
4908#define MS_INVALIDATE 2
4909
4910
4911#define MCL_CURRENT 1
4912#define MCL_FUTURE 2
4913
4914
4915
4916
4917#define MREMAP_MAYMOVE 1
4918#define MREMAP_FIXED 2
4919
4920
4921
4922
4923#define MADV_NORMAL 0
4924#define MADV_RANDOM 1
4925#define MADV_SEQUENTIAL 2
4926#define MADV_WILLNEED 3
4927#define MADV_DONTNEED 4
4928#define MADV_REMOVE 9
4929#define MADV_DONTFORK 10
4930#define MADV_DOFORK 11
4931#define MADV_MERGEABLE 12
4932#define MADV_UNMERGEABLE 13
4933#define MADV_HWPOISON 100
4934
4935
4936
4937
4938#define POSIX_MADV_NORMAL 0
4939#define POSIX_MADV_RANDOM 1
4940#define POSIX_MADV_SEQUENTIAL 2
4941#define POSIX_MADV_WILLNEED 3
4942#define POSIX_MADV_DONTNEED 4
4943# 1 "./include/bits/mman.h" 2
4944# 23 "./ldso/include/dl-syscall.h" 2
4945
4946
4947
4948
4949
4950
4951#define kernel_stat stat
4952
4953# 1 "./include/bits/kernel_stat.h" 1
4954
4955#define _BITS_STAT_STRUCT_H
4956
4957
4958
4959
4960
4961struct stat {
4962 unsigned short st_dev;
4963 unsigned short __pad1;
4964 unsigned long st_ino;
4965 unsigned short st_mode;
4966 unsigned short st_nlink;
4967 unsigned short st_uid;
4968 unsigned short st_gid;
4969 unsigned short st_rdev;
4970 unsigned short __pad2;
4971 unsigned long st_size;
4972 unsigned long st_blksize;
4973 unsigned long st_blocks;
4974 struct timespec st_atim;
4975 struct timespec st_mtim;
4976 struct timespec st_ctim;
4977 unsigned long __unused4;
4978 unsigned long __unused5;
4979};
4980
4981struct kernel_stat64 {
4982 unsigned short st_dev;
4983 unsigned char __pad0[10];
4984#define _HAVE_STAT64___ST_INO
4985 unsigned long __st_ino;
4986 unsigned int st_mode;
4987 unsigned int st_nlink;
4988 unsigned long st_uid;
4989 unsigned long st_gid;
4990 unsigned short st_rdev;
4991 unsigned char __pad3[10];
4992 long long st_size;
4993 unsigned long st_blksize;
4994 unsigned long st_blocks;
4995 unsigned long __pad4;
4996 struct timespec st_atim;
4997 struct timespec st_mtim;
4998 struct timespec st_ctim;
4999 unsigned long long st_ino;
5000};
5001# 32 "./ldso/include/dl-syscall.h" 2
5002
5003
5004
5005#define S_ISUID 04000
5006#define S_ISGID 02000
5007# 45 "./ldso/include/dl-syscall.h"
5008#define __NR__dl_exit __NR_exit
5009static __inline __attribute__ ((__always_inline__)) void _dl_exit(int status) { return (void)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (1) , "q0" ((long)(status)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5010
5011#define __NR__dl_close __NR_close
5012static __inline __attribute__ ((__always_inline__)) int _dl_close(int fd) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (6) , "q0" ((long)(fd)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5013
5014#define __NR__dl_open __NR_open
5015static __inline __attribute__ ((__always_inline__)) int _dl_open(
5016 const char * fn, int flags, __kernel_mode_t mode) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (5) , "q0" ((long)(fn)) , "q1" ((long)(flags)) , "q2" ((long)(mode)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5017
5018#define __NR__dl_write __NR_write
5019static __inline __attribute__ ((__always_inline__)) unsigned long _dl_write(
5020 int fd, const void * buf, unsigned long count) { return (unsigned long)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (4) , "q0" ((long)(fd)) , "q1" ((long)(buf)) , "q2" ((long)(count)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5021
5022#define __NR__dl_read __NR_read
5023static __inline __attribute__ ((__always_inline__)) unsigned long _dl_read(
5024 int fd, const void * buf, unsigned long count) { return (unsigned long)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (3) , "q0" ((long)(fd)) , "q1" ((long)(buf)) , "q2" ((long)(count)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5025
5026#define __NR__dl_mprotect __NR_mprotect
5027static __inline __attribute__ ((__always_inline__)) int _dl_mprotect(
5028 const void * addr, unsigned long len, int prot) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (125) , "q0" ((long)(addr)) , "q1" ((long)(len)) , "q2" ((long)(prot)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5029
5030#define __NR__dl_stat __NR_stat
5031static __inline __attribute__ ((__always_inline__)) int _dl_stat(
5032 const char * file_name, struct stat * buf) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (106) , "q0" ((long)(file_name)) , "q1" ((long)(buf)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5033
5034#define __NR__dl_fstat __NR_fstat
5035static __inline __attribute__ ((__always_inline__)) int _dl_fstat(int fd, struct stat * buf) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (108) , "q0" ((long)(fd)) , "q1" ((long)(buf)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5036
5037#define __NR__dl_munmap __NR_munmap
5038static __inline __attribute__ ((__always_inline__)) int _dl_munmap(void * start, unsigned long length) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (91) , "q0" ((long)(start)) , "q1" ((long)(length)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5039
5040
5041
5042
5043#define __NR__dl_getuid __NR_getuid
5044static __inline __attribute__ ((__always_inline__)) uid_t _dl_getuid(void) { return (uid_t)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (24) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5045
5046
5047
5048
5049#define __NR__dl_geteuid __NR_geteuid
5050static __inline __attribute__ ((__always_inline__)) uid_t _dl_geteuid(void) { return (uid_t)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (49) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5051
5052
5053
5054
5055#define __NR__dl_getgid __NR_getgid
5056static __inline __attribute__ ((__always_inline__)) gid_t _dl_getgid(void) { return (gid_t)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (47) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5057
5058
5059
5060
5061#define __NR__dl_getegid __NR_getegid
5062static __inline __attribute__ ((__always_inline__)) gid_t _dl_getegid(void) { return (gid_t)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (50) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5063
5064
5065
5066
5067#define __NR__dl_getpid __NR_getpid
5068static __inline __attribute__ ((__always_inline__)) gid_t _dl_getpid(void) { return (gid_t)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (20) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5069
5070#define __NR__dl_readlink __NR_readlink
5071static __inline __attribute__ ((__always_inline__)) int _dl_readlink(
5072 const char * path, char * buf, size_t bufsiz) { return (int)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (85) , "q0" ((long)(path)) , "q1" ((long)(buf)) , "q2" ((long)(bufsiz)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5073
5074
5075#define __NR___syscall_pread __NR_pread64
5076static __inline __attribute__ ((__always_inline__)) ssize_t __syscall_pread(
5077 int fd, void * buf, size_t count, off_t offset_hi, off_t offset_lo) { return (ssize_t)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (351) , "q0" ((long)(fd)) , "q1" ((long)(buf)) , "q2" ((long)(count)) , "q3" ((long)(offset_hi)) , "q4" ((long)(offset_lo)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) ); }
5078
5079static __inline __attribute__ ((__always_inline__)) ssize_t
5080_dl_pread(int fd, void *buf, size_t count, off_t offset)
5081{
5082 return __syscall_pread(fd, buf, count, offset, offset >> 31);
5083}
5084# 150 "./ldso/include/dl-syscall.h"
5085#define MMAP2_PAGE_SHIFT 12
5086
5087
5088#define MAP_FAILED ((void *) -1)
5089#define _dl_mmap_check_error(X) (((void *)X) == MAP_FAILED)
5090
5091static __inline __attribute__ ((__always_inline__))
5092void *_dl_mmap(void *addr, unsigned long size, int prot,
5093 int flags, int fd, unsigned long offset)
5094{
5095
5096
5097
5098
5099
5100
5101 unsigned long shifted;
5102
5103 if (offset & ((1 << 12) - 1))
5104 return ((void *) -1);
5105
5106
5107 shifted = offset >> 12;
5108 return (void *)(__extension__ ({ do { } while (0); (__extension__ ({ long __res = (__extension__ ({ long __res; __asm__ __volatile__ ( "excpt 0;\n\t" : "=q0" (__res) : "qA" (192) , "q0" ((long)(addr)) , "q1" ((long)(size)) , "q2" ((long)(prot)) , "q3" ((long)(flags)) , "q4" ((long)(fd)) , "q5" ((long)(shifted)) : "memory","CC"); __res; }) ); if (__builtin_expect((!!(((unsigned long)__res >= (unsigned long)(-4095)))),0)) { {(_dl_errno) = ((-(__res)));}; __res = -1L; } __res; }) ); }) );
5109# 188 "./ldso/include/dl-syscall.h"
5110}
5111# 44 "./ldso/include/ldso.h" 2
5112# 1 "./ldso/include/dl-string.h" 1
5113# 9 "./ldso/include/dl-string.h"
5114#define _LINUX_STRING_H_
5115
5116# 1 "./ldso/ldso/bfin/dl-sysdep.h" 1
5117# 17 "./ldso/ldso/bfin/dl-sysdep.h"
5118#undef ELF_USES_RELOCA
5119
5120
5121#define ELF_MACHINE_PLTREL_OVERLAP
5122
5123#define DL_NO_COPY_RELOCS
5124
5125
5126#define MAGIC1 EM_BLACKFIN
5127#undef MAGIC2
5128
5129
5130#define ELF_TARGET "BFIN"
5131
5132
5133#define ARCH_NEEDS_BOOTSTRAP_RELOCS
5134
5135extern int _dl_linux_resolve(void) __attribute__((__visibility__("hidden")));
5136
5137#undef SEND_EARLY_STDERR
5138#define SEND_EARLY_STDERR(S) do { static const char __attribute__((section(".text"))) __s[] = (S); const char *__p, *__scratch; __asm__ ("call 1f;\n1:\n\t" "%1 = RETS;\n\t" "%0 = [%3 + 1b@GOT17M4];\n\t" "%1 = %1 - %0;\n\t" "%1 = %1 + %2;\n\t" : "=&d" (__scratch), "=&d" (__p) : "d" (__s), "a" (dl_boot_got_pointer) : "RETS"); SEND_STDERR (__p); { int __t; for (__t = 0; __t < 0x1000000; __t++) __asm__ __volatile__ (""); } } while (0)
5139# 60 "./ldso/ldso/bfin/dl-sysdep.h"
5140#define DL_CHECK_LIB_TYPE(epnt,piclib,_dl_progname,libname) do { if (((epnt)->e_flags & EF_BFIN_FDPIC) && ! ((epnt)->e_flags & EF_BFIN_PIC)) (piclib) = 2; else { _dl_internal_error_number = LD_ERROR_NOTDYN; _dl_dprintf(2, "%s: '%s' is not an FDPIC shared library" "\n", (_dl_progname), (libname)); _dl_close(infile); return NULL; } } while (0)
5141# 77 "./ldso/ldso/bfin/dl-sysdep.h"
5142#define DL_IS_SPECIAL_SEGMENT(EPNT,PPNT) __dl_is_special_segment(EPNT, PPNT)
5143
5144#define DL_MAP_SEGMENT(EPNT,PPNT,INFILE,FLAGS) __dl_map_segment (EPNT, PPNT, INFILE, FLAGS)
5145
5146
5147# 1 "./ldso/ldso/bfin/../fdpic/dl-sysdep.h" 1
5148# 9 "./ldso/ldso/bfin/../fdpic/dl-sysdep.h"
5149#define HAVE_DL_INLINES_H
5150
5151
5152
5153
5154
5155
5156#define INIT_GOT(GOT_BASE,MODULE) { (MODULE)->loadaddr.got_value = (GOT_BASE); GOT_BASE[0] = ((unsigned long *)&_dl_linux_resolve)[0]; GOT_BASE[1] = ((unsigned long *)&_dl_linux_resolve)[1]; GOT_BASE[2] = (unsigned long) MODULE; }
5157
5158
5159
5160
5161
5162
5163
5164struct elf_resolve;
5165
5166struct funcdesc_value
5167{
5168 void *entry_point;
5169 void *got_value;
5170} __attribute__((__aligned__(8)));
5171
5172struct funcdesc_ht;
5173
5174#define DL_LOADADDR_TYPE struct elf32_fdpic_loadaddr
5175
5176#define DL_RELOC_ADDR(LOADADDR,ADDR) ((ElfW(Addr))__reloc_pointer ((void*)(ADDR), (LOADADDR).map))
5177
5178
5179#define DL_ADDR_TO_FUNC_PTR(ADDR,LOADADDR) ((void(*)(void)) _dl_funcdesc_for ((void*)(ADDR), (LOADADDR).got_value))
5180
5181
5182#define _dl_stabilize_funcdesc(val) ({ __asm__ ("" : "+m" (*(val))); (val); })
5183
5184
5185#define DL_CALL_FUNC_AT_ADDR(ADDR,LOADADDR,SIGNATURE,...) ({ struct funcdesc_value fd = { (void*)(ADDR), (LOADADDR).got_value }; void (*pf)(void) = (void*) _dl_stabilize_funcdesc (&fd); (* SIGNATURE pf)(__VA_ARGS__); })
5186
5187
5188
5189
5190#define DL_INIT_LOADADDR_BOOT(LOADADDR,BASEADDR) (__dl_init_loadaddr_map (&(LOADADDR), dl_boot_got_pointer, dl_boot_ldsomap ?: dl_boot_progmap))
5191
5192
5193
5194#define DL_INIT_LOADADDR_PROG(LOADADDR,BASEADDR) (__dl_init_loadaddr_map (&(LOADADDR), 0, dl_boot_progmap))
5195
5196
5197#define DL_INIT_LOADADDR_EXTRA_DECLS int dl_init_loadaddr_load_count;
5198
5199#define DL_INIT_LOADADDR(LOADADDR,BASEADDR,PHDR,PHDRCNT) (dl_init_loadaddr_load_count = __dl_init_loadaddr (&(LOADADDR), (PHDR), (PHDRCNT)))
5200
5201
5202#define DL_INIT_LOADADDR_HDR(LOADADDR,ADDR,PHDR) (__dl_init_loadaddr_hdr ((LOADADDR), (ADDR), (PHDR), dl_init_loadaddr_load_count))
5203
5204
5205#define DL_UPDATE_LOADADDR_HDR(LOADADDR,ADDR,PHDR) (__dl_update_loadaddr_hdr ((LOADADDR), (ADDR), (PHDR)))
5206
5207#define DL_LOADADDR_UNMAP(LOADADDR,LEN) (__dl_loadaddr_unmap ((LOADADDR), (NULL)))
5208
5209#define DL_LIB_UNMAP(LIB,LEN) (__dl_loadaddr_unmap ((LIB)->loadaddr, (LIB)->funcdesc_ht))
5210
5211#define DL_LOADADDR_BASE(LOADADDR) ((LOADADDR).got_value)
5212
5213
5214
5215
5216
5217#define DL_LOOKUP_ADDRESS(ADDRESS) (_dl_lookup_address (ADDRESS))
5218
5219#define DL_ADDR_IN_LOADADDR(ADDR,TPNT,TFROM) (! (TFROM) && __dl_addr_in_loadaddr ((void*)(ADDR), (TPNT)->loadaddr))
5220# 88 "./ldso/ldso/bfin/../fdpic/dl-sysdep.h"
5221#define DL_BOOT_COMPUTE_GOT(got) ((got) = dl_boot_got_pointer)
5222
5223#define DL_BOOT_COMPUTE_DYN(dpnt,got,load_addr) ((dpnt) = dl_boot_ldso_dyn_pointer)
5224
5225
5226
5227
5228
5229
5230#define DL_SKIP_BOOTSTRAP_RELOC(SYMTAB,INDEX,STRTAB) 0
5231
5232
5233#define _DL_PREAD(FD,BUF,SIZE,OFFSET) (_dl_pread((FD), (BUF), (SIZE), (OFFSET)))
5234
5235
5236
5237
5238
5239#define DL_FIND_HASH_VALUE(TPNT,TYPE_CLASS,SYM) (((TYPE_CLASS) & ELF_RTYPE_CLASS_DLSYM) && ELF32_ST_TYPE((SYM)->st_info) == STT_FUNC ? _dl_funcdesc_for ((void *)DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value), (TPNT)->loadaddr.got_value) : DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value))
5240
5241
5242
5243
5244
5245
5246#define DL_GET_READY_TO_RUN_EXTRA_PARMS , struct elf32_fdpic_loadmap *dl_boot_progmap, Elf32_Addr dl_boot_got_pointer
5247
5248#define DL_GET_READY_TO_RUN_EXTRA_ARGS , dl_boot_progmap, dl_boot_got_pointer
5249
5250
5251
5252#define DL_DEF_LIB_OFFSET
5253
5254
5255#define DL_GET_LIB_OFFSET() 0
5256
5257
5258#define DL_SET_LIB_OFFSET(offset)
5259
5260
5261#define DL_GET_RUN_ADDR(loadaddr,mapaddr) (loadaddr)
5262
5263
5264# 1 "./include/link.h" 1
5265# 22 "./include/link.h"
5266#define _LINK_H 1
5267
5268
5269# 1 "./include/elf.h" 1
5270# 21 "./include/elf.h"
5271#define _ELF_H 1
5272# 30 "./include/elf.h"
5273# 1 "./include/stdint.h" 1
5274# 24 "./include/stdint.h"
5275#define _STDINT_H 1
5276
5277
5278
5279
5280
5281# 1 "./include/bits/wordsize.h" 1
5282# 19 "./include/bits/wordsize.h"
5283#define __WORDSIZE 32
5284# 31 "./include/stdint.h" 2
5285# 51 "./include/stdint.h"
5286typedef unsigned char uint8_t;
5287typedef unsigned short int uint16_t;
5288
5289typedef unsigned int uint32_t;
5290#define __uint32_t_defined
5291
5292
5293
5294
5295__extension__
5296typedef unsigned long long int uint64_t;
5297
5298
5299
5300
5301
5302
5303typedef signed char int_least8_t;
5304typedef short int int_least16_t;
5305typedef int int_least32_t;
5306
5307
5308
5309__extension__
5310typedef long long int int_least64_t;
5311
5312
5313
5314typedef unsigned char uint_least8_t;
5315typedef unsigned short int uint_least16_t;
5316typedef unsigned int uint_least32_t;
5317
5318
5319
5320__extension__
5321typedef unsigned long long int uint_least64_t;
5322
5323
5324
5325
5326
5327
5328typedef signed char int_fast8_t;
5329
5330
5331
5332
5333
5334typedef int int_fast16_t;
5335typedef int int_fast32_t;
5336__extension__
5337typedef long long int int_fast64_t;
5338
5339
5340
5341typedef unsigned char uint_fast8_t;
5342
5343
5344
5345
5346
5347typedef unsigned int uint_fast16_t;
5348typedef unsigned int uint_fast32_t;
5349__extension__
5350typedef unsigned long long int uint_fast64_t;
5351# 128 "./include/stdint.h"
5352typedef int intptr_t;
5353#define __intptr_t_defined
5354
5355typedef unsigned int uintptr_t;
5356# 140 "./include/stdint.h"
5357__extension__
5358typedef long long int intmax_t;
5359__extension__
5360typedef unsigned long long int uintmax_t;
5361# 155 "./include/stdint.h"
5362#define __INT64_C(c) c ## LL
5363#define __UINT64_C(c) c ## ULL
5364
5365
5366
5367
5368
5369#define INT8_MIN (-128)
5370#define INT16_MIN (-32767-1)
5371#define INT32_MIN (-2147483647-1)
5372#define INT64_MIN (-__INT64_C(9223372036854775807)-1)
5373
5374#define INT8_MAX (127)
5375#define INT16_MAX (32767)
5376#define INT32_MAX (2147483647)
5377#define INT64_MAX (__INT64_C(9223372036854775807))
5378
5379
5380#define UINT8_MAX (255)
5381#define UINT16_MAX (65535)
5382#define UINT32_MAX (4294967295U)
5383#define UINT64_MAX (__UINT64_C(18446744073709551615))
5384
5385
5386
5387#define INT_LEAST8_MIN (-128)
5388#define INT_LEAST16_MIN (-32767-1)
5389#define INT_LEAST32_MIN (-2147483647-1)
5390#define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
5391
5392#define INT_LEAST8_MAX (127)
5393#define INT_LEAST16_MAX (32767)
5394#define INT_LEAST32_MAX (2147483647)
5395#define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
5396
5397
5398#define UINT_LEAST8_MAX (255)
5399#define UINT_LEAST16_MAX (65535)
5400#define UINT_LEAST32_MAX (4294967295U)
5401#define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
5402
5403
5404
5405#define INT_FAST8_MIN (-128)
5406
5407
5408
5409
5410#define INT_FAST16_MIN (-2147483647-1)
5411#define INT_FAST32_MIN (-2147483647-1)
5412
5413#define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
5414
5415#define INT_FAST8_MAX (127)
5416
5417
5418
5419
5420#define INT_FAST16_MAX (2147483647)
5421#define INT_FAST32_MAX (2147483647)
5422
5423#define INT_FAST64_MAX (__INT64_C(9223372036854775807))
5424
5425
5426#define UINT_FAST8_MAX (255)
5427
5428
5429
5430
5431#define UINT_FAST16_MAX (4294967295U)
5432#define UINT_FAST32_MAX (4294967295U)
5433
5434#define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
5435# 236 "./include/stdint.h"
5436#define INTPTR_MIN (-2147483647-1)
5437#define INTPTR_MAX (2147483647)
5438#define UINTPTR_MAX (4294967295U)
5439
5440
5441
5442
5443
5444#define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
5445
5446#define INTMAX_MAX (__INT64_C(9223372036854775807))
5447
5448
5449#define UINTMAX_MAX (__UINT64_C(18446744073709551615))
5450# 267 "./include/stdint.h"
5451#define PTRDIFF_MIN (-2147483647-1)
5452#define PTRDIFF_MAX (2147483647)
5453
5454
5455
5456#define SIG_ATOMIC_MIN (-2147483647-1)
5457#define SIG_ATOMIC_MAX (2147483647)
5458
5459
5460
5461
5462
5463#define SIZE_MAX (4294967295U)
5464# 303 "./include/stdint.h"
5465#define INT8_C(c) c
5466#define INT16_C(c) c
5467#define INT32_C(c) c
5468
5469
5470
5471#define INT64_C(c) c ## LL
5472
5473
5474
5475#define UINT8_C(c) c
5476#define UINT16_C(c) c
5477#define UINT32_C(c) c ## U
5478
5479
5480
5481#define UINT64_C(c) c ## ULL
5482
5483
5484
5485
5486
5487
5488
5489#define INTMAX_C(c) c ## LL
5490#define UINTMAX_C(c) c ## ULL
5491# 31 "./include/elf.h" 2
5492
5493
5494
5495typedef uint16_t Elf32_Half;
5496typedef uint16_t Elf64_Half;
5497
5498
5499typedef uint32_t Elf32_Word;
5500typedef int32_t Elf32_Sword;
5501typedef uint32_t Elf64_Word;
5502typedef int32_t Elf64_Sword;
5503
5504
5505typedef uint64_t Elf32_Xword;
5506typedef int64_t Elf32_Sxword;
5507typedef uint64_t Elf64_Xword;
5508typedef int64_t Elf64_Sxword;
5509
5510
5511typedef uint32_t Elf32_Addr;
5512typedef uint64_t Elf64_Addr;
5513
5514
5515typedef uint32_t Elf32_Off;
5516typedef uint64_t Elf64_Off;
5517
5518
5519typedef uint16_t Elf32_Section;
5520typedef uint16_t Elf64_Section;
5521
5522
5523typedef Elf32_Half Elf32_Versym;
5524typedef Elf64_Half Elf64_Versym;
5525
5526
5527
5528
5529#define EI_NIDENT (16)
5530
5531typedef struct
5532{
5533 unsigned char e_ident[(16)];
5534 Elf32_Half e_type;
5535 Elf32_Half e_machine;
5536 Elf32_Word e_version;
5537 Elf32_Addr e_entry;
5538 Elf32_Off e_phoff;
5539 Elf32_Off e_shoff;
5540 Elf32_Word e_flags;
5541 Elf32_Half e_ehsize;
5542 Elf32_Half e_phentsize;
5543 Elf32_Half e_phnum;
5544 Elf32_Half e_shentsize;
5545 Elf32_Half e_shnum;
5546 Elf32_Half e_shstrndx;
5547} Elf32_Ehdr;
5548
5549typedef struct
5550{
5551 unsigned char e_ident[(16)];
5552 Elf64_Half e_type;
5553 Elf64_Half e_machine;
5554 Elf64_Word e_version;
5555 Elf64_Addr e_entry;
5556 Elf64_Off e_phoff;
5557 Elf64_Off e_shoff;
5558 Elf64_Word e_flags;
5559 Elf64_Half e_ehsize;
5560 Elf64_Half e_phentsize;
5561 Elf64_Half e_phnum;
5562 Elf64_Half e_shentsize;
5563 Elf64_Half e_shnum;
5564 Elf64_Half e_shstrndx;
5565} Elf64_Ehdr;
5566
5567
5568
5569
5570
5571#define EI_MAG0 0
5572#define ELFMAG0 0x7f
5573
5574#define EI_MAG1 1
5575#define ELFMAG1 'E'
5576
5577#define EI_MAG2 2
5578#define ELFMAG2 'L'
5579
5580#define EI_MAG3 3
5581#define ELFMAG3 'F'
5582
5583
5584#define ELFMAG "\177ELF"
5585#define SELFMAG 4
5586
5587#define ELFMAG_U32 ((uint32_t)(ELFMAG0 + 0x100 * (ELFMAG1 + (0x100 * (ELFMAG2 + 0x100 * ELFMAG3)))))
5588
5589
5590
5591
5592#define EI_CLASS 4
5593#define ELFCLASSNONE 0
5594#define ELFCLASS32 1
5595#define ELFCLASS64 2
5596#define ELFCLASSNUM 3
5597
5598#define EI_DATA 5
5599#define ELFDATANONE 0
5600#define ELFDATA2LSB 1
5601#define ELFDATA2MSB 2
5602#define ELFDATANUM 3
5603
5604#define EI_VERSION 6
5605
5606
5607#define EI_OSABI 7
5608#define ELFOSABI_NONE 0
5609#define ELFOSABI_SYSV 0
5610#define ELFOSABI_HPUX 1
5611#define ELFOSABI_NETBSD 2
5612#define ELFOSABI_LINUX 3
5613#define ELFOSABI_HURD 4
5614#define ELFOSABI_SOLARIS 6
5615#define ELFOSABI_AIX 7
5616#define ELFOSABI_IRIX 8
5617#define ELFOSABI_FREEBSD 9
5618#define ELFOSABI_TRU64 10
5619#define ELFOSABI_MODESTO 11
5620#define ELFOSABI_OPENBSD 12
5621#define ELFOSABI_OPENVMS 13
5622#define ELFOSABI_NSK 14
5623#define ELFOSABI_AROS 15
5624#define ELFOSABI_ARM 97
5625#define ELFOSABI_STANDALONE 255
5626
5627#define EI_ABIVERSION 8
5628
5629#define EI_PAD 9
5630
5631
5632
5633#define ET_NONE 0
5634#define ET_REL 1
5635#define ET_EXEC 2
5636#define ET_DYN 3
5637#define ET_CORE 4
5638#define ET_NUM 5
5639#define ET_LOOS 0xfe00
5640#define ET_HIOS 0xfeff
5641#define ET_LOPROC 0xff00
5642#define ET_HIPROC 0xffff
5643
5644
5645
5646#define EM_NONE 0
5647#define EM_M32 1
5648#define EM_SPARC 2
5649#define EM_386 3
5650#define EM_68K 4
5651#define EM_88K 5
5652#define EM_486 6
5653#define EM_860 7
5654#define EM_MIPS 8
5655#define EM_S370 9
5656#define EM_MIPS_RS3_LE 10
5657
5658#define EM_PARISC 15
5659#define EM_VPP500 17
5660#define EM_SPARC32PLUS 18
5661#define EM_960 19
5662#define EM_PPC 20
5663#define EM_PPC64 21
5664#define EM_S390 22
5665
5666#define EM_V800 36
5667#define EM_FR20 37
5668#define EM_RH32 38
5669#define EM_MCORE 39
5670#define EM_RCE 39
5671#define EM_ARM 40
5672#define EM_FAKE_ALPHA 41
5673#define EM_SH 42
5674#define EM_SPARCV9 43
5675#define EM_TRICORE 44
5676#define EM_ARC 45
5677#define EM_H8_300 46
5678#define EM_H8_300H 47
5679#define EM_H8S 48
5680#define EM_H8_500 49
5681#define EM_IA_64 50
5682#define EM_MIPS_X 51
5683#define EM_COLDFIRE 52
5684#define EM_68HC12 53
5685#define EM_MMA 54
5686#define EM_PCP 55
5687#define EM_NCPU 56
5688#define EM_NDR1 57
5689#define EM_STARCORE 58
5690#define EM_ME16 59
5691#define EM_ST100 60
5692#define EM_TINYJ 61
5693#define EM_X86_64 62
5694#define EM_PDSP 63
5695
5696#define EM_FX66 66
5697#define EM_ST9PLUS 67
5698#define EM_ST7 68
5699#define EM_68HC16 69
5700#define EM_68HC11 70
5701#define EM_68HC08 71
5702#define EM_68HC05 72
5703#define EM_SVX 73
5704#define EM_ST19 74
5705#define EM_VAX 75
5706#define EM_CRIS 76
5707#define EM_JAVELIN 77
5708#define EM_FIREPATH 78
5709#define EM_ZSP 79
5710#define EM_MMIX 80
5711#define EM_HUANY 81
5712#define EM_PRISM 82
5713#define EM_AVR 83
5714#define EM_FR30 84
5715#define EM_D10V 85
5716#define EM_D30V 86
5717#define EM_V850 87
5718#define EM_M32R 88
5719#define EM_MN10300 89
5720#define EM_MN10200 90
5721#define EM_PJ 91
5722#define EM_OPENRISC 92
5723#define EM_ARC_A5 93
5724#define EM_XTENSA 94
5725#define EM_IP2K 101
5726#define EM_CR 103
5727#define EM_MSP430 105
5728#define EM_BLACKFIN 106
5729#define EM_ALTERA_NIOS2 113
5730#define EM_CRX 114
5731#define EM_NUM 95
5732#define EM_TI_C6000 140
5733# 286 "./include/elf.h"
5734#define EM_PJ_OLD 99
5735
5736
5737#define EM_CYGNUS_POWERPC 0x9025
5738
5739
5740
5741#define EM_OLD_SPARCV9 11
5742
5743
5744#define EM_PPC_OLD 17
5745
5746
5747#define EM_OR32 0x8472
5748
5749
5750#define EM_M32C 0xFEB0
5751
5752
5753#define EM_CYGNUS_M32R 0x9041
5754
5755
5756#define EM_S390_OLD 0xa390
5757
5758
5759#define EM_CYGNUS_D10V 0x7650
5760
5761
5762#define EM_CYGNUS_D30V 0x7676
5763
5764
5765#define EM_CYGNUS_V850 0x9080
5766
5767
5768
5769#define EM_CYGNUS_MN10200 0xdead
5770#define EM_CYGNUS_MN10300 0xbeef
5771
5772
5773#define EM_CYGNUS_FR30 0x3330
5774
5775
5776
5777#define EM_AVR_OLD 0x1057
5778
5779
5780
5781#define EM_OPENRISC_OLD 0x3426
5782
5783
5784
5785#define EM_DLX 0x5aa5
5786
5787#define EM_XSTORMY16 0xad45
5788
5789
5790#define EM_CYGNUS_FRV 0x5441
5791
5792
5793#define EM_IP2K_OLD 0x8217
5794
5795#define EM_MT 0x2530
5796
5797
5798
5799#define EM_MSP430_OLD 0x1059
5800
5801
5802#define EM_IQ2000 0xFEBA
5803
5804
5805#define EM_XTENSA_OLD 0xabc7
5806
5807
5808#define EM_ALPHA 0x9026
5809
5810
5811#define EM_NIOS32 0xFEBB
5812
5813
5814#define EM_AVR32 0x18ad
5815
5816
5817#define EM_CYGNUS_V850 0x9080
5818
5819
5820
5821
5822#define EM_MICROBLAZE_OLD 0xbaab
5823
5824
5825#define EM_MICROBLAZE 189
5826
5827
5828
5829#define EV_NONE 0
5830#define EV_CURRENT 1
5831#define EV_NUM 2
5832
5833
5834
5835typedef struct
5836{
5837 Elf32_Word sh_name;
5838 Elf32_Word sh_type;
5839 Elf32_Word sh_flags;
5840 Elf32_Addr sh_addr;
5841 Elf32_Off sh_offset;
5842 Elf32_Word sh_size;
5843 Elf32_Word sh_link;
5844 Elf32_Word sh_info;
5845 Elf32_Word sh_addralign;
5846 Elf32_Word sh_entsize;
5847} Elf32_Shdr;
5848
5849typedef struct
5850{
5851 Elf64_Word sh_name;
5852 Elf64_Word sh_type;
5853 Elf64_Xword sh_flags;
5854 Elf64_Addr sh_addr;
5855 Elf64_Off sh_offset;
5856 Elf64_Xword sh_size;
5857 Elf64_Word sh_link;
5858 Elf64_Word sh_info;
5859 Elf64_Xword sh_addralign;
5860 Elf64_Xword sh_entsize;
5861} Elf64_Shdr;
5862
5863
5864
5865#define SHN_UNDEF 0
5866#define SHN_LORESERVE 0xff00
5867#define SHN_LOPROC 0xff00
5868#define SHN_BEFORE 0xff00
5869
5870#define SHN_AFTER 0xff01
5871
5872#define SHN_HIPROC 0xff1f
5873#define SHN_LOOS 0xff20
5874#define SHN_HIOS 0xff3f
5875#define SHN_ABS 0xfff1
5876#define SHN_COMMON 0xfff2
5877#define SHN_XINDEX 0xffff
5878#define SHN_HIRESERVE 0xffff
5879
5880
5881
5882#define SHT_NULL 0
5883#define SHT_PROGBITS 1
5884#define SHT_SYMTAB 2
5885#define SHT_STRTAB 3
5886#define SHT_RELA 4
5887#define SHT_HASH 5
5888#define SHT_DYNAMIC 6
5889#define SHT_NOTE 7
5890#define SHT_NOBITS 8
5891#define SHT_REL 9
5892#define SHT_SHLIB 10
5893#define SHT_DYNSYM 11
5894#define SHT_INIT_ARRAY 14
5895#define SHT_FINI_ARRAY 15
5896#define SHT_PREINIT_ARRAY 16
5897#define SHT_GROUP 17
5898#define SHT_SYMTAB_SHNDX 18
5899#define SHT_NUM 19
5900#define SHT_LOOS 0x60000000
5901#define SHT_GNU_HASH 0x6ffffff6
5902#define SHT_GNU_LIBLIST 0x6ffffff7
5903#define SHT_CHECKSUM 0x6ffffff8
5904#define SHT_LOSUNW 0x6ffffffa
5905#define SHT_SUNW_move 0x6ffffffa
5906#define SHT_SUNW_COMDAT 0x6ffffffb
5907#define SHT_SUNW_syminfo 0x6ffffffc
5908#define SHT_GNU_verdef 0x6ffffffd
5909#define SHT_GNU_verneed 0x6ffffffe
5910#define SHT_GNU_versym 0x6fffffff
5911#define SHT_HISUNW 0x6fffffff
5912#define SHT_HIOS 0x6fffffff
5913#define SHT_LOPROC 0x70000000
5914#define SHT_HIPROC 0x7fffffff
5915#define SHT_LOUSER 0x80000000
5916#define SHT_HIUSER 0x8fffffff
5917
5918
5919
5920#define SHF_WRITE (1 << 0)
5921#define SHF_ALLOC (1 << 1)
5922#define SHF_EXECINSTR (1 << 2)
5923#define SHF_MERGE (1 << 4)
5924#define SHF_STRINGS (1 << 5)
5925#define SHF_INFO_LINK (1 << 6)
5926#define SHF_LINK_ORDER (1 << 7)
5927#define SHF_OS_NONCONFORMING (1 << 8)
5928
5929#define SHF_GROUP (1 << 9)
5930#define SHF_TLS (1 << 10)
5931#define SHF_MASKOS 0x0ff00000
5932#define SHF_MASKPROC 0xf0000000
5933#define SHF_ORDERED (1 << 30)
5934
5935#define SHF_EXCLUDE (1 << 31)
5936
5937
5938
5939#define GRP_COMDAT 0x1
5940
5941
5942
5943typedef struct
5944{
5945 Elf32_Word st_name;
5946 Elf32_Addr st_value;
5947 Elf32_Word st_size;
5948 unsigned char st_info;
5949 unsigned char st_other;
5950 Elf32_Section st_shndx;
5951} Elf32_Sym;
5952
5953typedef struct
5954{
5955 Elf64_Word st_name;
5956 unsigned char st_info;
5957 unsigned char st_other;
5958 Elf64_Section st_shndx;
5959 Elf64_Addr st_value;
5960 Elf64_Xword st_size;
5961} Elf64_Sym;
5962
5963
5964
5965
5966typedef struct
5967{
5968 Elf32_Half si_boundto;
5969 Elf32_Half si_flags;
5970} Elf32_Syminfo;
5971
5972typedef struct
5973{
5974 Elf64_Half si_boundto;
5975 Elf64_Half si_flags;
5976} Elf64_Syminfo;
5977
5978
5979#define SYMINFO_BT_SELF 0xffff
5980#define SYMINFO_BT_PARENT 0xfffe
5981#define SYMINFO_BT_LOWRESERVE 0xff00
5982
5983
5984#define SYMINFO_FLG_DIRECT 0x0001
5985#define SYMINFO_FLG_PASSTHRU 0x0002
5986#define SYMINFO_FLG_COPY 0x0004
5987#define SYMINFO_FLG_LAZYLOAD 0x0008
5988
5989
5990#define SYMINFO_NONE 0
5991#define SYMINFO_CURRENT 1
5992#define SYMINFO_NUM 2
5993
5994
5995
5996
5997#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
5998#define ELF32_ST_TYPE(val) ((val) & 0xf)
5999#define ELF32_ST_INFO(bind,type) (((bind) << 4) + ((type) & 0xf))
6000
6001
6002#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
6003#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
6004#define ELF64_ST_INFO(bind,type) ELF32_ST_INFO ((bind), (type))
6005
6006
6007
6008#define STB_LOCAL 0
6009#define STB_GLOBAL 1
6010#define STB_WEAK 2
6011#define STB_NUM 3
6012#define STB_LOOS 10
6013#define STB_HIOS 12
6014#define STB_LOPROC 13
6015#define STB_HIPROC 15
6016
6017
6018
6019#define STT_NOTYPE 0
6020#define STT_OBJECT 1
6021#define STT_FUNC 2
6022#define STT_SECTION 3
6023#define STT_FILE 4
6024#define STT_COMMON 5
6025#define STT_TLS 6
6026#define STT_NUM 7
6027#define STT_LOOS 10
6028#define STT_HIOS 12
6029#define STT_LOPROC 13
6030#define STT_HIPROC 15
6031
6032
6033
6034
6035
6036
6037#define STN_UNDEF 0
6038
6039
6040
6041
6042#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
6043
6044
6045#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
6046
6047
6048#define STV_DEFAULT 0
6049#define STV_INTERNAL 1
6050#define STV_HIDDEN 2
6051#define STV_PROTECTED 3
6052
6053
6054
6055
6056typedef struct
6057{
6058 Elf32_Addr r_offset;
6059 Elf32_Word r_info;
6060} Elf32_Rel;
6061
6062
6063
6064
6065
6066
6067typedef struct
6068{
6069 Elf64_Addr r_offset;
6070 Elf64_Xword r_info;
6071} Elf64_Rel;
6072
6073
6074
6075typedef struct
6076{
6077 Elf32_Addr r_offset;
6078 Elf32_Word r_info;
6079 Elf32_Sword r_addend;
6080} Elf32_Rela;
6081
6082typedef struct
6083{
6084 Elf64_Addr r_offset;
6085 Elf64_Xword r_info;
6086 Elf64_Sxword r_addend;
6087} Elf64_Rela;
6088
6089
6090
6091#define ELF32_R_SYM(val) ((val) >> 8)
6092#define ELF32_R_TYPE(val) ((val) & 0xff)
6093#define ELF32_R_INFO(sym,type) (((sym) << 8) + ((type) & 0xff))
6094
6095#define ELF64_R_SYM(i) ((i) >> 32)
6096#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
6097#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
6098
6099
6100
6101typedef struct
6102{
6103 Elf32_Word p_type;
6104 Elf32_Off p_offset;
6105 Elf32_Addr p_vaddr;
6106 Elf32_Addr p_paddr;
6107 Elf32_Word p_filesz;
6108 Elf32_Word p_memsz;
6109 Elf32_Word p_flags;
6110 Elf32_Word p_align;
6111} Elf32_Phdr;
6112
6113typedef struct
6114{
6115 Elf64_Word p_type;
6116 Elf64_Word p_flags;
6117 Elf64_Off p_offset;
6118 Elf64_Addr p_vaddr;
6119 Elf64_Addr p_paddr;
6120 Elf64_Xword p_filesz;
6121 Elf64_Xword p_memsz;
6122 Elf64_Xword p_align;
6123} Elf64_Phdr;
6124
6125
6126
6127#define PT_NULL 0
6128#define PT_LOAD 1
6129#define PT_DYNAMIC 2
6130#define PT_INTERP 3
6131#define PT_NOTE 4
6132#define PT_SHLIB 5
6133#define PT_PHDR 6
6134#define PT_TLS 7
6135#define PT_NUM 8
6136#define PT_LOOS 0x60000000
6137#define PT_GNU_EH_FRAME 0x6474e550
6138#define PT_GNU_STACK 0x6474e551
6139#define PT_GNU_RELRO 0x6474e552
6140#define PT_PAX_FLAGS 0x65041580
6141#define PT_LOSUNW 0x6ffffffa
6142#define PT_SUNWBSS 0x6ffffffa
6143#define PT_SUNWSTACK 0x6ffffffb
6144#define PT_HISUNW 0x6fffffff
6145#define PT_HIOS 0x6fffffff
6146#define PT_LOPROC 0x70000000
6147#define PT_HIPROC 0x7fffffff
6148
6149
6150
6151#define PF_X (1 << 0)
6152#define PF_W (1 << 1)
6153#define PF_R (1 << 2)
6154#define PF_PAGEEXEC (1 << 4)
6155#define PF_NOPAGEEXEC (1 << 5)
6156#define PF_SEGMEXEC (1 << 6)
6157#define PF_NOSEGMEXEC (1 << 7)
6158#define PF_MPROTECT (1 << 8)
6159#define PF_NOMPROTECT (1 << 9)
6160#define PF_RANDEXEC (1 << 10)
6161#define PF_NORANDEXEC (1 << 11)
6162#define PF_EMUTRAMP (1 << 12)
6163#define PF_NOEMUTRAMP (1 << 13)
6164#define PF_RANDMMAP (1 << 14)
6165#define PF_NORANDMMAP (1 << 15)
6166#define PF_MASKOS 0x0ff00000
6167#define PF_MASKPROC 0xf0000000
6168
6169
6170
6171#define NT_PRSTATUS 1
6172#define NT_FPREGSET 2
6173#define NT_PRPSINFO 3
6174#define NT_PRXREG 4
6175#define NT_TASKSTRUCT 4
6176#define NT_PLATFORM 5
6177#define NT_AUXV 6
6178#define NT_GWINDOWS 7
6179#define NT_ASRS 8
6180#define NT_PSTATUS 10
6181#define NT_PSINFO 13
6182#define NT_PRCRED 14
6183#define NT_UTSNAME 15
6184#define NT_LWPSTATUS 16
6185#define NT_LWPSINFO 17
6186#define NT_PRFPXREG 20
6187
6188
6189
6190#define NT_VERSION 1
6191
6192
6193
6194
6195typedef struct
6196{
6197 Elf32_Sword d_tag;
6198 union
6199 {
6200 Elf32_Word d_val;
6201 Elf32_Addr d_ptr;
6202 } d_un;
6203} Elf32_Dyn;
6204
6205typedef struct
6206{
6207 Elf64_Sxword d_tag;
6208 union
6209 {
6210 Elf64_Xword d_val;
6211 Elf64_Addr d_ptr;
6212 } d_un;
6213} Elf64_Dyn;
6214
6215
6216
6217#define DT_NULL 0
6218#define DT_NEEDED 1
6219#define DT_PLTRELSZ 2
6220#define DT_PLTGOT 3
6221#define DT_HASH 4
6222#define DT_STRTAB 5
6223#define DT_SYMTAB 6
6224#define DT_RELA 7
6225#define DT_RELASZ 8
6226#define DT_RELAENT 9
6227#define DT_STRSZ 10
6228#define DT_SYMENT 11
6229#define DT_INIT 12
6230#define DT_FINI 13
6231#define DT_SONAME 14
6232#define DT_RPATH 15
6233#define DT_SYMBOLIC 16
6234#define DT_REL 17
6235#define DT_RELSZ 18
6236#define DT_RELENT 19
6237#define DT_PLTREL 20
6238#define DT_DEBUG 21
6239#define DT_TEXTREL 22
6240#define DT_JMPREL 23
6241#define DT_BIND_NOW 24
6242#define DT_INIT_ARRAY 25
6243#define DT_FINI_ARRAY 26
6244#define DT_INIT_ARRAYSZ 27
6245#define DT_FINI_ARRAYSZ 28
6246#define DT_RUNPATH 29
6247#define DT_FLAGS 30
6248#define DT_ENCODING 32
6249#define DT_PREINIT_ARRAY 32
6250#define DT_PREINIT_ARRAYSZ 33
6251#define DT_NUM 34
6252#define DT_LOOS 0x6000000d
6253#define DT_HIOS 0x6ffff000
6254#define DT_LOPROC 0x70000000
6255#define DT_HIPROC 0x7fffffff
6256#define DT_PROCNUM DT_MIPS_NUM
6257
6258
6259
6260
6261#define DT_VALRNGLO 0x6ffffd00
6262#define DT_GNU_PRELINKED 0x6ffffdf5
6263#define DT_GNU_CONFLICTSZ 0x6ffffdf6
6264#define DT_GNU_LIBLISTSZ 0x6ffffdf7
6265#define DT_CHECKSUM 0x6ffffdf8
6266#define DT_PLTPADSZ 0x6ffffdf9
6267#define DT_MOVEENT 0x6ffffdfa
6268#define DT_MOVESZ 0x6ffffdfb
6269#define DT_FEATURE_1 0x6ffffdfc
6270#define DT_POSFLAG_1 0x6ffffdfd
6271
6272#define DT_SYMINSZ 0x6ffffdfe
6273#define DT_SYMINENT 0x6ffffdff
6274#define DT_VALRNGHI 0x6ffffdff
6275#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
6276#define DT_VALNUM 12
6277
6278
6279
6280
6281
6282
6283#define DT_ADDRRNGLO 0x6ffffe00
6284#define DT_GNU_HASH 0x6ffffef5
6285#define DT_GNU_CONFLICT 0x6ffffef8
6286#define DT_GNU_LIBLIST 0x6ffffef9
6287#define DT_CONFIG 0x6ffffefa
6288#define DT_DEPAUDIT 0x6ffffefb
6289#define DT_AUDIT 0x6ffffefc
6290#define DT_PLTPAD 0x6ffffefd
6291#define DT_MOVETAB 0x6ffffefe
6292#define DT_SYMINFO 0x6ffffeff
6293#define DT_ADDRRNGHI 0x6ffffeff
6294#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
6295#define DT_ADDRNUM 10
6296
6297
6298
6299#define DT_VERSYM 0x6ffffff0
6300
6301#define DT_RELACOUNT 0x6ffffff9
6302#define DT_RELCOUNT 0x6ffffffa
6303
6304
6305#define DT_FLAGS_1 0x6ffffffb
6306#define DT_VERDEF 0x6ffffffc
6307
6308#define DT_VERDEFNUM 0x6ffffffd
6309#define DT_VERNEED 0x6ffffffe
6310
6311#define DT_VERNEEDNUM 0x6fffffff
6312#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
6313#define DT_VERSIONTAGNUM 16
6314
6315
6316
6317#define DT_AUXILIARY 0x7ffffffd
6318#define DT_FILTER 0x7fffffff
6319#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
6320#define DT_EXTRANUM 3
6321
6322
6323#define DF_ORIGIN 0x00000001
6324#define DF_SYMBOLIC 0x00000002
6325#define DF_TEXTREL 0x00000004
6326#define DF_BIND_NOW 0x00000008
6327#define DF_STATIC_TLS 0x00000010
6328
6329
6330
6331#define DF_1_NOW 0x00000001
6332#define DF_1_GLOBAL 0x00000002
6333#define DF_1_GROUP 0x00000004
6334#define DF_1_NODELETE 0x00000008
6335#define DF_1_LOADFLTR 0x00000010
6336#define DF_1_INITFIRST 0x00000020
6337#define DF_1_NOOPEN 0x00000040
6338#define DF_1_ORIGIN 0x00000080
6339#define DF_1_DIRECT 0x00000100
6340#define DF_1_TRANS 0x00000200
6341#define DF_1_INTERPOSE 0x00000400
6342#define DF_1_NODEFLIB 0x00000800
6343#define DF_1_NODUMP 0x00001000
6344#define DF_1_CONFALT 0x00002000
6345#define DF_1_ENDFILTEE 0x00004000
6346#define DF_1_DISPRELDNE 0x00008000
6347#define DF_1_DISPRELPND 0x00010000
6348
6349
6350#define DTF_1_PARINIT 0x00000001
6351#define DTF_1_CONFEXP 0x00000002
6352
6353
6354#define DF_P1_LAZYLOAD 0x00000001
6355#define DF_P1_GROUPPERM 0x00000002
6356
6357
6358
6359
6360typedef struct
6361{
6362 Elf32_Half vd_version;
6363 Elf32_Half vd_flags;
6364 Elf32_Half vd_ndx;
6365 Elf32_Half vd_cnt;
6366 Elf32_Word vd_hash;
6367 Elf32_Word vd_aux;
6368 Elf32_Word vd_next;
6369
6370} Elf32_Verdef;
6371
6372typedef struct
6373{
6374 Elf64_Half vd_version;
6375 Elf64_Half vd_flags;
6376 Elf64_Half vd_ndx;
6377 Elf64_Half vd_cnt;
6378 Elf64_Word vd_hash;
6379 Elf64_Word vd_aux;
6380 Elf64_Word vd_next;
6381
6382} Elf64_Verdef;
6383
6384
6385
6386#define VER_DEF_NONE 0
6387#define VER_DEF_CURRENT 1
6388#define VER_DEF_NUM 2
6389
6390
6391#define VER_FLG_BASE 0x1
6392#define VER_FLG_WEAK 0x2
6393
6394
6395#define VER_NDX_LOCAL 0
6396#define VER_NDX_GLOBAL 1
6397#define VER_NDX_LORESERVE 0xff00
6398#define VER_NDX_ELIMINATE 0xff01
6399
6400
6401
6402typedef struct
6403{
6404 Elf32_Word vda_name;
6405 Elf32_Word vda_next;
6406
6407} Elf32_Verdaux;
6408
6409typedef struct
6410{
6411 Elf64_Word vda_name;
6412 Elf64_Word vda_next;
6413
6414} Elf64_Verdaux;
6415
6416
6417
6418
6419typedef struct
6420{
6421 Elf32_Half vn_version;
6422 Elf32_Half vn_cnt;
6423 Elf32_Word vn_file;
6424
6425 Elf32_Word vn_aux;
6426 Elf32_Word vn_next;
6427
6428} Elf32_Verneed;
6429
6430typedef struct
6431{
6432 Elf64_Half vn_version;
6433 Elf64_Half vn_cnt;
6434 Elf64_Word vn_file;
6435
6436 Elf64_Word vn_aux;
6437 Elf64_Word vn_next;
6438
6439} Elf64_Verneed;
6440
6441
6442
6443#define VER_NEED_NONE 0
6444#define VER_NEED_CURRENT 1
6445#define VER_NEED_NUM 2
6446
6447
6448
6449typedef struct
6450{
6451 Elf32_Word vna_hash;
6452 Elf32_Half vna_flags;
6453 Elf32_Half vna_other;
6454 Elf32_Word vna_name;
6455 Elf32_Word vna_next;
6456
6457} Elf32_Vernaux;
6458
6459typedef struct
6460{
6461 Elf64_Word vna_hash;
6462 Elf64_Half vna_flags;
6463 Elf64_Half vna_other;
6464 Elf64_Word vna_name;
6465 Elf64_Word vna_next;
6466
6467} Elf64_Vernaux;
6468
6469
6470
6471#define VER_FLG_WEAK 0x2
6472# 1035 "./include/elf.h"
6473typedef struct
6474{
6475 uint32_t a_type;
6476 union
6477 {
6478 uint32_t a_val;
6479
6480
6481
6482 } a_un;
6483} Elf32_auxv_t;
6484
6485typedef struct
6486{
6487 uint64_t a_type;
6488 union
6489 {
6490 uint64_t a_val;
6491
6492
6493
6494 } a_un;
6495} Elf64_auxv_t;
6496
6497
6498
6499#define AT_NULL 0
6500#define AT_IGNORE 1
6501#define AT_EXECFD 2
6502#define AT_PHDR 3
6503#define AT_PHENT 4
6504#define AT_PHNUM 5
6505#define AT_PAGESZ 6
6506#define AT_BASE 7
6507#define AT_FLAGS 8
6508#define AT_ENTRY 9
6509#define AT_NOTELF 10
6510#define AT_UID 11
6511#define AT_EUID 12
6512#define AT_GID 13
6513#define AT_EGID 14
6514#define AT_CLKTCK 17
6515
6516
6517#define AT_PLATFORM 15
6518#define AT_HWCAP 16
6519
6520
6521
6522
6523#define AT_FPUCW 18
6524
6525
6526#define AT_DCACHEBSIZE 19
6527#define AT_ICACHEBSIZE 20
6528#define AT_UCACHEBSIZE 21
6529
6530
6531
6532#define AT_IGNOREPPC 22
6533
6534#define AT_SECURE 23
6535
6536
6537
6538#define AT_SYSINFO 32
6539#define AT_SYSINFO_EHDR 33
6540
6541
6542
6543#define AT_L1I_CACHESHAPE 34
6544#define AT_L1D_CACHESHAPE 35
6545#define AT_L2_CACHESHAPE 36
6546#define AT_L3_CACHESHAPE 37
6547
6548
6549
6550
6551typedef struct
6552{
6553 Elf32_Word n_namesz;
6554 Elf32_Word n_descsz;
6555 Elf32_Word n_type;
6556} Elf32_Nhdr;
6557
6558typedef struct
6559{
6560 Elf64_Word n_namesz;
6561 Elf64_Word n_descsz;
6562 Elf64_Word n_type;
6563} Elf64_Nhdr;
6564
6565
6566
6567
6568#define ELF_NOTE_SOLARIS "SUNW Solaris"
6569
6570
6571#define ELF_NOTE_GNU "GNU"
6572
6573
6574
6575
6576
6577#define ELF_NOTE_PAGESIZE_HINT 1
6578# 1150 "./include/elf.h"
6579#define ELF_NOTE_ABI 1
6580
6581
6582
6583#define ELF_NOTE_OS_LINUX 0
6584#define ELF_NOTE_OS_GNU 1
6585#define ELF_NOTE_OS_SOLARIS2 2
6586#define ELF_NOTE_OS_FREEBSD 3
6587
6588
6589
6590typedef struct
6591{
6592 Elf32_Xword m_value;
6593 Elf32_Word m_info;
6594 Elf32_Word m_poffset;
6595 Elf32_Half m_repeat;
6596 Elf32_Half m_stride;
6597} Elf32_Move;
6598
6599typedef struct
6600{
6601 Elf64_Xword m_value;
6602 Elf64_Xword m_info;
6603 Elf64_Xword m_poffset;
6604 Elf64_Half m_repeat;
6605 Elf64_Half m_stride;
6606} Elf64_Move;
6607
6608
6609#define ELF32_M_SYM(info) ((info) >> 8)
6610#define ELF32_M_SIZE(info) ((unsigned char) (info))
6611#define ELF32_M_INFO(sym,size) (((sym) << 8) + (unsigned char) (size))
6612
6613#define ELF64_M_SYM(info) ELF32_M_SYM (info)
6614#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
6615#define ELF64_M_INFO(sym,size) ELF32_M_INFO (sym, size)
6616
6617
6618
6619
6620
6621#define EF_CPU32 0x00810000
6622
6623
6624
6625#define R_68K_NONE 0
6626#define R_68K_32 1
6627#define R_68K_16 2
6628#define R_68K_8 3
6629#define R_68K_PC32 4
6630#define R_68K_PC16 5
6631#define R_68K_PC8 6
6632#define R_68K_GOT32 7
6633#define R_68K_GOT16 8
6634#define R_68K_GOT8 9
6635#define R_68K_GOT32O 10
6636#define R_68K_GOT16O 11
6637#define R_68K_GOT8O 12
6638#define R_68K_PLT32 13
6639#define R_68K_PLT16 14
6640#define R_68K_PLT8 15
6641#define R_68K_PLT32O 16
6642#define R_68K_PLT16O 17
6643#define R_68K_PLT8O 18
6644#define R_68K_COPY 19
6645#define R_68K_GLOB_DAT 20
6646#define R_68K_JMP_SLOT 21
6647#define R_68K_RELATIVE 22
6648
6649#define R_68K_NUM 23
6650
6651
6652
6653
6654
6655#define R_386_NONE 0
6656#define R_386_32 1
6657#define R_386_PC32 2
6658#define R_386_GOT32 3
6659#define R_386_PLT32 4
6660#define R_386_COPY 5
6661#define R_386_GLOB_DAT 6
6662#define R_386_JMP_SLOT 7
6663#define R_386_RELATIVE 8
6664#define R_386_GOTOFF 9
6665#define R_386_GOTPC 10
6666#define R_386_32PLT 11
6667#define R_386_TLS_TPOFF 14
6668#define R_386_TLS_IE 15
6669
6670#define R_386_TLS_GOTIE 16
6671
6672#define R_386_TLS_LE 17
6673
6674#define R_386_TLS_GD 18
6675
6676#define R_386_TLS_LDM 19
6677
6678
6679#define R_386_16 20
6680#define R_386_PC16 21
6681#define R_386_8 22
6682#define R_386_PC8 23
6683#define R_386_TLS_GD_32 24
6684
6685#define R_386_TLS_GD_PUSH 25
6686#define R_386_TLS_GD_CALL 26
6687
6688#define R_386_TLS_GD_POP 27
6689#define R_386_TLS_LDM_32 28
6690
6691#define R_386_TLS_LDM_PUSH 29
6692#define R_386_TLS_LDM_CALL 30
6693
6694#define R_386_TLS_LDM_POP 31
6695#define R_386_TLS_LDO_32 32
6696#define R_386_TLS_IE_32 33
6697
6698#define R_386_TLS_LE_32 34
6699
6700#define R_386_TLS_DTPMOD32 35
6701#define R_386_TLS_DTPOFF32 36
6702#define R_386_TLS_TPOFF32 37
6703
6704#define R_386_NUM 38
6705
6706
6707#define R_BFIN_UNUSED0 0x00
6708#define R_BFIN_PCREL5M2 0x01
6709#define R_BFIN_UNUSED1 0x02
6710#define R_BFIN_PCREL10 0x03
6711#define R_BFIN_PCREL12_JUMP 0x04
6712#define R_BFIN_RIMM16 0x05
6713#define R_BFIN_LUIMM16 0x06
6714#define R_BFIN_HUIMM16 0x07
6715#define R_BFIN_PCREL12_JUMP_S 0x08
6716#define R_BFIN_PCREL24_JUMP_X 0x09
6717#define R_BFIN_PCREL24 0x0a
6718#define R_BFIN_UNUSEDB 0x0b
6719#define R_BFIN_UNUSEDC 0x0c
6720#define R_BFIN_PCREL24_JUMP_L 0x0d
6721#define R_BFIN_PCREL24_CALL_X 0x0e
6722#define R_BFIN_var_eq_symb 0x0f
6723#define R_BFIN_BYTE_DATA 0x10
6724#define R_BFIN_BYTE2_DATA 0x11
6725#define R_BFIN_BYTE4_DATA 0x12
6726#define R_BFIN_PCREL11 0x13
6727
6728#define R_BFIN_GOT17M4 0x14
6729#define R_BFIN_GOTHI 0x15
6730#define R_BFIN_GOTLO 0x16
6731#define R_BFIN_FUNCDESC 0x17
6732#define R_BFIN_FUNCDESC_GOT17M4 0x18
6733#define R_BFIN_FUNCDESC_GOTHI 0x19
6734#define R_BFIN_FUNCDESC_GOTLO 0x1a
6735#define R_BFIN_FUNCDESC_VALUE 0x1b
6736#define R_BFIN_FUNCDESC_GOTOFF17M4 0x1c
6737#define R_BFIN_FUNCDESC_GOTOFFHI 0x1d
6738#define R_BFIN_FUNCDESC_GOTOFFLO 0x1e
6739#define R_BFIN_GOTOFF17M4 0x1f
6740#define R_BFIN_GOTOFFHI 0x20
6741#define R_BFIN_GOTOFFLO 0x21
6742
6743#define EF_BFIN_PIC 0x00000001
6744#define EF_BFIN_FDPIC 0x00000002
6745#define EF_BFIN_CODE_IN_L1 0x00000010
6746#define EF_BFIN_DATA_IN_L1 0x00000020
6747
6748
6749#define R_FRV_NONE 0
6750#define R_FRV_32 1
6751
6752#define R_FRV_FUNCDESC 14
6753
6754#define R_FRV_FUNCDESC_VALUE 18
6755
6756
6757#define EF_FRV_GPR_MASK 0x00000003
6758#define EF_FRV_GPR_32 0x00000001
6759#define EF_FRV_GPR_64 0x00000002
6760
6761
6762#define EF_FRV_FPR_MASK 0x0000000c
6763#define EF_FRV_FPR_32 0x00000004
6764#define EF_FRV_FPR_64 0x00000008
6765#define EF_FRV_FPR_NONE 0x0000000c
6766
6767#define EF_FRV_PIC 0x00000100
6768#define EF_FRV_FDPIC 0x00008000
6769
6770
6771
6772
6773
6774#define STT_SPARC_REGISTER 13
6775
6776
6777
6778#define EF_SPARCV9_MM 3
6779#define EF_SPARCV9_TSO 0
6780#define EF_SPARCV9_PSO 1
6781#define EF_SPARCV9_RMO 2
6782#define EF_SPARC_LEDATA 0x800000
6783#define EF_SPARC_EXT_MASK 0xFFFF00
6784#define EF_SPARC_32PLUS 0x000100
6785#define EF_SPARC_SUN_US1 0x000200
6786#define EF_SPARC_HAL_R1 0x000400
6787#define EF_SPARC_SUN_US3 0x000800
6788
6789
6790
6791#define R_SPARC_NONE 0
6792#define R_SPARC_8 1
6793#define R_SPARC_16 2
6794#define R_SPARC_32 3
6795#define R_SPARC_DISP8 4
6796#define R_SPARC_DISP16 5
6797#define R_SPARC_DISP32 6
6798#define R_SPARC_WDISP30 7
6799#define R_SPARC_WDISP22 8
6800#define R_SPARC_HI22 9
6801#define R_SPARC_22 10
6802#define R_SPARC_13 11
6803#define R_SPARC_LO10 12
6804#define R_SPARC_GOT10 13
6805#define R_SPARC_GOT13 14
6806#define R_SPARC_GOT22 15
6807#define R_SPARC_PC10 16
6808#define R_SPARC_PC22 17
6809#define R_SPARC_WPLT30 18
6810#define R_SPARC_COPY 19
6811#define R_SPARC_GLOB_DAT 20
6812#define R_SPARC_JMP_SLOT 21
6813#define R_SPARC_RELATIVE 22
6814#define R_SPARC_UA32 23
6815
6816
6817
6818#define R_SPARC_PLT32 24
6819#define R_SPARC_HIPLT22 25
6820#define R_SPARC_LOPLT10 26
6821#define R_SPARC_PCPLT32 27
6822#define R_SPARC_PCPLT22 28
6823#define R_SPARC_PCPLT10 29
6824#define R_SPARC_10 30
6825#define R_SPARC_11 31
6826#define R_SPARC_64 32
6827#define R_SPARC_OLO10 33
6828#define R_SPARC_HH22 34
6829#define R_SPARC_HM10 35
6830#define R_SPARC_LM22 36
6831#define R_SPARC_PC_HH22 37
6832#define R_SPARC_PC_HM10 38
6833#define R_SPARC_PC_LM22 39
6834#define R_SPARC_WDISP16 40
6835#define R_SPARC_WDISP19 41
6836#define R_SPARC_7 43
6837#define R_SPARC_5 44
6838#define R_SPARC_6 45
6839#define R_SPARC_DISP64 46
6840#define R_SPARC_PLT64 47
6841#define R_SPARC_HIX22 48
6842#define R_SPARC_LOX10 49
6843#define R_SPARC_H44 50
6844#define R_SPARC_M44 51
6845#define R_SPARC_L44 52
6846#define R_SPARC_REGISTER 53
6847#define R_SPARC_UA64 54
6848#define R_SPARC_UA16 55
6849#define R_SPARC_TLS_GD_HI22 56
6850#define R_SPARC_TLS_GD_LO10 57
6851#define R_SPARC_TLS_GD_ADD 58
6852#define R_SPARC_TLS_GD_CALL 59
6853#define R_SPARC_TLS_LDM_HI22 60
6854#define R_SPARC_TLS_LDM_LO10 61
6855#define R_SPARC_TLS_LDM_ADD 62
6856#define R_SPARC_TLS_LDM_CALL 63
6857#define R_SPARC_TLS_LDO_HIX22 64
6858#define R_SPARC_TLS_LDO_LOX10 65
6859#define R_SPARC_TLS_LDO_ADD 66
6860#define R_SPARC_TLS_IE_HI22 67
6861#define R_SPARC_TLS_IE_LO10 68
6862#define R_SPARC_TLS_IE_LD 69
6863#define R_SPARC_TLS_IE_LDX 70
6864#define R_SPARC_TLS_IE_ADD 71
6865#define R_SPARC_TLS_LE_HIX22 72
6866#define R_SPARC_TLS_LE_LOX10 73
6867#define R_SPARC_TLS_DTPMOD32 74
6868#define R_SPARC_TLS_DTPMOD64 75
6869#define R_SPARC_TLS_DTPOFF32 76
6870#define R_SPARC_TLS_DTPOFF64 77
6871#define R_SPARC_TLS_TPOFF32 78
6872#define R_SPARC_TLS_TPOFF64 79
6873
6874#define R_SPARC_NUM 80
6875
6876
6877
6878#define DT_SPARC_REGISTER 0x70000001
6879#define DT_SPARC_NUM 2
6880
6881
6882
6883#define HWCAP_SPARC_FLUSH 1
6884#define HWCAP_SPARC_STBAR 2
6885#define HWCAP_SPARC_SWAP 4
6886#define HWCAP_SPARC_MULDIV 8
6887#define HWCAP_SPARC_V9 16
6888#define HWCAP_SPARC_ULTRA3 32
6889
6890
6891
6892
6893
6894#define EF_MIPS_NOREORDER 1
6895#define EF_MIPS_PIC 2
6896#define EF_MIPS_CPIC 4
6897#define EF_MIPS_XGOT 8
6898#define EF_MIPS_64BIT_WHIRL 16
6899#define EF_MIPS_ABI2 32
6900#define EF_MIPS_ABI_ON32 64
6901#define EF_MIPS_ARCH 0xf0000000
6902
6903
6904
6905#define EF_MIPS_ARCH_1 0x00000000
6906#define EF_MIPS_ARCH_2 0x10000000
6907#define EF_MIPS_ARCH_3 0x20000000
6908#define EF_MIPS_ARCH_4 0x30000000
6909#define EF_MIPS_ARCH_5 0x40000000
6910#define EF_MIPS_ARCH_32 0x60000000
6911#define EF_MIPS_ARCH_64 0x70000000
6912
6913
6914
6915#define E_MIPS_ARCH_1 0x00000000
6916#define E_MIPS_ARCH_2 0x10000000
6917#define E_MIPS_ARCH_3 0x20000000
6918#define E_MIPS_ARCH_4 0x30000000
6919#define E_MIPS_ARCH_5 0x40000000
6920#define E_MIPS_ARCH_32 0x60000000
6921#define E_MIPS_ARCH_64 0x70000000
6922
6923
6924
6925#define SHN_MIPS_ACOMMON 0xff00
6926#define SHN_MIPS_TEXT 0xff01
6927#define SHN_MIPS_DATA 0xff02
6928#define SHN_MIPS_SCOMMON 0xff03
6929#define SHN_MIPS_SUNDEFINED 0xff04
6930
6931
6932
6933#define SHT_MIPS_LIBLIST 0x70000000
6934#define SHT_MIPS_MSYM 0x70000001
6935#define SHT_MIPS_CONFLICT 0x70000002
6936#define SHT_MIPS_GPTAB 0x70000003
6937#define SHT_MIPS_UCODE 0x70000004
6938#define SHT_MIPS_DEBUG 0x70000005
6939#define SHT_MIPS_REGINFO 0x70000006
6940#define SHT_MIPS_PACKAGE 0x70000007
6941#define SHT_MIPS_PACKSYM 0x70000008
6942#define SHT_MIPS_RELD 0x70000009
6943#define SHT_MIPS_IFACE 0x7000000b
6944#define SHT_MIPS_CONTENT 0x7000000c
6945#define SHT_MIPS_OPTIONS 0x7000000d
6946#define SHT_MIPS_SHDR 0x70000010
6947#define SHT_MIPS_FDESC 0x70000011
6948#define SHT_MIPS_EXTSYM 0x70000012
6949#define SHT_MIPS_DENSE 0x70000013
6950#define SHT_MIPS_PDESC 0x70000014
6951#define SHT_MIPS_LOCSYM 0x70000015
6952#define SHT_MIPS_AUXSYM 0x70000016
6953#define SHT_MIPS_OPTSYM 0x70000017
6954#define SHT_MIPS_LOCSTR 0x70000018
6955#define SHT_MIPS_LINE 0x70000019
6956#define SHT_MIPS_RFDESC 0x7000001a
6957#define SHT_MIPS_DELTASYM 0x7000001b
6958#define SHT_MIPS_DELTAINST 0x7000001c
6959#define SHT_MIPS_DELTACLASS 0x7000001d
6960#define SHT_MIPS_DWARF 0x7000001e
6961#define SHT_MIPS_DELTADECL 0x7000001f
6962#define SHT_MIPS_SYMBOL_LIB 0x70000020
6963#define SHT_MIPS_EVENTS 0x70000021
6964#define SHT_MIPS_TRANSLATE 0x70000022
6965#define SHT_MIPS_PIXIE 0x70000023
6966#define SHT_MIPS_XLATE 0x70000024
6967#define SHT_MIPS_XLATE_DEBUG 0x70000025
6968#define SHT_MIPS_WHIRL 0x70000026
6969#define SHT_MIPS_EH_REGION 0x70000027
6970#define SHT_MIPS_XLATE_OLD 0x70000028
6971#define SHT_MIPS_PDR_EXCEPTION 0x70000029
6972
6973
6974
6975#define SHF_MIPS_GPREL 0x10000000
6976#define SHF_MIPS_MERGE 0x20000000
6977#define SHF_MIPS_ADDR 0x40000000
6978#define SHF_MIPS_STRINGS 0x80000000
6979#define SHF_MIPS_NOSTRIP 0x08000000
6980#define SHF_MIPS_LOCAL 0x04000000
6981#define SHF_MIPS_NAMES 0x02000000
6982#define SHF_MIPS_NODUPE 0x01000000
6983
6984
6985
6986
6987
6988#define STO_MIPS_DEFAULT 0x0
6989#define STO_MIPS_INTERNAL 0x1
6990#define STO_MIPS_HIDDEN 0x2
6991#define STO_MIPS_PROTECTED 0x3
6992#define STO_MIPS_PLT 0x8
6993#define STO_MIPS_SC_ALIGN_UNUSED 0xff
6994
6995
6996#define STB_MIPS_SPLIT_COMMON 13
6997
6998
6999
7000typedef union
7001{
7002 struct
7003 {
7004 Elf32_Word gt_current_g_value;
7005 Elf32_Word gt_unused;
7006 } gt_header;
7007 struct
7008 {
7009 Elf32_Word gt_g_value;
7010 Elf32_Word gt_bytes;
7011 } gt_entry;
7012} Elf32_gptab;
7013
7014
7015
7016typedef struct
7017{
7018 Elf32_Word ri_gprmask;
7019 Elf32_Word ri_cprmask[4];
7020 Elf32_Sword ri_gp_value;
7021} Elf32_RegInfo;
7022
7023
7024
7025typedef struct
7026{
7027 unsigned char kind;
7028
7029 unsigned char size;
7030 Elf32_Section section;
7031
7032 Elf32_Word info;
7033} Elf_Options;
7034
7035
7036
7037#define ODK_NULL 0
7038#define ODK_REGINFO 1
7039#define ODK_EXCEPTIONS 2
7040#define ODK_PAD 3
7041#define ODK_HWPATCH 4
7042#define ODK_FILL 5
7043#define ODK_TAGS 6
7044#define ODK_HWAND 7
7045#define ODK_HWOR 8
7046
7047
7048
7049#define OEX_FPU_MIN 0x1f
7050#define OEX_FPU_MAX 0x1f00
7051#define OEX_PAGE0 0x10000
7052#define OEX_SMM 0x20000
7053#define OEX_FPDBUG 0x40000
7054#define OEX_PRECISEFP OEX_FPDBUG
7055#define OEX_DISMISS 0x80000
7056
7057#define OEX_FPU_INVAL 0x10
7058#define OEX_FPU_DIV0 0x08
7059#define OEX_FPU_OFLO 0x04
7060#define OEX_FPU_UFLO 0x02
7061#define OEX_FPU_INEX 0x01
7062
7063
7064
7065#define OHW_R4KEOP 0x1
7066#define OHW_R8KPFETCH 0x2
7067#define OHW_R5KEOP 0x4
7068#define OHW_R5KCVTL 0x8
7069
7070#define OPAD_PREFIX 0x1
7071#define OPAD_POSTFIX 0x2
7072#define OPAD_SYMBOL 0x4
7073
7074
7075
7076typedef struct
7077{
7078 Elf32_Word hwp_flags1;
7079 Elf32_Word hwp_flags2;
7080} Elf_Options_Hw;
7081
7082
7083
7084#define OHWA0_R4KEOP_CHECKED 0x00000001
7085#define OHWA1_R4KEOP_CLEAN 0x00000002
7086
7087
7088
7089#define R_MIPS_NONE 0
7090#define R_MIPS_16 1
7091#define R_MIPS_32 2
7092#define R_MIPS_REL32 3
7093#define R_MIPS_26 4
7094#define R_MIPS_HI16 5
7095#define R_MIPS_LO16 6
7096#define R_MIPS_GPREL16 7
7097#define R_MIPS_LITERAL 8
7098#define R_MIPS_GOT16 9
7099#define R_MIPS_PC16 10
7100#define R_MIPS_CALL16 11
7101#define R_MIPS_GPREL32 12
7102
7103#define R_MIPS_SHIFT5 16
7104#define R_MIPS_SHIFT6 17
7105#define R_MIPS_64 18
7106#define R_MIPS_GOT_DISP 19
7107#define R_MIPS_GOT_PAGE 20
7108#define R_MIPS_GOT_OFST 21
7109#define R_MIPS_GOT_HI16 22
7110#define R_MIPS_GOT_LO16 23
7111#define R_MIPS_SUB 24
7112#define R_MIPS_INSERT_A 25
7113#define R_MIPS_INSERT_B 26
7114#define R_MIPS_DELETE 27
7115#define R_MIPS_HIGHER 28
7116#define R_MIPS_HIGHEST 29
7117#define R_MIPS_CALL_HI16 30
7118#define R_MIPS_CALL_LO16 31
7119#define R_MIPS_SCN_DISP 32
7120#define R_MIPS_REL16 33
7121#define R_MIPS_ADD_IMMEDIATE 34
7122#define R_MIPS_PJUMP 35
7123#define R_MIPS_RELGOT 36
7124#define R_MIPS_JALR 37
7125#define R_MIPS_TLS_DTPMOD32 38
7126#define R_MIPS_TLS_DTPREL32 39
7127#define R_MIPS_TLS_DTPMOD64 40
7128#define R_MIPS_TLS_DTPREL64 41
7129#define R_MIPS_TLS_GD 42
7130#define R_MIPS_TLS_LDM 43
7131#define R_MIPS_TLS_DTPREL_HI16 44
7132#define R_MIPS_TLS_DTPREL_LO16 45
7133#define R_MIPS_TLS_GOTTPREL 46
7134#define R_MIPS_TLS_TPREL32 47
7135#define R_MIPS_TLS_TPREL64 48
7136#define R_MIPS_TLS_TPREL_HI16 49
7137#define R_MIPS_TLS_TPREL_LO16 50
7138#define R_MIPS_GLOB_DAT 51
7139#define R_MIPS_COPY 126
7140#define R_MIPS_JUMP_SLOT 127
7141
7142#define R_MIPS_NUM 128
7143
7144
7145
7146#define PT_MIPS_REGINFO 0x70000000
7147#define PT_MIPS_RTPROC 0x70000001
7148#define PT_MIPS_OPTIONS 0x70000002
7149
7150
7151
7152#define PF_MIPS_LOCAL 0x10000000
7153
7154
7155
7156#define DT_MIPS_RLD_VERSION 0x70000001
7157#define DT_MIPS_TIME_STAMP 0x70000002
7158#define DT_MIPS_ICHECKSUM 0x70000003
7159#define DT_MIPS_IVERSION 0x70000004
7160#define DT_MIPS_FLAGS 0x70000005
7161#define DT_MIPS_BASE_ADDRESS 0x70000006
7162#define DT_MIPS_MSYM 0x70000007
7163#define DT_MIPS_CONFLICT 0x70000008
7164#define DT_MIPS_LIBLIST 0x70000009
7165#define DT_MIPS_LOCAL_GOTNO 0x7000000a
7166#define DT_MIPS_CONFLICTNO 0x7000000b
7167#define DT_MIPS_LIBLISTNO 0x70000010
7168#define DT_MIPS_SYMTABNO 0x70000011
7169#define DT_MIPS_UNREFEXTNO 0x70000012
7170#define DT_MIPS_GOTSYM 0x70000013
7171#define DT_MIPS_HIPAGENO 0x70000014
7172#define DT_MIPS_RLD_MAP 0x70000016
7173#define DT_MIPS_DELTA_CLASS 0x70000017
7174#define DT_MIPS_DELTA_CLASS_NO 0x70000018
7175
7176#define DT_MIPS_DELTA_INSTANCE 0x70000019
7177#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
7178
7179#define DT_MIPS_DELTA_RELOC 0x7000001b
7180#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
7181
7182#define DT_MIPS_DELTA_SYM 0x7000001d
7183
7184#define DT_MIPS_DELTA_SYM_NO 0x7000001e
7185
7186#define DT_MIPS_DELTA_CLASSSYM 0x70000020
7187
7188#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
7189
7190#define DT_MIPS_CXX_FLAGS 0x70000022
7191#define DT_MIPS_PIXIE_INIT 0x70000023
7192#define DT_MIPS_SYMBOL_LIB 0x70000024
7193#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
7194#define DT_MIPS_LOCAL_GOTIDX 0x70000026
7195#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
7196#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
7197#define DT_MIPS_OPTIONS 0x70000029
7198#define DT_MIPS_INTERFACE 0x7000002a
7199#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
7200#define DT_MIPS_INTERFACE_SIZE 0x7000002c
7201#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
7202
7203#define DT_MIPS_PERF_SUFFIX 0x7000002e
7204
7205#define DT_MIPS_COMPACT_SIZE 0x7000002f
7206#define DT_MIPS_GP_VALUE 0x70000030
7207#define DT_MIPS_AUX_DYNAMIC 0x70000031
7208
7209#define DT_MIPS_PLTGOT 0x70000032
7210
7211
7212
7213#define DT_MIPS_RWPLT 0x70000034
7214#define DT_MIPS_NUM 0x35
7215
7216
7217
7218#define RHF_NONE 0
7219#define RHF_QUICKSTART (1 << 0)
7220#define RHF_NOTPOT (1 << 1)
7221#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
7222#define RHF_NO_MOVE (1 << 3)
7223#define RHF_SGI_ONLY (1 << 4)
7224#define RHF_GUARANTEE_INIT (1 << 5)
7225#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
7226#define RHF_GUARANTEE_START_INIT (1 << 7)
7227#define RHF_PIXIE (1 << 8)
7228#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
7229#define RHF_REQUICKSTART (1 << 10)
7230#define RHF_REQUICKSTARTED (1 << 11)
7231#define RHF_CORD (1 << 12)
7232#define RHF_NO_UNRES_UNDEF (1 << 13)
7233#define RHF_RLD_ORDER_SAFE (1 << 14)
7234
7235
7236
7237typedef struct
7238{
7239 Elf32_Word l_name;
7240 Elf32_Word l_time_stamp;
7241 Elf32_Word l_checksum;
7242 Elf32_Word l_version;
7243 Elf32_Word l_flags;
7244} Elf32_Lib;
7245
7246typedef struct
7247{
7248 Elf64_Word l_name;
7249 Elf64_Word l_time_stamp;
7250 Elf64_Word l_checksum;
7251 Elf64_Word l_version;
7252 Elf64_Word l_flags;
7253} Elf64_Lib;
7254
7255
7256
7257
7258#define LL_NONE 0
7259#define LL_EXACT_MATCH (1 << 0)
7260#define LL_IGNORE_INT_VER (1 << 1)
7261#define LL_REQUIRE_MINOR (1 << 2)
7262#define LL_EXPORTS (1 << 3)
7263#define LL_DELAY_LOAD (1 << 4)
7264#define LL_DELTA (1 << 5)
7265
7266
7267
7268typedef Elf32_Addr Elf32_Conflict;
7269
7270
7271
7272
7273
7274
7275#define EF_PARISC_TRAPNIL 0x00010000
7276#define EF_PARISC_EXT 0x00020000
7277#define EF_PARISC_LSB 0x00040000
7278#define EF_PARISC_WIDE 0x00080000
7279#define EF_PARISC_NO_KABP 0x00100000
7280
7281#define EF_PARISC_LAZYSWAP 0x00400000
7282#define EF_PARISC_ARCH 0x0000ffff
7283
7284
7285
7286#define EFA_PARISC_1_0 0x020b
7287#define EFA_PARISC_1_1 0x0210
7288#define EFA_PARISC_2_0 0x0214
7289
7290
7291
7292#define SHN_PARISC_ANSI_COMMON 0xff00
7293
7294#define SHN_PARISC_HUGE_COMMON 0xff01
7295
7296
7297
7298#define SHT_PARISC_EXT 0x70000000
7299#define SHT_PARISC_UNWIND 0x70000001
7300#define SHT_PARISC_DOC 0x70000002
7301
7302
7303
7304#define SHF_PARISC_SHORT 0x20000000
7305#define SHF_PARISC_HUGE 0x40000000
7306#define SHF_PARISC_SBP 0x80000000
7307
7308
7309
7310#define STT_PARISC_MILLICODE 13
7311
7312#define STT_HP_OPAQUE (STT_LOOS + 0x1)
7313#define STT_HP_STUB (STT_LOOS + 0x2)
7314
7315
7316
7317#define R_PARISC_NONE 0
7318#define R_PARISC_DIR32 1
7319#define R_PARISC_DIR21L 2
7320#define R_PARISC_DIR17R 3
7321#define R_PARISC_DIR17F 4
7322#define R_PARISC_DIR14R 6
7323#define R_PARISC_PCREL32 9
7324#define R_PARISC_PCREL21L 10
7325#define R_PARISC_PCREL17R 11
7326#define R_PARISC_PCREL17F 12
7327#define R_PARISC_PCREL14R 14
7328#define R_PARISC_DPREL21L 18
7329#define R_PARISC_DPREL14R 22
7330#define R_PARISC_GPREL21L 26
7331#define R_PARISC_GPREL14R 30
7332#define R_PARISC_LTOFF21L 34
7333#define R_PARISC_LTOFF14R 38
7334#define R_PARISC_SECREL32 41
7335#define R_PARISC_SEGBASE 48
7336#define R_PARISC_SEGREL32 49
7337#define R_PARISC_PLTOFF21L 50
7338#define R_PARISC_PLTOFF14R 54
7339#define R_PARISC_LTOFF_FPTR32 57
7340#define R_PARISC_LTOFF_FPTR21L 58
7341#define R_PARISC_LTOFF_FPTR14R 62
7342#define R_PARISC_FPTR64 64
7343#define R_PARISC_PLABEL32 65
7344#define R_PARISC_PCREL64 72
7345#define R_PARISC_PCREL22F 74
7346#define R_PARISC_PCREL14WR 75
7347#define R_PARISC_PCREL14DR 76
7348#define R_PARISC_PCREL16F 77
7349#define R_PARISC_PCREL16WF 78
7350#define R_PARISC_PCREL16DF 79
7351#define R_PARISC_DIR64 80
7352#define R_PARISC_DIR14WR 83
7353#define R_PARISC_DIR14DR 84
7354#define R_PARISC_DIR16F 85
7355#define R_PARISC_DIR16WF 86
7356#define R_PARISC_DIR16DF 87
7357#define R_PARISC_GPREL64 88
7358#define R_PARISC_GPREL14WR 91
7359#define R_PARISC_GPREL14DR 92
7360#define R_PARISC_GPREL16F 93
7361#define R_PARISC_GPREL16WF 94
7362#define R_PARISC_GPREL16DF 95
7363#define R_PARISC_LTOFF64 96
7364#define R_PARISC_LTOFF14WR 99
7365#define R_PARISC_LTOFF14DR 100
7366#define R_PARISC_LTOFF16F 101
7367#define R_PARISC_LTOFF16WF 102
7368#define R_PARISC_LTOFF16DF 103
7369#define R_PARISC_SECREL64 104
7370#define R_PARISC_SEGREL64 112
7371#define R_PARISC_PLTOFF14WR 115
7372#define R_PARISC_PLTOFF14DR 116
7373#define R_PARISC_PLTOFF16F 117
7374#define R_PARISC_PLTOFF16WF 118
7375#define R_PARISC_PLTOFF16DF 119
7376#define R_PARISC_LTOFF_FPTR64 120
7377#define R_PARISC_LTOFF_FPTR14WR 123
7378#define R_PARISC_LTOFF_FPTR14DR 124
7379#define R_PARISC_LTOFF_FPTR16F 125
7380#define R_PARISC_LTOFF_FPTR16WF 126
7381#define R_PARISC_LTOFF_FPTR16DF 127
7382#define R_PARISC_LORESERVE 128
7383#define R_PARISC_COPY 128
7384#define R_PARISC_IPLT 129
7385#define R_PARISC_EPLT 130
7386#define R_PARISC_TPREL32 153
7387#define R_PARISC_TPREL21L 154
7388#define R_PARISC_TPREL14R 158
7389#define R_PARISC_LTOFF_TP21L 162
7390#define R_PARISC_LTOFF_TP14R 166
7391#define R_PARISC_LTOFF_TP14F 167
7392#define R_PARISC_TPREL64 216
7393#define R_PARISC_TPREL14WR 219
7394#define R_PARISC_TPREL14DR 220
7395#define R_PARISC_TPREL16F 221
7396#define R_PARISC_TPREL16WF 222
7397#define R_PARISC_TPREL16DF 223
7398#define R_PARISC_LTOFF_TP64 224
7399#define R_PARISC_LTOFF_TP14WR 227
7400#define R_PARISC_LTOFF_TP14DR 228
7401#define R_PARISC_LTOFF_TP16F 229
7402#define R_PARISC_LTOFF_TP16WF 230
7403#define R_PARISC_LTOFF_TP16DF 231
7404#define R_PARISC_HIRESERVE 255
7405
7406
7407
7408#define PT_HP_TLS (PT_LOOS + 0x0)
7409#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
7410#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
7411#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
7412#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
7413#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
7414#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
7415#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
7416#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
7417#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
7418#define PT_HP_PARALLEL (PT_LOOS + 0x10)
7419#define PT_HP_FASTBIND (PT_LOOS + 0x11)
7420#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
7421#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
7422#define PT_HP_STACK (PT_LOOS + 0x14)
7423
7424#define PT_PARISC_ARCHEXT 0x70000000
7425#define PT_PARISC_UNWIND 0x70000001
7426
7427
7428
7429#define PF_PARISC_SBP 0x08000000
7430
7431#define PF_HP_PAGE_SIZE 0x00100000
7432#define PF_HP_FAR_SHARED 0x00200000
7433#define PF_HP_NEAR_SHARED 0x00400000
7434#define PF_HP_CODE 0x01000000
7435#define PF_HP_MODIFY 0x02000000
7436#define PF_HP_LAZYSWAP 0x04000000
7437#define PF_HP_SBP 0x08000000
7438
7439
7440
7441
7442
7443
7444#define EF_ALPHA_32BIT 1
7445#define EF_ALPHA_CANRELAX 2
7446
7447
7448
7449
7450#define SHT_ALPHA_DEBUG 0x70000001
7451#define SHT_ALPHA_REGINFO 0x70000002
7452
7453
7454
7455#define SHF_ALPHA_GPREL 0x10000000
7456
7457
7458#define STO_ALPHA_NOPV 0x80
7459#define STO_ALPHA_STD_GPLOAD 0x88
7460
7461
7462
7463#define R_ALPHA_NONE 0
7464#define R_ALPHA_REFLONG 1
7465#define R_ALPHA_REFQUAD 2
7466#define R_ALPHA_GPREL32 3
7467#define R_ALPHA_LITERAL 4
7468#define R_ALPHA_LITUSE 5
7469#define R_ALPHA_GPDISP 6
7470#define R_ALPHA_BRADDR 7
7471#define R_ALPHA_HINT 8
7472#define R_ALPHA_SREL16 9
7473#define R_ALPHA_SREL32 10
7474#define R_ALPHA_SREL64 11
7475#define R_ALPHA_GPRELHIGH 17
7476#define R_ALPHA_GPRELLOW 18
7477#define R_ALPHA_GPREL16 19
7478#define R_ALPHA_COPY 24
7479#define R_ALPHA_GLOB_DAT 25
7480#define R_ALPHA_JMP_SLOT 26
7481#define R_ALPHA_RELATIVE 27
7482#define R_ALPHA_TLS_GD_HI 28
7483#define R_ALPHA_TLSGD 29
7484#define R_ALPHA_TLS_LDM 30
7485#define R_ALPHA_DTPMOD64 31
7486#define R_ALPHA_GOTDTPREL 32
7487#define R_ALPHA_DTPREL64 33
7488#define R_ALPHA_DTPRELHI 34
7489#define R_ALPHA_DTPRELLO 35
7490#define R_ALPHA_DTPREL16 36
7491#define R_ALPHA_GOTTPREL 37
7492#define R_ALPHA_TPREL64 38
7493#define R_ALPHA_TPRELHI 39
7494#define R_ALPHA_TPRELLO 40
7495#define R_ALPHA_TPREL16 41
7496
7497#define R_ALPHA_NUM 46
7498
7499
7500#define LITUSE_ALPHA_ADDR 0
7501#define LITUSE_ALPHA_BASE 1
7502#define LITUSE_ALPHA_BYTOFF 2
7503#define LITUSE_ALPHA_JSR 3
7504#define LITUSE_ALPHA_TLS_GD 4
7505#define LITUSE_ALPHA_TLS_LDM 5
7506
7507
7508#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
7509#define DT_ALPHA_NUM 1
7510
7511
7512
7513
7514#define EF_PPC_EMB 0x80000000
7515
7516
7517#define EF_PPC_RELOCATABLE 0x00010000
7518#define EF_PPC_RELOCATABLE_LIB 0x00008000
7519
7520
7521
7522#define R_PPC_NONE 0
7523#define R_PPC_ADDR32 1
7524#define R_PPC_ADDR24 2
7525#define R_PPC_ADDR16 3
7526#define R_PPC_ADDR16_LO 4
7527#define R_PPC_ADDR16_HI 5
7528#define R_PPC_ADDR16_HA 6
7529#define R_PPC_ADDR14 7
7530#define R_PPC_ADDR14_BRTAKEN 8
7531#define R_PPC_ADDR14_BRNTAKEN 9
7532#define R_PPC_REL24 10
7533#define R_PPC_REL14 11
7534#define R_PPC_REL14_BRTAKEN 12
7535#define R_PPC_REL14_BRNTAKEN 13
7536#define R_PPC_GOT16 14
7537#define R_PPC_GOT16_LO 15
7538#define R_PPC_GOT16_HI 16
7539#define R_PPC_GOT16_HA 17
7540#define R_PPC_PLTREL24 18
7541#define R_PPC_COPY 19
7542#define R_PPC_GLOB_DAT 20
7543#define R_PPC_JMP_SLOT 21
7544#define R_PPC_RELATIVE 22
7545#define R_PPC_LOCAL24PC 23
7546#define R_PPC_UADDR32 24
7547#define R_PPC_UADDR16 25
7548#define R_PPC_REL32 26
7549#define R_PPC_PLT32 27
7550#define R_PPC_PLTREL32 28
7551#define R_PPC_PLT16_LO 29
7552#define R_PPC_PLT16_HI 30
7553#define R_PPC_PLT16_HA 31
7554#define R_PPC_SDAREL16 32
7555#define R_PPC_SECTOFF 33
7556#define R_PPC_SECTOFF_LO 34
7557#define R_PPC_SECTOFF_HI 35
7558#define R_PPC_SECTOFF_HA 36
7559
7560
7561#define R_PPC_TLS 67
7562#define R_PPC_DTPMOD32 68
7563#define R_PPC_TPREL16 69
7564#define R_PPC_TPREL16_LO 70
7565#define R_PPC_TPREL16_HI 71
7566#define R_PPC_TPREL16_HA 72
7567#define R_PPC_TPREL32 73
7568#define R_PPC_DTPREL16 74
7569#define R_PPC_DTPREL16_LO 75
7570#define R_PPC_DTPREL16_HI 76
7571#define R_PPC_DTPREL16_HA 77
7572#define R_PPC_DTPREL32 78
7573#define R_PPC_GOT_TLSGD16 79
7574#define R_PPC_GOT_TLSGD16_LO 80
7575#define R_PPC_GOT_TLSGD16_HI 81
7576#define R_PPC_GOT_TLSGD16_HA 82
7577#define R_PPC_GOT_TLSLD16 83
7578#define R_PPC_GOT_TLSLD16_LO 84
7579#define R_PPC_GOT_TLSLD16_HI 85
7580#define R_PPC_GOT_TLSLD16_HA 86
7581#define R_PPC_GOT_TPREL16 87
7582#define R_PPC_GOT_TPREL16_LO 88
7583#define R_PPC_GOT_TPREL16_HI 89
7584#define R_PPC_GOT_TPREL16_HA 90
7585#define R_PPC_GOT_DTPREL16 91
7586#define R_PPC_GOT_DTPREL16_LO 92
7587#define R_PPC_GOT_DTPREL16_HI 93
7588#define R_PPC_GOT_DTPREL16_HA 94
7589
7590
7591#define R_PPC_NUM 95
7592
7593
7594
7595#define R_PPC_EMB_NADDR32 101
7596#define R_PPC_EMB_NADDR16 102
7597#define R_PPC_EMB_NADDR16_LO 103
7598#define R_PPC_EMB_NADDR16_HI 104
7599#define R_PPC_EMB_NADDR16_HA 105
7600#define R_PPC_EMB_SDAI16 106
7601#define R_PPC_EMB_SDA2I16 107
7602#define R_PPC_EMB_SDA2REL 108
7603#define R_PPC_EMB_SDA21 109
7604#define R_PPC_EMB_MRKREF 110
7605#define R_PPC_EMB_RELSEC16 111
7606#define R_PPC_EMB_RELST_LO 112
7607#define R_PPC_EMB_RELST_HI 113
7608#define R_PPC_EMB_RELST_HA 114
7609#define R_PPC_EMB_BIT_FLD 115
7610#define R_PPC_EMB_RELSDA 116
7611
7612
7613#define R_PPC_DIAB_SDA21_LO 180
7614#define R_PPC_DIAB_SDA21_HI 181
7615#define R_PPC_DIAB_SDA21_HA 182
7616#define R_PPC_DIAB_RELSDA_LO 183
7617#define R_PPC_DIAB_RELSDA_HI 184
7618#define R_PPC_DIAB_RELSDA_HA 185
7619
7620
7621#define R_PPC_REL16 249
7622#define R_PPC_REL16_LO 250
7623#define R_PPC_REL16_HI 251
7624#define R_PPC_REL16_HA 252
7625
7626
7627
7628#define R_PPC_TOC16 255
7629
7630
7631#define DT_PPC_GOT (DT_LOPROC + 0)
7632#define DT_PPC_NUM 1
7633
7634
7635#define R_PPC64_NONE R_PPC_NONE
7636#define R_PPC64_ADDR32 R_PPC_ADDR32
7637#define R_PPC64_ADDR24 R_PPC_ADDR24
7638#define R_PPC64_ADDR16 R_PPC_ADDR16
7639#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
7640#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
7641#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
7642#define R_PPC64_ADDR14 R_PPC_ADDR14
7643#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
7644#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
7645#define R_PPC64_REL24 R_PPC_REL24
7646#define R_PPC64_REL14 R_PPC_REL14
7647#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
7648#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
7649#define R_PPC64_GOT16 R_PPC_GOT16
7650#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
7651#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
7652#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
7653
7654#define R_PPC64_COPY R_PPC_COPY
7655#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
7656#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
7657#define R_PPC64_RELATIVE R_PPC_RELATIVE
7658
7659#define R_PPC64_UADDR32 R_PPC_UADDR32
7660#define R_PPC64_UADDR16 R_PPC_UADDR16
7661#define R_PPC64_REL32 R_PPC_REL32
7662#define R_PPC64_PLT32 R_PPC_PLT32
7663#define R_PPC64_PLTREL32 R_PPC_PLTREL32
7664#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
7665#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
7666#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
7667
7668#define R_PPC64_SECTOFF R_PPC_SECTOFF
7669#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
7670#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
7671#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
7672#define R_PPC64_ADDR30 37
7673#define R_PPC64_ADDR64 38
7674#define R_PPC64_ADDR16_HIGHER 39
7675#define R_PPC64_ADDR16_HIGHERA 40
7676#define R_PPC64_ADDR16_HIGHEST 41
7677#define R_PPC64_ADDR16_HIGHESTA 42
7678#define R_PPC64_UADDR64 43
7679#define R_PPC64_REL64 44
7680#define R_PPC64_PLT64 45
7681#define R_PPC64_PLTREL64 46
7682#define R_PPC64_TOC16 47
7683#define R_PPC64_TOC16_LO 48
7684#define R_PPC64_TOC16_HI 49
7685#define R_PPC64_TOC16_HA 50
7686#define R_PPC64_TOC 51
7687#define R_PPC64_PLTGOT16 52
7688#define R_PPC64_PLTGOT16_LO 53
7689#define R_PPC64_PLTGOT16_HI 54
7690#define R_PPC64_PLTGOT16_HA 55
7691
7692#define R_PPC64_ADDR16_DS 56
7693#define R_PPC64_ADDR16_LO_DS 57
7694#define R_PPC64_GOT16_DS 58
7695#define R_PPC64_GOT16_LO_DS 59
7696#define R_PPC64_PLT16_LO_DS 60
7697#define R_PPC64_SECTOFF_DS 61
7698#define R_PPC64_SECTOFF_LO_DS 62
7699#define R_PPC64_TOC16_DS 63
7700#define R_PPC64_TOC16_LO_DS 64
7701#define R_PPC64_PLTGOT16_DS 65
7702#define R_PPC64_PLTGOT16_LO_DS 66
7703
7704
7705#define R_PPC64_TLS 67
7706#define R_PPC64_DTPMOD64 68
7707#define R_PPC64_TPREL16 69
7708#define R_PPC64_TPREL16_LO 70
7709#define R_PPC64_TPREL16_HI 71
7710#define R_PPC64_TPREL16_HA 72
7711#define R_PPC64_TPREL64 73
7712#define R_PPC64_DTPREL16 74
7713#define R_PPC64_DTPREL16_LO 75
7714#define R_PPC64_DTPREL16_HI 76
7715#define R_PPC64_DTPREL16_HA 77
7716#define R_PPC64_DTPREL64 78
7717#define R_PPC64_GOT_TLSGD16 79
7718#define R_PPC64_GOT_TLSGD16_LO 80
7719#define R_PPC64_GOT_TLSGD16_HI 81
7720#define R_PPC64_GOT_TLSGD16_HA 82
7721#define R_PPC64_GOT_TLSLD16 83
7722#define R_PPC64_GOT_TLSLD16_LO 84
7723#define R_PPC64_GOT_TLSLD16_HI 85
7724#define R_PPC64_GOT_TLSLD16_HA 86
7725#define R_PPC64_GOT_TPREL16_DS 87
7726#define R_PPC64_GOT_TPREL16_LO_DS 88
7727#define R_PPC64_GOT_TPREL16_HI 89
7728#define R_PPC64_GOT_TPREL16_HA 90
7729#define R_PPC64_GOT_DTPREL16_DS 91
7730#define R_PPC64_GOT_DTPREL16_LO_DS 92
7731#define R_PPC64_GOT_DTPREL16_HI 93
7732#define R_PPC64_GOT_DTPREL16_HA 94
7733#define R_PPC64_TPREL16_DS 95
7734#define R_PPC64_TPREL16_LO_DS 96
7735#define R_PPC64_TPREL16_HIGHER 97
7736#define R_PPC64_TPREL16_HIGHERA 98
7737#define R_PPC64_TPREL16_HIGHEST 99
7738#define R_PPC64_TPREL16_HIGHESTA 100
7739#define R_PPC64_DTPREL16_DS 101
7740#define R_PPC64_DTPREL16_LO_DS 102
7741#define R_PPC64_DTPREL16_HIGHER 103
7742#define R_PPC64_DTPREL16_HIGHERA 104
7743#define R_PPC64_DTPREL16_HIGHEST 105
7744#define R_PPC64_DTPREL16_HIGHESTA 106
7745
7746
7747#define R_PPC64_NUM 107
7748
7749
7750#define DT_PPC64_GLINK (DT_LOPROC + 0)
7751#define DT_PPC64_OPD (DT_LOPROC + 1)
7752#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
7753#define DT_PPC64_NUM 3
7754
7755
7756
7757
7758
7759#define EF_ARM_RELEXEC 0x01
7760#define EF_ARM_HASENTRY 0x02
7761#define EF_ARM_INTERWORK 0x04
7762#define EF_ARM_APCS_26 0x08
7763#define EF_ARM_APCS_FLOAT 0x10
7764#define EF_ARM_PIC 0x20
7765#define EF_ARM_ALIGN8 0x40
7766#define EF_ARM_NEW_ABI 0x80
7767#define EF_ARM_OLD_ABI 0x100
7768
7769
7770
7771#define EF_ARM_SYMSARESORTED 0x04
7772#define EF_ARM_DYNSYMSUSESEGIDX 0x08
7773#define EF_ARM_MAPSYMSFIRST 0x10
7774#define EF_ARM_EABIMASK 0XFF000000
7775
7776#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
7777#define EF_ARM_EABI_UNKNOWN 0x00000000
7778#define EF_ARM_EABI_VER1 0x01000000
7779#define EF_ARM_EABI_VER2 0x02000000
7780
7781
7782#define STT_ARM_TFUNC 0xd
7783
7784
7785#define SHF_ARM_ENTRYSECT 0x10000000
7786#define SHF_ARM_COMDEF 0x80000000
7787
7788
7789
7790#define PF_ARM_SB 0x10000000
7791
7792
7793
7794#define PT_ARM_EXIDX 0x70000001
7795
7796
7797
7798#define R_ARM_NONE 0
7799#define R_ARM_PC24 1
7800#define R_ARM_ABS32 2
7801#define R_ARM_REL32 3
7802#define R_ARM_PC13 4
7803#define R_ARM_ABS16 5
7804#define R_ARM_ABS12 6
7805#define R_ARM_THM_ABS5 7
7806#define R_ARM_ABS8 8
7807#define R_ARM_SBREL32 9
7808#define R_ARM_THM_PC22 10
7809#define R_ARM_THM_PC8 11
7810#define R_ARM_AMP_VCALL9 12
7811#define R_ARM_SWI24 13
7812#define R_ARM_THM_SWI8 14
7813#define R_ARM_XPC25 15
7814#define R_ARM_THM_XPC22 16
7815#define R_ARM_TLS_DTPMOD32 17
7816#define R_ARM_TLS_DTPOFF32 18
7817#define R_ARM_TLS_TPOFF32 19
7818#define R_ARM_COPY 20
7819#define R_ARM_GLOB_DAT 21
7820#define R_ARM_JUMP_SLOT 22
7821#define R_ARM_RELATIVE 23
7822#define R_ARM_GOTOFF 24
7823#define R_ARM_GOTPC 25
7824#define R_ARM_GOT32 26
7825#define R_ARM_PLT32 27
7826#define R_ARM_ALU_PCREL_7_0 32
7827#define R_ARM_ALU_PCREL_15_8 33
7828#define R_ARM_ALU_PCREL_23_15 34
7829#define R_ARM_LDR_SBREL_11_0 35
7830#define R_ARM_ALU_SBREL_19_12 36
7831#define R_ARM_ALU_SBREL_27_20 37
7832#define R_ARM_GNU_VTENTRY 100
7833#define R_ARM_GNU_VTINHERIT 101
7834#define R_ARM_THM_PC11 102
7835#define R_ARM_THM_PC9 103
7836#define R_ARM_TLS_GD32 104
7837#define R_ARM_TLS_LDM32 105
7838#define R_ARM_TLS_LDO32 106
7839#define R_ARM_TLS_IE32 107
7840#define R_ARM_TLS_LE32 108
7841#define R_ARM_TLS_LDO12 109
7842#define R_ARM_TLS_LE12 110
7843#define R_ARM_TLS_IE12GP 111
7844#define R_ARM_RXPC25 249
7845#define R_ARM_RSBREL32 250
7846#define R_ARM_THM_RPC22 251
7847#define R_ARM_RREL32 252
7848#define R_ARM_RABS22 253
7849#define R_ARM_RPC24 254
7850#define R_ARM_RBASE 255
7851
7852#define R_ARM_NUM 256
7853
7854
7855
7856
7857#define EF_IA_64_MASKOS 0x0000000f
7858#define EF_IA_64_ABI64 0x00000010
7859#define EF_IA_64_ARCH 0xff000000
7860
7861
7862#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
7863#define PT_IA_64_UNWIND (PT_LOPROC + 1)
7864#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
7865#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
7866#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
7867
7868
7869#define PF_IA_64_NORECOV 0x80000000
7870
7871
7872#define SHT_IA_64_EXT (SHT_LOPROC + 0)
7873#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
7874
7875
7876#define SHF_IA_64_SHORT 0x10000000
7877#define SHF_IA_64_NORECOV 0x20000000
7878
7879
7880#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
7881#define DT_IA_64_NUM 1
7882
7883
7884#define R_IA64_NONE 0x00
7885#define R_IA64_IMM14 0x21
7886#define R_IA64_IMM22 0x22
7887#define R_IA64_IMM64 0x23
7888#define R_IA64_DIR32MSB 0x24
7889#define R_IA64_DIR32LSB 0x25
7890#define R_IA64_DIR64MSB 0x26
7891#define R_IA64_DIR64LSB 0x27
7892#define R_IA64_GPREL22 0x2a
7893#define R_IA64_GPREL64I 0x2b
7894#define R_IA64_GPREL32MSB 0x2c
7895#define R_IA64_GPREL32LSB 0x2d
7896#define R_IA64_GPREL64MSB 0x2e
7897#define R_IA64_GPREL64LSB 0x2f
7898#define R_IA64_LTOFF22 0x32
7899#define R_IA64_LTOFF64I 0x33
7900#define R_IA64_PLTOFF22 0x3a
7901#define R_IA64_PLTOFF64I 0x3b
7902#define R_IA64_PLTOFF64MSB 0x3e
7903#define R_IA64_PLTOFF64LSB 0x3f
7904#define R_IA64_FPTR64I 0x43
7905#define R_IA64_FPTR32MSB 0x44
7906#define R_IA64_FPTR32LSB 0x45
7907#define R_IA64_FPTR64MSB 0x46
7908#define R_IA64_FPTR64LSB 0x47
7909#define R_IA64_PCREL60B 0x48
7910#define R_IA64_PCREL21B 0x49
7911#define R_IA64_PCREL21M 0x4a
7912#define R_IA64_PCREL21F 0x4b
7913#define R_IA64_PCREL32MSB 0x4c
7914#define R_IA64_PCREL32LSB 0x4d
7915#define R_IA64_PCREL64MSB 0x4e
7916#define R_IA64_PCREL64LSB 0x4f
7917#define R_IA64_LTOFF_FPTR22 0x52
7918#define R_IA64_LTOFF_FPTR64I 0x53
7919#define R_IA64_LTOFF_FPTR32MSB 0x54
7920#define R_IA64_LTOFF_FPTR32LSB 0x55
7921#define R_IA64_LTOFF_FPTR64MSB 0x56
7922#define R_IA64_LTOFF_FPTR64LSB 0x57
7923#define R_IA64_SEGREL32MSB 0x5c
7924#define R_IA64_SEGREL32LSB 0x5d
7925#define R_IA64_SEGREL64MSB 0x5e
7926#define R_IA64_SEGREL64LSB 0x5f
7927#define R_IA64_SECREL32MSB 0x64
7928#define R_IA64_SECREL32LSB 0x65
7929#define R_IA64_SECREL64MSB 0x66
7930#define R_IA64_SECREL64LSB 0x67
7931#define R_IA64_REL32MSB 0x6c
7932#define R_IA64_REL32LSB 0x6d
7933#define R_IA64_REL64MSB 0x6e
7934#define R_IA64_REL64LSB 0x6f
7935#define R_IA64_LTV32MSB 0x74
7936#define R_IA64_LTV32LSB 0x75
7937#define R_IA64_LTV64MSB 0x76
7938#define R_IA64_LTV64LSB 0x77
7939#define R_IA64_PCREL21BI 0x79
7940#define R_IA64_PCREL22 0x7a
7941#define R_IA64_PCREL64I 0x7b
7942#define R_IA64_IPLTMSB 0x80
7943#define R_IA64_IPLTLSB 0x81
7944#define R_IA64_COPY 0x84
7945#define R_IA64_SUB 0x85
7946#define R_IA64_LTOFF22X 0x86
7947#define R_IA64_LDXMOV 0x87
7948#define R_IA64_TPREL14 0x91
7949#define R_IA64_TPREL22 0x92
7950#define R_IA64_TPREL64I 0x93
7951#define R_IA64_TPREL64MSB 0x96
7952#define R_IA64_TPREL64LSB 0x97
7953#define R_IA64_LTOFF_TPREL22 0x9a
7954#define R_IA64_DTPMOD64MSB 0xa6
7955#define R_IA64_DTPMOD64LSB 0xa7
7956#define R_IA64_LTOFF_DTPMOD22 0xaa
7957#define R_IA64_DTPREL14 0xb1
7958#define R_IA64_DTPREL22 0xb2
7959#define R_IA64_DTPREL64I 0xb3
7960#define R_IA64_DTPREL32MSB 0xb4
7961#define R_IA64_DTPREL32LSB 0xb5
7962#define R_IA64_DTPREL64MSB 0xb6
7963#define R_IA64_DTPREL64LSB 0xb7
7964#define R_IA64_LTOFF_DTPREL22 0xba
7965
7966
7967
7968
7969
7970
7971
7972#define STO_SH5_ISA32 (1 << 2)
7973
7974
7975#define R_SH_NONE 0
7976#define R_SH_DIR32 1
7977#define R_SH_REL32 2
7978#define R_SH_DIR8WPN 3
7979#define R_SH_IND12W 4
7980#define R_SH_DIR8WPL 5
7981#define R_SH_DIR8WPZ 6
7982#define R_SH_DIR8BP 7
7983#define R_SH_DIR8W 8
7984#define R_SH_DIR8L 9
7985#define R_SH_SWITCH16 25
7986#define R_SH_SWITCH32 26
7987#define R_SH_USES 27
7988#define R_SH_COUNT 28
7989#define R_SH_ALIGN 29
7990#define R_SH_CODE 30
7991#define R_SH_DATA 31
7992#define R_SH_LABEL 32
7993#define R_SH_SWITCH8 33
7994#define R_SH_GNU_VTINHERIT 34
7995#define R_SH_GNU_VTENTRY 35
7996#define R_SH_TLS_GD_32 144
7997#define R_SH_TLS_LD_32 145
7998#define R_SH_TLS_LDO_32 146
7999#define R_SH_TLS_IE_32 147
8000#define R_SH_TLS_LE_32 148
8001#define R_SH_TLS_DTPMOD32 149
8002#define R_SH_TLS_DTPOFF32 150
8003#define R_SH_TLS_TPOFF32 151
8004#define R_SH_GOT32 160
8005#define R_SH_PLT32 161
8006#define R_SH_COPY 162
8007#define R_SH_GLOB_DAT 163
8008#define R_SH_JMP_SLOT 164
8009#define R_SH_RELATIVE 165
8010#define R_SH_GOTOFF 166
8011#define R_SH_GOTPC 167
8012#define R_SH_RELATIVE_LOW16 197
8013#define R_SH_RELATIVE_MEDLOW16 198
8014#define R_SH_IMM_LOW16 246
8015#define R_SH_IMM_LOW16_PCREL 247
8016#define R_SH_IMM_MEDLOW16 248
8017#define R_SH_IMM_MEDLOW16_PCREL 249
8018
8019
8020#define R_SH_NUM 256
8021
8022
8023
8024#define R_390_NONE 0
8025#define R_390_8 1
8026#define R_390_12 2
8027#define R_390_16 3
8028#define R_390_32 4
8029#define R_390_PC32 5
8030#define R_390_GOT12 6
8031#define R_390_GOT32 7
8032#define R_390_PLT32 8
8033#define R_390_COPY 9
8034#define R_390_GLOB_DAT 10
8035#define R_390_JMP_SLOT 11
8036#define R_390_RELATIVE 12
8037#define R_390_GOTOFF32 13
8038#define R_390_GOTPC 14
8039#define R_390_GOT16 15
8040#define R_390_PC16 16
8041#define R_390_PC16DBL 17
8042#define R_390_PLT16DBL 18
8043#define R_390_PC32DBL 19
8044#define R_390_PLT32DBL 20
8045#define R_390_GOTPCDBL 21
8046#define R_390_64 22
8047#define R_390_PC64 23
8048#define R_390_GOT64 24
8049#define R_390_PLT64 25
8050#define R_390_GOTENT 26
8051#define R_390_GOTOFF16 27
8052#define R_390_GOTOFF64 28
8053#define R_390_GOTPLT12 29
8054#define R_390_GOTPLT16 30
8055#define R_390_GOTPLT32 31
8056#define R_390_GOTPLT64 32
8057#define R_390_GOTPLTENT 33
8058#define R_390_PLTOFF16 34
8059#define R_390_PLTOFF32 35
8060#define R_390_PLTOFF64 36
8061#define R_390_TLS_LOAD 37
8062#define R_390_TLS_GDCALL 38
8063
8064#define R_390_TLS_LDCALL 39
8065
8066#define R_390_TLS_GD32 40
8067
8068#define R_390_TLS_GD64 41
8069
8070#define R_390_TLS_GOTIE12 42
8071
8072#define R_390_TLS_GOTIE32 43
8073
8074#define R_390_TLS_GOTIE64 44
8075
8076#define R_390_TLS_LDM32 45
8077
8078#define R_390_TLS_LDM64 46
8079
8080#define R_390_TLS_IE32 47
8081
8082#define R_390_TLS_IE64 48
8083
8084#define R_390_TLS_IEENT 49
8085
8086#define R_390_TLS_LE32 50
8087
8088#define R_390_TLS_LE64 51
8089
8090#define R_390_TLS_LDO32 52
8091
8092#define R_390_TLS_LDO64 53
8093
8094#define R_390_TLS_DTPMOD 54
8095#define R_390_TLS_DTPOFF 55
8096#define R_390_TLS_TPOFF 56
8097
8098#define R_390_20 57
8099#define R_390_GOT20 58
8100#define R_390_GOTPLT20 59
8101#define R_390_TLS_GOTIE20 60
8102
8103
8104#define R_390_NUM 61
8105
8106
8107
8108#define EF_CRIS_VARIANT_MASK 0x0000000e
8109#define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000
8110#define EF_CRIS_VARIANT_V32 0x00000002
8111#define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004
8112
8113
8114#define R_CRIS_NONE 0
8115#define R_CRIS_8 1
8116#define R_CRIS_16 2
8117#define R_CRIS_32 3
8118#define R_CRIS_8_PCREL 4
8119#define R_CRIS_16_PCREL 5
8120#define R_CRIS_32_PCREL 6
8121#define R_CRIS_GNU_VTINHERIT 7
8122#define R_CRIS_GNU_VTENTRY 8
8123#define R_CRIS_COPY 9
8124#define R_CRIS_GLOB_DAT 10
8125#define R_CRIS_JUMP_SLOT 11
8126#define R_CRIS_RELATIVE 12
8127#define R_CRIS_16_GOT 13
8128#define R_CRIS_32_GOT 14
8129#define R_CRIS_16_GOTPLT 15
8130#define R_CRIS_32_GOTPLT 16
8131#define R_CRIS_32_GOTREL 17
8132#define R_CRIS_32_PLT_GOTREL 18
8133#define R_CRIS_32_PLT_PCREL 19
8134
8135
8136#define R_CRIS_NUM 20
8137
8138
8139
8140#define R_X86_64_NONE 0
8141#define R_X86_64_64 1
8142#define R_X86_64_PC32 2
8143#define R_X86_64_GOT32 3
8144#define R_X86_64_PLT32 4
8145#define R_X86_64_COPY 5
8146#define R_X86_64_GLOB_DAT 6
8147#define R_X86_64_JUMP_SLOT 7
8148#define R_X86_64_RELATIVE 8
8149#define R_X86_64_GOTPCREL 9
8150
8151#define R_X86_64_32 10
8152#define R_X86_64_32S 11
8153#define R_X86_64_16 12
8154#define R_X86_64_PC16 13
8155#define R_X86_64_8 14
8156#define R_X86_64_PC8 15
8157#define R_X86_64_DTPMOD64 16
8158#define R_X86_64_DTPOFF64 17
8159#define R_X86_64_TPOFF64 18
8160#define R_X86_64_TLSGD 19
8161
8162#define R_X86_64_TLSLD 20
8163
8164#define R_X86_64_DTPOFF32 21
8165#define R_X86_64_GOTTPOFF 22
8166
8167#define R_X86_64_TPOFF32 23
8168
8169#define R_X86_64_NUM 24
8170
8171
8172
8173#define R_MN10300_NONE 0
8174#define R_MN10300_32 1
8175#define R_MN10300_16 2
8176#define R_MN10300_8 3
8177#define R_MN10300_PCREL32 4
8178#define R_MN10300_PCREL16 5
8179#define R_MN10300_PCREL8 6
8180#define R_MN10300_GNU_VTINHERIT 7
8181#define R_MN10300_GNU_VTENTRY 8
8182#define R_MN10300_24 9
8183#define R_MN10300_GOTPC32 10
8184#define R_MN10300_GOTPC16 11
8185#define R_MN10300_GOTOFF32 12
8186#define R_MN10300_GOTOFF24 13
8187#define R_MN10300_GOTOFF16 14
8188#define R_MN10300_PLT32 15
8189#define R_MN10300_PLT16 16
8190#define R_MN10300_GOT32 17
8191#define R_MN10300_GOT24 18
8192#define R_MN10300_GOT16 19
8193#define R_MN10300_COPY 20
8194#define R_MN10300_GLOB_DAT 21
8195#define R_MN10300_JMP_SLOT 22
8196#define R_MN10300_RELATIVE 23
8197
8198#define R_MN10300_NUM 24
8199
8200
8201
8202#define R_M32R_NONE 0
8203#define R_M32R_16 1
8204#define R_M32R_32 2
8205#define R_M32R_24 3
8206#define R_M32R_10_PCREL 4
8207#define R_M32R_18_PCREL 5
8208#define R_M32R_26_PCREL 6
8209#define R_M32R_HI16_ULO 7
8210#define R_M32R_HI16_SLO 8
8211#define R_M32R_LO16 9
8212#define R_M32R_SDA16 10
8213#define R_M32R_GNU_VTINHERIT 11
8214#define R_M32R_GNU_VTENTRY 12
8215
8216#define R_M32R_16_RELA 33
8217#define R_M32R_32_RELA 34
8218#define R_M32R_24_RELA 35
8219#define R_M32R_10_PCREL_RELA 36
8220#define R_M32R_18_PCREL_RELA 37
8221#define R_M32R_26_PCREL_RELA 38
8222#define R_M32R_HI16_ULO_RELA 39
8223#define R_M32R_HI16_SLO_RELA 40
8224#define R_M32R_LO16_RELA 41
8225#define R_M32R_SDA16_RELA 42
8226#define R_M32R_RELA_GNU_VTINHERIT 43
8227#define R_M32R_RELA_GNU_VTENTRY 44
8228
8229#define R_M32R_GOT24 48
8230#define R_M32R_26_PLTREL 49
8231#define R_M32R_COPY 50
8232#define R_M32R_GLOB_DAT 51
8233#define R_M32R_JMP_SLOT 52
8234#define R_M32R_RELATIVE 53
8235#define R_M32R_GOTOFF 54
8236#define R_M32R_GOTPC24 55
8237#define R_M32R_GOT16_HI_ULO 56
8238
8239#define R_M32R_GOT16_HI_SLO 57
8240
8241#define R_M32R_GOT16_LO 58
8242#define R_M32R_GOTPC_HI_ULO 59
8243
8244#define R_M32R_GOTPC_HI_SLO 60
8245
8246#define R_M32R_GOTPC_LO 61
8247
8248#define R_M32R_GOTOFF_HI_ULO 62
8249
8250#define R_M32R_GOTOFF_HI_SLO 63
8251
8252#define R_M32R_GOTOFF_LO 64
8253#define R_M32R_NUM 256
8254
8255
8256#define R_960_NONE 0
8257#define R_960_12 1
8258#define R_960_32 2
8259#define R_960_IP24 3
8260#define R_960_SUB 4
8261#define R_960_OPTCALL 5
8262#define R_960_OPTCALLX 6
8263#define R_960_OPTCALLXA 7
8264
8265#define R_960_NUM 8
8266
8267
8268
8269#define R_V850_NONE 0
8270#define R_V850_9_PCREL 1
8271#define R_V850_22_PCREL 2
8272#define R_V850_HI16_S 3
8273#define R_V850_HI16 4
8274#define R_V850_LO16 5
8275#define R_V850_32 6
8276#define R_V850_16 7
8277#define R_V850_8 8
8278#define R_V850_SDA_16_16_OFFSET 9
8279
8280#define R_V850_SDA_15_16_OFFSET 10
8281#define R_V850_ZDA_16_16_OFFSET 11
8282
8283#define R_V850_ZDA_15_16_OFFSET 12
8284#define R_V850_TDA_6_8_OFFSET 13
8285#define R_V850_TDA_7_8_OFFSET 14
8286#define R_V850_TDA_7_7_OFFSET 15
8287#define R_V850_TDA_16_16_OFFSET 16
8288
8289
8290#define R_V850_TDA_4_5_OFFSET 17
8291#define R_V850_TDA_4_4_OFFSET 18
8292#define R_V850_SDA_16_16_SPLIT_OFFSET 19
8293#define R_V850_ZDA_16_16_SPLIT_OFFSET 20
8294#define R_V850_CALLT_6_7_OFFSET 21
8295#define R_V850_CALLT_16_16_OFFSET 22
8296
8297#define R_V850_GNU_VTINHERIT 23
8298#define R_V850_GNU_VTENTRY 24
8299
8300#define R_V850_NUM 25
8301
8302
8303#define R_AVR32_NONE 0
8304#define R_AVR32_32 1
8305#define R_AVR32_16 2
8306#define R_AVR32_8 3
8307#define R_AVR32_32_PCREL 4
8308#define R_AVR32_16_PCREL 5
8309#define R_AVR32_8_PCREL 6
8310#define R_AVR32_DIFF32 7
8311#define R_AVR32_DIFF16 8
8312#define R_AVR32_DIFF8 9
8313#define R_AVR32_GOT32 10
8314#define R_AVR32_GOT16 11
8315#define R_AVR32_GOT8 12
8316#define R_AVR32_21S 13
8317#define R_AVR32_16U 14
8318#define R_AVR32_16S 15
8319#define R_AVR32_8S 16
8320#define R_AVR32_8S_EXT 17
8321#define R_AVR32_22H_PCREL 18
8322#define R_AVR32_18W_PCREL 19
8323#define R_AVR32_16B_PCREL 20
8324#define R_AVR32_16N_PCREL 21
8325#define R_AVR32_14UW_PCREL 22
8326#define R_AVR32_11H_PCREL 23
8327#define R_AVR32_10UW_PCREL 24
8328#define R_AVR32_9H_PCREL 25
8329#define R_AVR32_9UW_PCREL 26
8330#define R_AVR32_HI16 27
8331#define R_AVR32_LO16 28
8332#define R_AVR32_GOTPC 29
8333#define R_AVR32_GOTCALL 30
8334#define R_AVR32_LDA_GOT 31
8335#define R_AVR32_GOT21S 32
8336#define R_AVR32_GOT18SW 33
8337#define R_AVR32_GOT16S 34
8338#define R_AVR32_GOT7UW 35
8339#define R_AVR32_32_CPENT 36
8340#define R_AVR32_CPCALL 37
8341#define R_AVR32_16_CP 38
8342#define R_AVR32_9W_CP 39
8343#define R_AVR32_RELATIVE 40
8344#define R_AVR32_GLOB_DAT 41
8345#define R_AVR32_JMP_SLOT 42
8346#define R_AVR32_ALIGN 43
8347#define R_AVR32_NUM 44
8348
8349
8350#define DT_AVR32_GOTSZ 0x70000001
8351
8352
8353#define R_H8_NONE 0
8354#define R_H8_DIR32 1
8355#define R_H8_DIR32_28 2
8356#define R_H8_DIR32_24 3
8357#define R_H8_DIR32_16 4
8358#define R_H8_DIR32U 6
8359#define R_H8_DIR32U_28 7
8360#define R_H8_DIR32U_24 8
8361#define R_H8_DIR32U_20 9
8362#define R_H8_DIR32U_16 10
8363#define R_H8_DIR24 11
8364#define R_H8_DIR24_20 12
8365#define R_H8_DIR24_16 13
8366#define R_H8_DIR24U 14
8367#define R_H8_DIR24U_20 15
8368#define R_H8_DIR24U_16 16
8369#define R_H8_DIR16 17
8370#define R_H8_DIR16U 18
8371#define R_H8_DIR16S_32 19
8372#define R_H8_DIR16S_28 20
8373#define R_H8_DIR16S_24 21
8374#define R_H8_DIR16S_20 22
8375#define R_H8_DIR16S 23
8376#define R_H8_DIR8 24
8377#define R_H8_DIR8U 25
8378#define R_H8_DIR8Z_32 26
8379#define R_H8_DIR8Z_28 27
8380#define R_H8_DIR8Z_24 28
8381#define R_H8_DIR8Z_20 29
8382#define R_H8_DIR8Z_16 30
8383#define R_H8_PCREL16 31
8384#define R_H8_PCREL8 32
8385#define R_H8_BPOS 33
8386#define R_H8_PCREL32 34
8387#define R_H8_GOT32O 35
8388#define R_H8_GOT16O 36
8389#define R_H8_DIR16A8 59
8390#define R_H8_DIR16R8 60
8391#define R_H8_DIR24A8 61
8392#define R_H8_DIR24R8 62
8393#define R_H8_DIR32A16 63
8394#define R_H8_ABS32 65
8395#define R_H8_ABS32A16 127
8396#define R_H8_NUM 128
8397
8398
8399#define R_NIOS_NONE 0
8400#define R_NIOS_32 1
8401#define R_NIOS_LO16_LO5 2
8402#define R_NIOS_LO16_HI11 3
8403#define R_NIOS_HI16_LO5 4
8404#define R_NIOS_HI16_HI11 5
8405#define R_NIOS_PCREL6 6
8406#define R_NIOS_PCREL8 7
8407#define R_NIOS_PCREL11 8
8408#define R_NIOS_16 9
8409#define R_NIOS_H_LO5 10
8410#define R_NIOS_H_HI11 11
8411#define R_NIOS_H_XLO5 12
8412#define R_NIOS_H_XHI11 13
8413#define R_NIOS_H_16 14
8414#define R_NIOS_H_32 15
8415#define R_NIOS_GNU_VTINHERIT 200
8416#define R_NIOS_GNU_VTENTRY 201
8417
8418#define R_NIOS_NUM 202
8419
8420
8421#define R_NIOS2_NONE 0
8422#define R_NIOS2_S16 1
8423#define R_NIOS2_U16 2
8424#define R_NIOS2_PCREL16 3
8425#define R_NIOS2_CALL26 4
8426#define R_NIOS2_IMM5 5
8427#define R_NIOS2_CACHE_OPX 6
8428#define R_NIOS2_IMM6 7
8429#define R_NIOS2_IMM8 8
8430#define R_NIOS2_HI16 9
8431#define R_NIOS2_LO16 10
8432#define R_NIOS2_HIADJ16 11
8433#define R_NIOS2_BFD_RELOC_32 12
8434#define R_NIOS2_BFD_RELOC_16 13
8435#define R_NIOS2_BFD_RELOC_8 14
8436#define R_NIOS2_GPREL 15
8437#define R_NIOS2_GNU_VTINHERIT 16
8438#define R_NIOS2_GNU_VTENTRY 17
8439#define R_NIOS2_UJMP 18
8440#define R_NIOS2_CJMP 19
8441#define R_NIOS2_CALLR 20
8442#define R_NIOS2_ALIGN 21
8443
8444#define R_NIOS2_NUM 22
8445
8446
8447
8448
8449#define DT_XTENSA_GOT_LOC_OFF (DT_LOPROC + 0)
8450#define DT_XTENSA_GOT_LOC_SZ (DT_LOPROC + 1)
8451#define DT_XTENSA_NUM 2
8452
8453
8454#define R_XTENSA_NONE 0
8455#define R_XTENSA_32 1
8456#define R_XTENSA_RTLD 2
8457#define R_XTENSA_GLOB_DAT 3
8458#define R_XTENSA_JMP_SLOT 4
8459#define R_XTENSA_RELATIVE 5
8460#define R_XTENSA_PLT 6
8461#define R_XTENSA_OP0 8
8462#define R_XTENSA_OP1 9
8463#define R_XTENSA_OP2 10
8464#define R_XTENSA_ASM_EXPAND 11
8465#define R_XTENSA_ASM_SIMPLIFY 12
8466#define R_XTENSA_GNU_VTINHERIT 15
8467#define R_XTENSA_GNU_VTENTRY 16
8468#define R_XTENSA_DIFF8 17
8469#define R_XTENSA_DIFF16 18
8470#define R_XTENSA_DIFF32 19
8471#define R_XTENSA_SLOT0_OP 20
8472#define R_XTENSA_SLOT1_OP 21
8473#define R_XTENSA_SLOT2_OP 22
8474#define R_XTENSA_SLOT3_OP 23
8475#define R_XTENSA_SLOT4_OP 24
8476#define R_XTENSA_SLOT5_OP 25
8477#define R_XTENSA_SLOT6_OP 26
8478#define R_XTENSA_SLOT7_OP 27
8479#define R_XTENSA_SLOT8_OP 28
8480#define R_XTENSA_SLOT9_OP 29
8481#define R_XTENSA_SLOT10_OP 30
8482#define R_XTENSA_SLOT11_OP 31
8483#define R_XTENSA_SLOT12_OP 32
8484#define R_XTENSA_SLOT13_OP 33
8485#define R_XTENSA_SLOT14_OP 34
8486#define R_XTENSA_SLOT0_ALT 35
8487#define R_XTENSA_SLOT1_ALT 36
8488#define R_XTENSA_SLOT2_ALT 37
8489#define R_XTENSA_SLOT3_ALT 38
8490#define R_XTENSA_SLOT4_ALT 39
8491#define R_XTENSA_SLOT5_ALT 40
8492#define R_XTENSA_SLOT6_ALT 41
8493#define R_XTENSA_SLOT7_ALT 42
8494#define R_XTENSA_SLOT8_ALT 43
8495#define R_XTENSA_SLOT9_ALT 44
8496#define R_XTENSA_SLOT10_ALT 45
8497#define R_XTENSA_SLOT11_ALT 46
8498#define R_XTENSA_SLOT12_ALT 47
8499#define R_XTENSA_SLOT13_ALT 48
8500#define R_XTENSA_SLOT14_ALT 49
8501
8502#define R_XTENSA_NUM 50
8503
8504
8505#define R_C6000_NONE 0
8506#define R_C6000_ABS32 1
8507#define R_C6000_ABS16 2
8508#define R_C6000_ABS8 3
8509#define R_C6000_PCR_S21 4
8510#define R_C6000_PCR_S12 5
8511#define R_C6000_PCR_S10 6
8512#define R_C6000_PCR_S7 7
8513#define R_C6000_ABS_S16 8
8514#define R_C6000_ABS_L16 9
8515#define R_C6000_ABS_H16 10
8516#define R_C6000_SBR_U15_B 11
8517#define R_C6000_SBR_U15_H 12
8518#define R_C6000_SBR_U15_W 13
8519#define R_C6000_SBR_S16 14
8520#define R_C6000_SBR_L16_B 15
8521#define R_C6000_SBR_L16_H 16
8522#define R_C6000_SBR_L16_W 17
8523#define R_C6000_SBR_H16_B 18
8524#define R_C6000_SBR_H16_H 19
8525#define R_C6000_SBR_H16_W 20
8526#define R_C6000_SBR_GOT_U15_W 21
8527#define R_C6000_SBR_GOT_L16_W 22
8528#define R_C6000_SBR_GOT_H16_W 23
8529#define R_C6000_DSBT_INDEX 24
8530#define R_C6000_PREL31 25
8531#define R_C6000_COPY 26
8532#define R_C6000_JUMP_SLOT 27
8533#define R_C6000_SBR_GOT32 28
8534#define R_C6000_PCR_H16 29
8535#define R_C6000_PCR_L16 30
8536#define R_C6000_ALIGN 253
8537#define R_C6000_FPHEAD 254
8538#define R_C6000_NOCMP 255
8539
8540
8541#define DT_C6000_DSBT_BASE (DT_LOPROC + 0)
8542#define DT_C6000_DSBT_SIZE (DT_LOPROC + 1)
8543#define DT_C6000_PREEMPTMAP (DT_LOPROC + 2)
8544#define DT_C6000_DSBT_INDEX (DT_LOPROC + 3)
8545
8546#define DT_C6000_NUM 4
8547
8548
8549#define R_MICROBLAZE_NONE 0
8550#define R_MICROBLAZE_32 1
8551#define R_MICROBLAZE_32_PCREL 2
8552#define R_MICROBLAZE_64_PCREL 3
8553#define R_MICROBLAZE_32_PCREL_LO 4
8554#define R_MICROBLAZE_64 5
8555#define R_MICROBLAZE_32_LO 6
8556#define R_MICROBLAZE_SRO32 7
8557#define R_MICROBLAZE_SRW32 8
8558#define R_MICROBLAZE_64_NONE 9
8559#define R_MICROBLAZE_32_SYM_OP_SYM 10
8560#define R_MICROBLAZE_GNU_VTINHERIT 11
8561#define R_MICROBLAZE_GNU_VTENTRY 12
8562#define R_MICROBLAZE_GOTPC_64 13
8563#define R_MICROBLAZE_GOT_64 14
8564#define R_MICROBLAZE_PLT_64 15
8565#define R_MICROBLAZE_REL 16
8566#define R_MICROBLAZE_JUMP_SLOT 17
8567#define R_MICROBLAZE_GLOB_DAT 18
8568#define R_MICROBLAZE_GOTOFF_64 19
8569#define R_MICROBLAZE_GOTOFF_32 20
8570#define R_MICROBLAZE_COPY 21
8571#define R_MICROBLAZE_NUM 22
8572# 26 "./include/link.h" 2
8573
8574# 1 "./include/dlfcn.h" 1
8575# 22 "./include/dlfcn.h"
8576#define _DLFCN_H 1
8577
8578
8579#define __need_size_t
8580# 1 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 1 3 4
8581# 160 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
8582#undef __need_ptrdiff_t
8583# 233 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
8584#undef __need_size_t
8585# 342 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
8586#undef __need_wchar_t
8587# 395 "/usr/local/src/blackfin/toolchains/20120406/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.5.3/include/stddef.h" 3 4
8588#undef NULL
8589
8590
8591
8592
8593#define NULL ((void *)0)
8594
8595
8596
8597
8598
8599#undef __need_NULL
8600
8601
8602
8603
8604#define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
8605# 27 "./include/dlfcn.h" 2
8606
8607
8608# 1 "./include/bits/dlfcn.h" 1
8609# 25 "./include/bits/dlfcn.h"
8610#define RTLD_LAZY 0x00001
8611#define RTLD_NOW 0x00002
8612#define RTLD_BINDING_MASK 0x3
8613#define RTLD_NOLOAD 0x00004
8614
8615
8616
8617
8618
8619
8620
8621#define RTLD_GLOBAL 0x00100
8622
8623
8624
8625
8626#define RTLD_LOCAL 0
8627
8628
8629#define RTLD_NODELETE 0x01000
8630# 30 "./include/dlfcn.h" 2
8631
8632
8633
8634
8635
8636
8637
8638#define RTLD_NEXT ((void *) -1l)
8639
8640
8641
8642
8643#define RTLD_DEFAULT ((void *) 0)
8644# 55 "./include/dlfcn.h"
8645
8646
8647
8648
8649extern void *dlopen (__const char *__file, int __mode) __attribute__ ((__nothrow__));
8650
8651
8652
8653extern int dlclose (void *__handle) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
8654
8655
8656
8657extern void *dlsym (void *__restrict __handle,
8658 __const char *__restrict __name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
8659# 85 "./include/dlfcn.h"
8660extern char *dlerror (void) __attribute__ ((__nothrow__));
8661
8662
8663
8664
8665
8666typedef struct
8667{
8668 __const char *dli_fname;
8669 void *dli_fbase;
8670 __const char *dli_sname;
8671 void *dli_saddr;
8672} Dl_info;
8673
8674
8675
8676extern int dladdr (__const void *__address, Dl_info *__info)
8677 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
8678# 193 "./include/dlfcn.h"
8679extern int dlinfo (void);
8680
8681
8682
8683
8684
8685
8686# 28 "./include/link.h" 2
8687# 36 "./include/link.h"
8688#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
8689#define _ElfW(e,w,t) _ElfW_1 (e, w, _ ##t)
8690#define _ElfW_1(e,w,t) e ##w ##t
8691
8692# 1 "./include/bits/elfclass.h" 1
8693# 9 "./include/bits/elfclass.h"
8694# 1 "./include/bits/wordsize.h" 1
8695# 19 "./include/bits/wordsize.h"
8696#define __WORDSIZE 32
8697# 10 "./include/bits/elfclass.h" 2
8698
8699#define __ELF_NATIVE_CLASS __WORDSIZE
8700
8701
8702typedef uint32_t Elf_Symndx;
8703# 41 "./include/link.h" 2
8704
8705
8706
8707
8708
8709
8710struct r_debug
8711 {
8712 int r_version;
8713
8714 struct link_map *r_map;
8715
8716
8717
8718
8719
8720
8721 Elf32_Addr r_brk;
8722 enum
8723 {
8724
8725
8726 RT_CONSISTENT,
8727 RT_ADD,
8728 RT_DELETE
8729 } r_state;
8730
8731 Elf32_Addr r_ldbase;
8732 };
8733
8734
8735extern struct r_debug _r_debug;
8736# 81 "./include/link.h"
8737extern Elf32_Dyn _DYNAMIC[];
8738
8739
8740# 1 "./include/bits/elf-fdpic.h" 1
8741# 29 "./include/bits/elf-fdpic.h"
8742#define _BITS_ELF_FDPIC_H
8743# 41 "./include/bits/elf-fdpic.h"
8744struct elf32_fdpic_loadseg
8745{
8746
8747 Elf32_Addr addr;
8748
8749 Elf32_Addr p_vaddr;
8750
8751 Elf32_Word p_memsz;
8752};
8753
8754struct elf32_fdpic_loadmap {
8755
8756 Elf32_Half version;
8757
8758 Elf32_Half nsegs;
8759
8760 struct elf32_fdpic_loadseg segs[ ];
8761};
8762
8763struct elf32_fdpic_loadaddr {
8764 struct elf32_fdpic_loadmap *map;
8765 void *got_value;
8766};
8767
8768
8769
8770static __inline __attribute__ ((__always_inline__)) void *
8771__reloc_pointer (void *p,
8772 const struct elf32_fdpic_loadmap *map)
8773{
8774 int c;
8775# 85 "./include/bits/elf-fdpic.h"
8776 for (c = 0;
8777
8778
8779
8780 c < map->nsegs && p >= (void*)map->segs[c].p_vaddr;
8781 c++)
8782 {
8783
8784
8785
8786 unsigned long offset = p - (void*)map->segs[c].p_vaddr;
8787
8788
8789
8790
8791
8792
8793 if (offset < map->segs[c].p_memsz
8794 || (offset == map->segs[c].p_memsz && c + 1 == map->nsegs))
8795 return (char*)map->segs[c].addr + offset;
8796 }
8797
8798
8799 return (void*)-1;
8800}
8801
8802#define __RELOC_POINTER(ptr,loadaddr) (__reloc_pointer ((void*)(ptr), (loadaddr).map))
8803# 85 "./include/link.h" 2
8804# 96 "./include/link.h"
8805struct link_map
8806 {
8807
8808
8809
8810
8811 struct elf32_fdpic_loadaddr l_addr;
8812
8813
8814
8815
8816
8817
8818
8819 char *l_name;
8820 Elf32_Dyn *l_ld;
8821 struct link_map *l_next, *l_prev;
8822# 137 "./include/link.h"
8823 };
8824# 183 "./include/link.h"
8825struct dl_phdr_info
8826 {
8827
8828 struct elf32_fdpic_loadaddr dlpi_addr;
8829
8830
8831
8832
8833
8834
8835
8836 const char *dlpi_name;
8837 const Elf32_Phdr *dlpi_phdr;
8838 Elf32_Half dlpi_phnum;
8839# 218 "./include/link.h"
8840 };
8841
8842
8843
8844extern int dl_iterate_phdr (int (*__callback) (struct dl_phdr_info *,
8845 size_t, void *),
8846 void *__data);
8847# 247 "./include/link.h"
8848
8849# 132 "./ldso/ldso/bfin/../fdpic/dl-sysdep.h" 2
8850# 83 "./ldso/ldso/bfin/dl-sysdep.h" 2
8851
8852static __inline __attribute__ ((__always_inline__)) Elf32_Addr
8853elf_machine_load_address (void)
8854{
8855
8856 return 0;
8857}
8858
8859static __inline __attribute__ ((__always_inline__)) void
8860elf_machine_relative (struct elf32_fdpic_loadaddr load_off, const Elf32_Addr rel_addr,
8861 Elf32_Word relative_count)
8862{
8863# 104 "./ldso/ldso/bfin/dl-sysdep.h"
8864}
8865# 12 "./ldso/include/dl-string.h" 2
8866
8867
8868
8869
8870#define do_rem(result,n,base) ((result) = (n) % (base))
8871
8872
8873#define do_div_10(result,remain) ((result) /= 10)
8874
8875
8876static size_t _dl_strlen(const char *str);
8877static char *_dl_strcat(char *dst, const char *src);
8878static char *_dl_strcpy(char *dst, const char *src);
8879static int _dl_strcmp(const char *s1, const char *s2);
8880static int _dl_strncmp(const char *s1, const char *s2, size_t len);
8881static char *_dl_strchr(const char *str, int c);
8882static char *_dl_strrchr(const char *str, int c);
8883static char *_dl_strstr(const char *s1, const char *s2);
8884static void *_dl_memcpy(void *dst, const void *src, size_t len);
8885static int _dl_memcmp(const void *s1, const void *s2, size_t len);
8886static void *_dl_memset(void *str, int c, size_t len);
8887static char *_dl_get_last_path_component(char *path);
8888static char *_dl_simple_ltoa(char *local, unsigned long i);
8889static char *_dl_simple_ltoahex(char *local, unsigned long i);
8890
8891
8892
8893
8894
8895static __inline __attribute__ ((__always_inline__)) size_t _dl_strlen(const char *str)
8896{
8897 register const char *ptr = (char *) str-1;
8898 while (*++ptr)
8899 ;
8900 return (ptr - str);
8901}
8902
8903static __inline __attribute__ ((__always_inline__)) char * _dl_strcat(char *dst, const char *src)
8904{
8905 register char *ptr = dst-1;
8906
8907 src--;
8908 while (*++ptr)
8909 ;
8910 ptr--;
8911 while ((*++ptr = *++src) != 0)
8912 ;
8913 return dst;
8914}
8915
8916static __inline __attribute__ ((__always_inline__)) char * _dl_strcpy(char *dst, const char *src)
8917{
8918 register char *ptr = dst;
8919
8920 dst--;src--;
8921 while ((*++dst = *++src) != 0)
8922 ;
8923
8924 return ptr;
8925}
8926
8927static __inline __attribute__ ((__always_inline__)) int _dl_strcmp(const char *s1, const char *s2)
8928{
8929 register unsigned char c1, c2;
8930 s1--;s2--;
8931 do {
8932 c1 = (unsigned char) *++s1;
8933 c2 = (unsigned char) *++s2;
8934 if (c1 == '\0')
8935 return c1 - c2;
8936 } while (c1 == c2);
8937
8938 return c1 - c2;
8939}
8940
8941static __inline __attribute__ ((__always_inline__)) int _dl_strncmp(const char *s1, const char *s2, size_t len)
8942{
8943 register unsigned char c1 = '\0';
8944 register unsigned char c2 = '\0';
8945
8946 s1--;s2--;
8947 while (len > 0) {
8948 c1 = (unsigned char) *++s1;
8949 c2 = (unsigned char) *++s2;
8950 if (c1 == '\0' || c1 != c2)
8951 return c1 - c2;
8952 len--;
8953 }
8954 return c1 - c2;
8955}
8956
8957static __inline __attribute__ ((__always_inline__)) char * _dl_strchr(const char *str, int c)
8958{
8959 register char ch;
8960 str--;
8961 do {
8962 if ((ch = *++str) == c)
8963 return (char *) str;
8964 }
8965 while (ch);
8966
8967 return 0;
8968}
8969
8970static __inline __attribute__ ((__always_inline__)) char * _dl_strrchr(const char *str, int c)
8971{
8972 register char *prev = 0;
8973 register char *ptr = (char *) str-1;
8974
8975 while (*++ptr != '\0') {
8976 if (*ptr == c)
8977 prev = ptr;
8978 }
8979 if (c == '\0')
8980 return(ptr);
8981 return(prev);
8982}
8983
8984static __inline __attribute__ ((__always_inline__)) char * _dl_strstr(const char *s1, const char *s2)
8985{
8986 register const char *s = s1;
8987 register const char *p = s2;
8988
8989 do {
8990 if (!*p)
8991 return (char *) s1;;
8992 if (*p == *s) {
8993 ++p;
8994 ++s;
8995 } else {
8996 p = s2;
8997 if (!*s)
8998 return ((void *)0);
8999 s = ++s1;
9000 }
9001 } while (1);
9002}
9003
9004static __inline __attribute__ ((__always_inline__)) void * _dl_memcpy(void *dst, const void *src, size_t len)
9005{
9006 register char *a = dst-1;
9007 register const char *b = src-1;
9008
9009 while (len) {
9010 *++a = *++b;
9011 --len;
9012 }
9013 return dst;
9014}
9015
9016static __inline __attribute__ ((__always_inline__)) int _dl_memcmp(const void *s1, const void *s2, size_t len)
9017{
9018 unsigned char *c1 = (unsigned char *)s1-1;
9019 unsigned char *c2 = (unsigned char *)s2-1;
9020
9021 while (len) {
9022 if (*++c1 != *++c2)
9023 return *c1 - *c2;
9024 len--;
9025 }
9026 return 0;
9027}
9028# 203 "./ldso/include/dl-string.h"
9029static __inline __attribute__ ((__always_inline__)) void * _dl_memset(void *str, int c, size_t len)
9030{
9031 register char *a = str;
9032
9033 while (len--)
9034 *a++ = c;
9035
9036 return str;
9037}
9038
9039
9040static __inline __attribute__ ((__always_inline__)) char * _dl_get_last_path_component(char *path)
9041{
9042 register char *ptr = path-1;
9043
9044 while (*++ptr)
9045 ;
9046
9047
9048 while (ptr != path && *--ptr == '/') {
9049 *ptr = '\0';
9050 }
9051
9052
9053 while (ptr != path && *--ptr != '/')
9054 ;
9055 return ptr == path ? ptr : ptr+1;
9056}
9057
9058
9059
9060
9061static __inline __attribute__ ((__always_inline__)) char * _dl_simple_ltoa(char *local, unsigned long i)
9062{
9063
9064
9065 char *p = &local[22];
9066 *--p = '\0';
9067 do {
9068 char temp;
9069 ((temp) = (i) % (10));
9070 *--p = '0' + temp;
9071 ((i) /= 10);
9072 } while (i > 0);
9073 return p;
9074}
9075
9076static __inline __attribute__ ((__always_inline__)) char * _dl_simple_ltoahex(char *local, unsigned long i)
9077{
9078
9079
9080 char *p = &local[22];
9081 *--p = '\0';
9082 do {
9083 char temp = i & 0xf;
9084 if (temp <= 0x09)
9085 *--p = '0' + temp;
9086 else
9087 *--p = 'a' - 0x0a + temp;
9088 i >>= 4;
9089 } while (i > 0);
9090 *--p = 'x';
9091 *--p = '0';
9092 return p;
9093}
9094# 294 "./ldso/include/dl-string.h"
9095#define CONSTANT_STRING_GOT_FIXUP(X)
9096
9097
9098#define SEND_STDERR(X) { const char *tmp1 = (X); CONSTANT_STRING_GOT_FIXUP(tmp1); _dl_write(2, tmp1, _dl_strlen(tmp1)); }
9099
9100
9101
9102
9103
9104
9105#define SEND_ADDRESS_STDERR(ADR,add_a_newline) { char tmp[26], v, *tmp2, *tmp1 = tmp; unsigned long X = (unsigned long)(ADR); CONSTANT_STRING_GOT_FIXUP(tmp1); tmp2 = tmp1 + sizeof(tmp); *--tmp2 = '\0'; if (add_a_newline) *--tmp2 = '\n'; do { v = (X) & 0xf; if (v <= 0x09) *--tmp2 = '0' + v; else *--tmp2 = 'a' - 0x0a + v; (X) >>= 4; } while ((X) > 0); *--tmp2 = 'x'; *--tmp2 = '0'; _dl_write(2, tmp2, tmp1 - tmp2 + sizeof(tmp) - 1); }
9106# 325 "./ldso/include/dl-string.h"
9107#define SEND_NUMBER_STDERR(NUM,add_a_newline) { char tmp[26], v, *tmp2, *tmp1 = tmp; unsigned long X = (unsigned long)(NUM); CONSTANT_STRING_GOT_FIXUP(tmp1); tmp2 = tmp1 + sizeof(tmp); *--tmp2 = '\0'; if (add_a_newline) *--tmp2 = '\n'; do { do_rem(v, (X), 10); *--tmp2 = '0' + v; do_div_10((X), v); } while ((X) > 0); _dl_write(2, tmp2, tmp1 - tmp2 + sizeof(tmp) - 1); }
9108# 350 "./ldso/include/dl-string.h"
9109#define EARLY_STDERR_SPECIAL
9110# 359 "./ldso/include/dl-string.h"
9111#define SEND_STDERR_DEBUG(X)
9112#define SEND_EARLY_STDERR_DEBUG(X)
9113#define SEND_NUMBER_STDERR_DEBUG(X,add_a_newline)
9114#define SEND_ADDRESS_STDERR_DEBUG(X,add_a_newline)
9115# 45 "./ldso/include/ldso.h" 2
9116
9117
9118# 1 "./ldso/include/dl-elf.h" 1
9119# 9 "./ldso/include/dl-elf.h"
9120#define LINUXELF_H
9121
9122
9123
9124
9125
9126
9127struct dyn_elf;
9128struct elf_resolve;
9129struct r_scope_elem;
9130
9131# 1 "./ldso/include/dl-defs.h" 1
9132# 9 "./ldso/include/dl-defs.h"
9133#define _LD_DEFS_H
9134
9135#define FLAG_ANY -1
9136#define FLAG_TYPE_MASK 0x00ff
9137#define FLAG_LIBC4 0x0000
9138#define FLAG_ELF 0x0001
9139#define FLAG_ELF_LIBC5 0x0002
9140#define FLAG_ELF_LIBC6 0x0003
9141#define FLAG_ELF_UCLIBC 0x0004
9142#define FLAG_REQUIRED_MASK 0xff00
9143#define FLAG_SPARC_LIB64 0x0100
9144#define FLAG_IA64_LIB64 0x0200
9145#define FLAG_X8664_LIB64 0x0300
9146#define FLAG_S390_LIB64 0x0400
9147#define FLAG_POWERPC_LIB64 0x0500
9148#define FLAG_MIPS64_LIBN32 0x0600
9149#define FLAG_MIPS64_LIBN64 0x0700
9150
9151#define LIB_ANY -1
9152#define LIB_DLL 0
9153#define LIB_ELF 1
9154#define LIB_ELF64 0x80
9155#define LIB_ELF_LIBC5 2
9156#define LIB_ELF_LIBC6 3
9157#define LIB_ELF_LIBC0 4
9158
9159
9160
9161
9162
9163#define LDSO_BASE_PATH UCLIBC_RUNTIME_PREFIX "etc/" __LDSO_BASE_FILENAME__
9164
9165
9166
9167
9168
9169
9170#define LDSO_CONF LDSO_BASE_PATH ".conf"
9171#define LDSO_CACHE LDSO_BASE_PATH ".cache"
9172
9173#define LDSO_CACHE_MAGIC "ld.so-"
9174#define LDSO_CACHE_MAGIC_LEN (sizeof LDSO_CACHE_MAGIC -1)
9175#define LDSO_CACHE_VER "1.7.0"
9176#define LDSO_CACHE_VER_LEN (sizeof LDSO_CACHE_VER -1)
9177
9178typedef struct {
9179 char magic [(sizeof "ld.so-" -1)];
9180 char version [(sizeof "1.7.0" -1)];
9181 int nlibs;
9182} header_t;
9183
9184typedef struct {
9185 int flags;
9186 int sooffset;
9187 int liboffset;
9188} libentry_t;
9189
9190
9191
9192
9193#define LDSO_CACHE_MMAP_FLAGS (MAP_PRIVATE)
9194# 78 "./ldso/include/dl-defs.h"
9195#define DL_START(X) static void * __attribute_used__ _dl_start(X)
9196# 183 "./ldso/include/dl-defs.h"
9197#define DL_ADDR_SYM_MATCH(SYM_ADDR,SYM,MATCHSYM,ADDR) ((ADDR) >= (SYM_ADDR) && ((((SYM)->st_shndx == SHN_UNDEF || (SYM)->st_size == 0) && (ADDR) == (SYM_ADDR)) || (ADDR) < (SYM_ADDR) + (SYM)->st_size) && (!(MATCHSYM) || MATCHSYM < (SYM_ADDR)))
9198# 210 "./ldso/include/dl-defs.h"
9199#define DL_MALLOC_ALIGN (__WORDSIZE / 8)
9200
9201
9202
9203#define __C_SYMBOL_PREFIX__ "_"
9204# 21 "./ldso/include/dl-elf.h" 2
9205
9206extern int _dl_map_cache(void);
9207extern int _dl_unmap_cache(void);
9208
9209
9210
9211
9212
9213#define DL_RESOLVE_SECURE 0x0001
9214#define DL_RESOLVE_NOLOAD 0x0002
9215
9216
9217extern void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
9218 unsigned long rel_addr, unsigned long rel_size);
9219extern int _dl_parse_relocation_information(struct dyn_elf *rpnt,
9220 struct r_scope_elem *scope, unsigned long rel_addr, unsigned long rel_size);
9221extern struct elf_resolve * _dl_load_shared_library(unsigned rflags,
9222 struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname,
9223 int trace_loaded_objects);
9224extern struct elf_resolve * _dl_load_elf_shared_library(unsigned rflags,
9225 struct dyn_elf **rpnt, const char *libname);
9226extern struct elf_resolve *_dl_check_if_named_library_is_loaded(const char *full_libname,
9227 int trace_loaded_objects);
9228extern int _dl_linux_resolve(void);
9229extern int _dl_fixup(struct dyn_elf *rpnt, struct r_scope_elem *scope, int flag);
9230extern void _dl_protect_relro (struct elf_resolve *l);
9231# 61 "./ldso/include/dl-elf.h"
9232#define ELF_ST_BIND(val) ELF32_ST_BIND(val)
9233#define ELF_ST_TYPE(val) ELF32_ST_TYPE(val)
9234#define ELF_R_SYM(i) ELF32_R_SYM(i)
9235#define ELF_R_TYPE(i) ELF32_R_TYPE(i)
9236
9237#define ELF_CLASS ELFCLASS32
9238# 81 "./ldso/include/dl-elf.h"
9239#define ELF_RELOC ElfW(Rel)
9240#define DT_RELOC_TABLE_ADDR DT_REL
9241#define DT_RELOC_TABLE_SIZE DT_RELSZ
9242#define DT_RELOCCOUNT DT_RELCOUNT
9243#define UNSUPPORTED_RELOC_TYPE DT_RELA
9244#define UNSUPPORTED_RELOC_STR "RELA"
9245
9246
9247
9248
9249#define OS_NUM_BASE 1
9250
9251
9252
9253
9254#define OS_NUM_GNU_HASH 0
9255
9256
9257
9258
9259
9260#define OS_NUM_PRELINK 0
9261
9262
9263#define OS_NUM (OS_NUM_BASE + OS_NUM_GNU_HASH + OS_NUM_PRELINK)
9264
9265
9266
9267#define ARCH_NUM 0
9268
9269
9270#define DYNAMIC_SIZE (DT_NUM + OS_NUM + ARCH_NUM)
9271
9272#define DT_RELCONT_IDX (DYNAMIC_SIZE - OS_NUM - ARCH_NUM)
9273
9274
9275
9276
9277
9278#define DT_GNU_HASH_IDX DT_RELCONT_IDX
9279# 133 "./ldso/include/dl-elf.h"
9280extern unsigned int _dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[],
9281 void *debug_addr, struct elf32_fdpic_loadaddr load_off);
9282
9283static __inline __attribute__ ((__always_inline__))
9284unsigned int __dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[],
9285 void *debug_addr, struct elf32_fdpic_loadaddr load_off)
9286{
9287 unsigned int rtld_flags = 0;
9288
9289 for (; dpnt->d_tag; dpnt++) {
9290 if (dpnt->d_tag < 34) {
9291 dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
9292
9293
9294
9295
9296
9297 if (dpnt->d_tag == 21)
9298 dpnt->d_un.d_val = (unsigned long)debug_addr;
9299
9300 if (dpnt->d_tag == 24)
9301 dynamic_info[24] = 1;
9302 if (dpnt->d_tag == 30 &&
9303 (dpnt->d_un.d_val & 0x00000008))
9304 dynamic_info[24] = 1;
9305 if (dpnt->d_tag == 22)
9306 dynamic_info[22] = 1;
9307
9308 if (dpnt->d_tag == 29)
9309 dynamic_info[15] = 0;
9310 if (dpnt->d_tag == 15 && dynamic_info[29])
9311 dynamic_info[15] = 0;
9312
9313 } else if (dpnt->d_tag < 0x70000000) {
9314 if (dpnt->d_tag == 0x6ffffffa)
9315 dynamic_info[((34 + (1 + 0 + 0) + 0) - (1 + 0 + 0) - 0)] = dpnt->d_un.d_val;
9316 if (dpnt->d_tag == 0x6ffffffb) {
9317 if (dpnt->d_un.d_val & 0x00000001)
9318 dynamic_info[24] = 1;
9319 if (dpnt->d_un.d_val & 0x00000008)
9320 rtld_flags |= 0x01000;
9321 }
9322# 193 "./ldso/include/dl-elf.h"
9323 }
9324
9325
9326
9327
9328
9329 }
9330#define ADJUST_DYN_INFO(tag,load_off) do { if (dynamic_info[tag]) dynamic_info[tag] = (unsigned long) DL_RELOC_ADDR(load_off, dynamic_info[tag]); } while (0)
9331# 211 "./ldso/include/dl-elf.h"
9332 {
9333 do { if (dynamic_info[4]) dynamic_info[4] = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_info[4]), (load_off).map)); } while (0);
9334 do { if (dynamic_info[3]) dynamic_info[3] = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_info[3]), (load_off).map)); } while (0);
9335 do { if (dynamic_info[5]) dynamic_info[5] = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_info[5]), (load_off).map)); } while (0);
9336 do { if (dynamic_info[6]) dynamic_info[6] = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_info[6]), (load_off).map)); } while (0);
9337 do { if (dynamic_info[17]) dynamic_info[17] = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_info[17]), (load_off).map)); } while (0);
9338 do { if (dynamic_info[23]) dynamic_info[23] = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_info[23]), (load_off).map)); } while (0);
9339
9340
9341
9342 }
9343# 231 "./ldso/include/dl-elf.h"
9344#undef ADJUST_DYN_INFO
9345 return rtld_flags;
9346}
9347# 243 "./ldso/include/dl-elf.h"
9348#define ELF_RTYPE_CLASS_COPY (0x0)
9349
9350
9351
9352#define ELF_RTYPE_CLASS_PLT (0x1)
9353
9354
9355
9356
9357#define ELF_RTYPE_CLASS_DLSYM 0x80000000
9358
9359
9360
9361
9362#define LXFLAGS(X) ( (((X) & PF_R) ? PROT_READ : 0) | (((X) & PF_W) ? PROT_WRITE : 0) | (((X) & PF_X) ? PROT_EXEC : 0))
9363# 48 "./ldso/include/ldso.h" 2
9364
9365
9366
9367
9368# 1 "./ldso/include/dl-hash.h" 1
9369# 9 "./ldso/include/dl-hash.h"
9370#define _LD_HASH_H_
9371
9372
9373
9374
9375
9376struct init_fini {
9377 struct elf_resolve **init_fini;
9378 unsigned long nlist;
9379};
9380
9381struct dyn_elf {
9382 struct elf_resolve * dyn;
9383 struct dyn_elf * next_handle;
9384 struct init_fini init_fini;
9385 struct dyn_elf * next;
9386 struct dyn_elf * prev;
9387};
9388
9389struct symbol_ref {
9390 const Elf32_Sym *sym;
9391 struct elf_resolve *tpnt;
9392};
9393
9394
9395
9396struct r_scope_elem {
9397 struct elf_resolve **r_list;
9398 unsigned int r_nlist;
9399 struct r_scope_elem *next;
9400};
9401
9402struct elf_resolve {
9403
9404
9405 struct elf32_fdpic_loadaddr loadaddr;
9406 char *libname;
9407 Elf32_Dyn *dynamic_addr;
9408 struct elf_resolve * next;
9409 struct elf_resolve * prev;
9410# 75 "./ldso/include/dl-hash.h"
9411 Elf32_Addr mapaddr;
9412
9413
9414
9415
9416 enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
9417
9418 struct r_scope_elem symbol_scope;
9419 unsigned short usage_count;
9420 unsigned short int init_flag;
9421 unsigned long rtld_flags;
9422 Elf_Symndx nbucket;
9423# 100 "./ldso/include/dl-hash.h"
9424 Elf_Symndx *elf_buckets;
9425
9426
9427 struct init_fini_list *init_fini;
9428 struct init_fini_list *rtld_local;
9429
9430
9431
9432 Elf_Symndx nchain;
9433# 117 "./ldso/include/dl-hash.h"
9434 Elf_Symndx *chains;
9435
9436 unsigned long dynamic_info[(34 + (1 + 0 + 0) + 0)];
9437
9438 unsigned long n_phent;
9439 Elf32_Phdr * ppnt;
9440
9441 Elf32_Addr relro_addr;
9442 size_t relro_size;
9443
9444 dev_t st_dev;
9445 ino_t st_ino;
9446# 140 "./ldso/include/dl-hash.h"
9447 struct funcdesc_ht *funcdesc_ht;
9448
9449};
9450
9451#define RELOCS_DONE 0x000001
9452#define JMP_RELOCS_DONE 0x000002
9453#define INIT_FUNCS_CALLED 0x000004
9454#define FINI_FUNCS_CALLED 0x000008
9455#define DL_OPENED 0x000010
9456#define DL_RESERVED 0x000020
9457
9458extern struct dyn_elf * _dl_symbol_tables;
9459extern struct elf_resolve * _dl_loaded_modules;
9460extern struct dyn_elf * _dl_handles;
9461
9462extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
9463 struct elf32_fdpic_loadaddr loadaddr, unsigned long * dynamic_info,
9464 unsigned long dynamic_addr, unsigned long dynamic_size);
9465
9466extern char *_dl_find_hash(const char *name, struct r_scope_elem *scope,
9467 struct elf_resolve *mytpnt, int type_class,
9468 struct symbol_ref *symbol);
9469
9470extern int _dl_linux_dynamic_link(void);
9471
9472extern char * _dl_library_path;
9473extern char * _dl_not_lazy;
9474
9475static __inline__ int _dl_symbol(char * name)
9476{
9477 if (name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_')
9478 return 0;
9479 return 1;
9480}
9481
9482#define LD_ERROR_NOFILE 1
9483#define LD_ERROR_NOZERO 2
9484#define LD_ERROR_NOTELF 3
9485#define LD_ERROR_NOTMAGIC 4
9486#define LD_ERROR_NOTDYN 5
9487#define LD_ERROR_MMAP_FAILED 6
9488#define LD_ERROR_NODYNAMIC 7
9489#define LD_ERROR_TLS_FAILED 8
9490#define LD_WRONG_RELOCS 9
9491#define LD_BAD_HANDLE 10
9492#define LD_NO_SYMBOL 11
9493# 53 "./ldso/include/ldso.h" 2
9494
9495
9496
9497#define ADDR_ALIGN (_dl_pagesize - 1)
9498
9499
9500
9501#define PAGE_ALIGN (~ADDR_ALIGN)
9502
9503
9504
9505#define OFFS_ALIGN (PAGE_ALIGN & ~(1ul << (sizeof(_dl_pagesize) * 8 - 1)))
9506
9507
9508
9509struct init_fini_list {
9510 struct init_fini_list *next;
9511 struct elf_resolve *tpnt;
9512};
9513
9514
9515extern char *_dl_library_path;
9516extern char *_dl_preload;
9517
9518extern const char *_dl_ldsopath;
9519
9520extern const char *_dl_progname;
9521extern size_t _dl_pagesize;
9522
9523
9524
9525
9526#define _dl_trace_prelink 0
9527# 111 "./ldso/include/ldso.h"
9528#define __dl_debug_dprint(fmt,args...) do {} while (0)
9529#define _dl_if_debug_dprint(fmt,args...) do {} while (0)
9530#define _dl_debug_file 2
9531# 126 "./ldso/include/ldso.h"
9532#define _dl_assert(expr) ((void)0)
9533# 136 "./ldso/include/ldso.h"
9534#define _dl_debug_early(fmt,args...) do {} while (0)
9535
9536
9537
9538
9539
9540
9541extern void *_dl_malloc(size_t size);
9542extern void *_dl_calloc(size_t __nmemb, size_t __size);
9543extern void *_dl_realloc(void *__ptr, size_t __size);
9544extern void _dl_free(void *);
9545extern char *_dl_getenv(const char *symbol, char **envp);
9546extern void _dl_unsetenv(const char *symbol, char **envp);
9547extern char *_dl_strdup(const char *string);
9548extern void _dl_dprintf(int, const char *, ...);
9549# 159 "./ldso/include/ldso.h"
9550extern void *_dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf32_fdpic_loadaddr load_addr,
9551 Elf32_auxv_t auxvt[14 + 1], char **envp, char **argv
9552 , struct elf32_fdpic_loadmap *dl_boot_progmap, Elf32_Addr dl_boot_got_pointer);
9553
9554
9555# 1 "./ldso/ldso/bfin/dl-inlines.h" 1
9556
9557
9558
9559
9560
9561
9562
9563# 1 "./include/bfin_sram.h" 1
9564# 10 "./include/bfin_sram.h"
9565#define __BFIN_SRAM_H__
9566
9567
9568
9569
9570
9571
9572#define L1_INST_SRAM 0x00000001
9573#define L1_DATA_A_SRAM 0x00000002
9574#define L1_DATA_B_SRAM 0x00000004
9575#define L1_DATA_SRAM 0x00000006
9576#define L2_SRAM 0x00000008
9577
9578extern void *sram_alloc(size_t size, unsigned long flags)
9579 __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
9580extern int sram_free(const void *addr);
9581extern void *dma_memcpy(void *dest, const void *src, size_t len)
9582 __attribute__ ((__nonnull__ (1, 2)));
9583
9584
9585# 9 "./ldso/ldso/bfin/dl-inlines.h" 2
9586
9587#define __dl_loadaddr_unmap __dl_loadaddr_unmap
9588
9589# 1 "./ldso/ldso/bfin/../fdpic/dl-inlines.h" 1
9590# 9 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9591static __inline __attribute__ ((__always_inline__)) void
9592__dl_init_loadaddr_map(struct elf32_fdpic_loadaddr *loadaddr, Elf32_Addr dl_boot_got_pointer,
9593 struct elf32_fdpic_loadmap *map)
9594{
9595 if (map->version != 0) {
9596 do { static const char __attribute__((section(".text"))) __s[] = ("Invalid loadmap version number\n"); const char *__p, *__scratch; __asm__ ("call 1f;\n1:\n\t" "%1 = RETS;\n\t" "%0 = [%3 + 1b@GOT17M4];\n\t" "%1 = %1 - %0;\n\t" "%1 = %1 + %2;\n\t" : "=&d" (__scratch), "=&d" (__p) : "d" (__s), "a" (dl_boot_got_pointer) : "RETS"); { const char *tmp1 = (__p); ; _dl_write(2, tmp1, _dl_strlen(tmp1)); }; { int __t; for (__t = 0; __t < 0x1000000; __t++) __asm__ __volatile__ (""); } } while (0);
9597 _dl_exit(-1);
9598 }
9599 if (map->nsegs == 0) {
9600 do { static const char __attribute__((section(".text"))) __s[] = ("Invalid segment count in loadmap\n"); const char *__p, *__scratch; __asm__ ("call 1f;\n1:\n\t" "%1 = RETS;\n\t" "%0 = [%3 + 1b@GOT17M4];\n\t" "%1 = %1 - %0;\n\t" "%1 = %1 + %2;\n\t" : "=&d" (__scratch), "=&d" (__p) : "d" (__s), "a" (dl_boot_got_pointer) : "RETS"); { const char *tmp1 = (__p); ; _dl_write(2, tmp1, _dl_strlen(tmp1)); }; { int __t; for (__t = 0; __t < 0x1000000; __t++) __asm__ __volatile__ (""); } } while (0);
9601 _dl_exit(-1);
9602 }
9603 loadaddr->got_value = (void *)dl_boot_got_pointer;
9604 loadaddr->map = map;
9605}
9606
9607
9608
9609
9610
9611
9612static __inline __attribute__ ((__always_inline__)) int
9613__dl_init_loadaddr(struct elf32_fdpic_loadaddr *loadaddr, Elf32_Phdr *ppnt,
9614 int pcnt)
9615{
9616 int count = 0, i;
9617 size_t size;
9618
9619 for (i = 0; i < pcnt; i++)
9620 if (ppnt[i].p_type == 1)
9621 count++;
9622
9623 loadaddr->got_value = 0;
9624
9625 size = sizeof(struct elf32_fdpic_loadmap) +
9626 (sizeof(struct elf32_fdpic_loadseg) * count);
9627 loadaddr->map = _dl_malloc(size);
9628 if (!loadaddr->map)
9629 _dl_exit(-1);
9630
9631 loadaddr->map->version = 0;
9632 loadaddr->map->nsegs = 0;
9633
9634 return count;
9635}
9636
9637
9638static __inline __attribute__ ((__always_inline__)) void
9639__dl_init_loadaddr_hdr(struct elf32_fdpic_loadaddr loadaddr, void *addr,
9640 Elf32_Phdr *phdr, int maxsegs)
9641{
9642 struct elf32_fdpic_loadseg *segdata;
9643
9644 if (loadaddr.map->nsegs == maxsegs)
9645 _dl_exit(-1);
9646
9647 segdata = &loadaddr.map->segs[loadaddr.map->nsegs++];
9648 segdata->addr = (Elf32_Addr)addr;
9649 segdata->p_vaddr = phdr->p_vaddr;
9650 segdata->p_memsz = phdr->p_memsz;
9651
9652
9653
9654
9655
9656
9657
9658}
9659
9660
9661static __inline __attribute__ ((__always_inline__)) void
9662__dl_update_loadaddr_hdr(struct elf32_fdpic_loadaddr loadaddr, void *addr,
9663 Elf32_Phdr *phdr)
9664{
9665 struct elf32_fdpic_loadseg *segdata;
9666 void *oldaddr;
9667 int i;
9668
9669 for (i = 0; i < loadaddr.map->nsegs; i++)
9670 if (loadaddr.map->segs[i].p_vaddr == phdr->p_vaddr &&
9671 loadaddr.map->segs[i].p_memsz == phdr->p_memsz)
9672 break;
9673 if (i == loadaddr.map->nsegs)
9674 _dl_exit(-1);
9675
9676 segdata = loadaddr.map->segs + i;
9677 oldaddr = (void *)segdata->addr;
9678 _dl_munmap(oldaddr, segdata->p_memsz);
9679 segdata->addr = (Elf32_Addr)addr;
9680
9681
9682
9683
9684
9685
9686
9687}
9688# 132 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9689static __inline __attribute__ ((__always_inline__)) int
9690__dl_addr_in_loadaddr(void *p, struct elf32_fdpic_loadaddr loadaddr)
9691{
9692 struct elf32_fdpic_loadmap *map = loadaddr.map;
9693 int c;
9694
9695 for (c = 0; c < map->nsegs; c++)
9696 if ((void *)map->segs[c].addr <= p &&
9697 (char *)p < (char *)map->segs[c].addr + map->segs[c].p_memsz)
9698 return 1;
9699
9700 return 0;
9701}
9702# 154 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9703static __inline __attribute__ ((__always_inline__)) unsigned long
9704higher_prime_number(unsigned long n)
9705{
9706
9707 static const unsigned long primes[] = {
9708 7,
9709 13,
9710 31,
9711 61,
9712 127,
9713 251,
9714 509,
9715 1021,
9716 2039,
9717 4093,
9718 8191,
9719 16381,
9720 32749,
9721 65521,
9722 131071,
9723 262139,
9724 524287,
9725 1048573,
9726 2097143,
9727 4194301,
9728 8388593,
9729 16777213,
9730 33554393,
9731 67108859,
9732 134217689,
9733 268435399,
9734 536870909,
9735 1073741789,
9736
9737 ((unsigned long) 2147483647) + ((unsigned long) 2147483644),
9738 };
9739 const unsigned long *low = &primes[0];
9740 const unsigned long *high = &primes[(sizeof(primes) / sizeof((primes)[0]))];
9741
9742 while (low != high) {
9743 const unsigned long *mid = low + (high - low) / 2;
9744 if (n > *mid)
9745 low = mid + 1;
9746 else
9747 high = mid;
9748 }
9749# 209 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9750 return *low;
9751}
9752
9753struct funcdesc_ht
9754{
9755
9756 struct funcdesc_value **entries;
9757
9758
9759 size_t size;
9760
9761
9762 size_t n_elements;
9763};
9764
9765static __inline __attribute__ ((__always_inline__)) int
9766hash_pointer(const void *p)
9767{
9768 return (int) ((long)p >> 3);
9769}
9770
9771static __inline __attribute__ ((__always_inline__)) struct funcdesc_ht *
9772htab_create(void)
9773{
9774 struct funcdesc_ht *ht = _dl_malloc(sizeof(*ht));
9775 size_t ent_size;
9776
9777 if (!ht)
9778 return ((void *)0);
9779 ht->size = 3;
9780 ent_size = sizeof(struct funcdesc_ht_value *) * ht->size;
9781 ht->entries = _dl_malloc(ent_size);
9782 if (!ht->entries)
9783 return ((void *)0);
9784
9785 ht->n_elements = 0;
9786 _dl_memset(ht->entries, 0, ent_size);
9787
9788 return ht;
9789}
9790
9791
9792
9793
9794
9795static __inline __attribute__ ((__always_inline__)) void
9796htab_delete(struct funcdesc_ht *htab)
9797{
9798 size_t i;
9799
9800 for (i = htab->size - 1; i >= 0; i--)
9801 if (htab->entries[i])
9802 _dl_free(htab->entries[i]);
9803
9804 _dl_free(htab->entries);
9805 _dl_free(htab);
9806}
9807# 275 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9808static __inline __attribute__ ((__always_inline__)) struct funcdesc_value **
9809find_empty_slot_for_expand(struct funcdesc_ht *htab, int hash)
9810{
9811 size_t size = htab->size;
9812 unsigned int index = hash % size;
9813 struct funcdesc_value **slot = htab->entries + index;
9814 int hash2;
9815
9816 if (!*slot)
9817 return slot;
9818
9819 hash2 = 1 + hash % (size - 2);
9820 for (;;) {
9821 index += hash2;
9822 if (index >= size)
9823 index -= size;
9824
9825 slot = htab->entries + index;
9826 if (!*slot)
9827 return slot;
9828 }
9829}
9830# 307 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9831static __inline __attribute__ ((__always_inline__)) int
9832htab_expand(struct funcdesc_ht *htab)
9833{
9834 struct funcdesc_value **oentries;
9835 struct funcdesc_value **olimit;
9836 struct funcdesc_value **p;
9837 struct funcdesc_value **nentries;
9838 size_t nsize;
9839
9840 oentries = htab->entries;
9841 olimit = oentries + htab->size;
9842
9843
9844
9845
9846
9847 if (htab->n_elements * 2 > htab->size)
9848 nsize = higher_prime_number(htab->n_elements * 2);
9849 else
9850 nsize = htab->size;
9851
9852 nentries = _dl_malloc(sizeof(*nentries) * nsize);
9853 _dl_memset(nentries, 0, sizeof(*nentries) * nsize);
9854 if (nentries == ((void *)0))
9855 return 0;
9856 htab->entries = nentries;
9857 htab->size = nsize;
9858
9859 p = oentries;
9860 do {
9861 if (*p)
9862 *find_empty_slot_for_expand(htab, hash_pointer((*p)->entry_point)) = *p;
9863 p++;
9864 } while (p < olimit);
9865# 355 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9866 return 1;
9867}
9868# 367 "./ldso/ldso/bfin/../fdpic/dl-inlines.h"
9869static __inline __attribute__ ((__always_inline__)) struct funcdesc_value **
9870htab_find_slot(struct funcdesc_ht *htab, void *ptr, int insert)
9871{
9872 unsigned int index;
9873 int hash, hash2;
9874 size_t size;
9875 struct funcdesc_value **entry;
9876
9877 if (htab->size * 3 <= htab->n_elements * 4 &&
9878 htab_expand(htab) == 0)
9879 return ((void *)0);
9880
9881 hash = hash_pointer(ptr);
9882
9883 size = htab->size;
9884 index = hash % size;
9885
9886 entry = &htab->entries[index];
9887 if (!*entry)
9888 goto empty_entry;
9889 else if ((*entry)->entry_point == ptr)
9890 return entry;
9891
9892 hash2 = 1 + hash % (size - 2);
9893 for (;;) {
9894 index += hash2;
9895 if (index >= size)
9896 index -= size;
9897
9898 entry = &htab->entries[index];
9899 if (!*entry)
9900 goto empty_entry;
9901 else if ((*entry)->entry_point == ptr)
9902 return entry;
9903 }
9904
9905 empty_entry:
9906 if (!insert)
9907 return ((void *)0);
9908
9909 htab->n_elements++;
9910 return entry;
9911}
9912
9913void *
9914_dl_funcdesc_for (void *entry_point, void *got_value)
9915{
9916 struct elf_resolve *tpnt = ((void**)got_value)[2];
9917 struct funcdesc_ht *ht = tpnt->funcdesc_ht;
9918 struct funcdesc_value **entry;
9919
9920 ((void)0);
9921
9922 if (!ht) {
9923 ht = htab_create();
9924 if (!ht)
9925 return (void*)-1;
9926 tpnt->funcdesc_ht = ht;
9927 }
9928
9929 entry = htab_find_slot(ht, entry_point, 1);
9930 if (*entry) {
9931 ((void)0);
9932 return ({ __asm__ ("" : "+m" (*(*entry))); (*entry); });
9933 }
9934
9935 *entry = _dl_malloc(sizeof(**entry));
9936 (*entry)->entry_point = entry_point;
9937 (*entry)->got_value = got_value;
9938
9939 return ({ __asm__ ("" : "+m" (*(*entry))); (*entry); });
9940}
9941
9942static __inline __attribute__ ((__always_inline__)) void const *
9943_dl_lookup_address(void const *address)
9944{
9945 struct elf_resolve *rpnt;
9946 struct funcdesc_value const *fd;
9947
9948
9949 __asm__ ("" : "+r" (address));
9950
9951 if ((Elf32_Addr)address & 7)
9952
9953 return address;
9954
9955 fd = address;
9956
9957 for (rpnt = _dl_loaded_modules; rpnt; rpnt = rpnt->next) {
9958 if (!rpnt->funcdesc_ht)
9959 continue;
9960
9961 if (fd->got_value != rpnt->loadaddr.got_value)
9962 continue;
9963
9964 address = htab_find_slot(rpnt->funcdesc_ht, (void *)fd->entry_point, 0);
9965
9966 if (address && *(struct funcdesc_value *const*)address == fd) {
9967 address = (*(struct funcdesc_value *const*)address)->entry_point;
9968 break;
9969 } else
9970 address = fd;
9971 }
9972
9973 return address;
9974}
9975# 13 "./ldso/ldso/bfin/dl-inlines.h" 2
9976
9977static __inline __attribute__ ((__always_inline__)) void
9978__dl_loadaddr_unmap(struct elf32_fdpic_loadaddr loadaddr,
9979 struct funcdesc_ht *funcdesc_ht)
9980{
9981 int i;
9982
9983 for (i = 0; i < loadaddr.map->nsegs; i++) {
9984 struct elf32_fdpic_loadseg *segdata;
9985 ssize_t offs;
9986 segdata = loadaddr.map->segs + i;
9987
9988
9989
9990
9991
9992
9993 if ((segdata->addr & 0xff800000) == 0xff800000) {
9994 _dl_sram_free((void *)segdata->addr);
9995 continue;
9996 }
9997
9998 offs = (segdata->p_vaddr & (_dl_pagesize - 1));
9999 _dl_munmap((void*)segdata->addr - offs,
10000 segdata->p_memsz + offs);
10001 }
10002
10003
10004
10005
10006
10007
10008
10009 _dl_free(loadaddr.map);
10010 if (funcdesc_ht)
10011 htab_delete(funcdesc_ht);
10012}
10013
10014static __inline __attribute__ ((__always_inline__)) int
10015__dl_is_special_segment(Elf32_Ehdr *epnt, Elf32_Phdr *ppnt)
10016{
10017 if (ppnt->p_type != 1)
10018 return 0;
10019
10020
10021 if ((epnt->e_flags & 0x00000010) &&
10022 !(ppnt->p_flags & (1 << 1)) && (ppnt->p_flags & (1 << 0)))
10023 return 1;
10024
10025
10026 if ((epnt->e_flags & 0x00000020) &&
10027 (ppnt->p_flags & (1 << 1)) && !(ppnt->p_flags & (1 << 0)))
10028 return 1;
10029
10030
10031
10032
10033
10034 switch (ppnt->p_vaddr) {
10035 case 0xff700000:
10036 case 0xff800000:
10037 case 0xff900000:
10038 case 0xffa00000:
10039 case 0xfeb00000:
10040 case 0xfec00000:
10041 return 1;
10042 default:
10043 return 0;
10044 }
10045}
10046
10047static __inline __attribute__ ((__always_inline__)) char *
10048__dl_map_segment(Elf32_Ehdr *epnt, Elf32_Phdr *ppnt, int infile, int flags)
10049{
10050 void *addr;
10051 unsigned long sram_flags = 0;
10052
10053
10054 if (((epnt->e_flags & 0x00000010) || ppnt->p_vaddr == 0xffa00000) &&
10055 !(ppnt->p_flags & (1 << 1)) && (ppnt->p_flags & (1 << 0)))
10056 {
10057 size_t size = (ppnt->p_vaddr & (_dl_pagesize - 1)) + ppnt->p_filesz;
10058 void *status = _dl_mmap(((void *)0), size, ( (((ppnt->p_flags) & (1 << 2)) ? 0x1 : 0) | (((ppnt->p_flags) & (1 << 1)) ? 0x2 : 0) | (((ppnt->p_flags) & (1 << 0)) ? 0x4 : 0)),
10059 flags | 0x01000 | 0x00800,
10060 infile, ppnt->p_offset & ((~(_dl_pagesize - 1)) & ~(1ul << (sizeof(_dl_pagesize) * 8 - 1))));
10061 if ((((void *)status) == ((void *) -1)))
10062 return ((void *)0);
10063
10064 addr = _dl_sram_alloc(ppnt->p_filesz, 0x00000001);
10065 if (addr)
10066 _dl_dma_memcpy(addr, status + (ppnt->p_vaddr & (_dl_pagesize - 1)), ppnt->p_filesz);
10067 else
10068 _dl_dprintf(2, "%s:%s: sram allocation %#x failed\n",
10069 _dl_progname, __func__, ppnt->p_vaddr);
10070
10071 _dl_munmap(status, size);
10072 return addr;
10073 }
10074
10075
10076 if (((epnt->e_flags & 0x00000020) ||
10077 ppnt->p_vaddr == 0xff700000 ||
10078 ppnt->p_vaddr == 0xff800000 ||
10079 ppnt->p_vaddr == 0xff900000) &&
10080 (ppnt->p_flags & (1 << 1)) && !(ppnt->p_flags & (1 << 0)))
10081 {
10082 switch (ppnt->p_vaddr) {
10083 case 0xff800000: sram_flags = 0x00000002; break;
10084 case 0xff900000: sram_flags = 0x00000004; break;
10085 default: sram_flags = 0x00000006; break;
10086 }
10087 }
10088
10089
10090 if (ppnt->p_vaddr == 0xfeb00000 || ppnt->p_vaddr == 0xfec00000)
10091 sram_flags = 0x00000008;
10092
10093 if (sram_flags) {
10094 addr = _dl_sram_alloc(ppnt->p_memsz, sram_flags);
10095 if (addr) {
10096 if ((_dl_pread((infile), (addr), (ppnt->p_filesz), (ppnt->p_offset))) != ppnt->p_filesz) {
10097 _dl_sram_free(addr);
10098 return ((void *)0);
10099 }
10100 if (ppnt->p_filesz < ppnt->p_memsz)
10101 _dl_memset(addr + ppnt->p_filesz, 0, ppnt->p_memsz - ppnt->p_filesz);
10102 } else
10103 _dl_dprintf(2, "%s:%s: sram allocation %#x failed\n",
10104 _dl_progname, __func__, ppnt->p_vaddr);
10105 return addr;
10106 }
10107
10108 return 0;
10109}
10110# 165 "./ldso/include/ldso.h" 2
10111# 34 "ldso/ldso/ldso.c" 2
10112# 1 "./ldso/include/unsecvars.h" 1
10113# 14 "./ldso/include/unsecvars.h"
10114#define UNSECURE_ENVVARS "LD_PRELOAD\0" "LD_LIBRARY_PATH\0" "LD_DEBUG\0" "LD_DEBUG_OUTPUT\0" "LD_TRACE_LOADED_OBJECTS\0" "TMPDIR\0"
10115# 35 "ldso/ldso/ldso.c" 2
10116
10117
10118# 1 "ldso/ldso/dl-debug.c" 1
10119# 103 "ldso/ldso/dl-debug.c"
10120#define debug_sym(symtab,strtab,symtab_index)
10121#define debug_reloc(symtab,strtab,rpnt)
10122# 161 "ldso/ldso/dl-debug.c"
10123#define _dl_debug_lookup(undef_name,undef_map,ref,value,type_class)
10124# 38 "ldso/ldso/ldso.c" 2
10125
10126#define ALLOW_ZERO_PLTGOT
10127
10128
10129
10130
10131
10132
10133# 1 "ldso/ldso/bfin/elfinterp.c" 1
10134# 40 "ldso/ldso/bfin/elfinterp.c"
10135__attribute__((__visibility__("hidden")))
10136struct funcdesc_value volatile *
10137_dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry)
10138{
10139 Elf32_Rel *this_reloc;
10140 char *strtab;
10141 Elf32_Sym *symtab;
10142 int symtab_index;
10143 char *rel_addr;
10144 char *new_addr;
10145 struct funcdesc_value funcval;
10146 struct funcdesc_value volatile *got_entry;
10147 char *symname;
10148 struct symbol_ref sym_ref;
10149
10150 rel_addr = (char *)tpnt->dynamic_info[23];
10151
10152 this_reloc = (Elf32_Rel *)(intptr_t)(rel_addr + reloc_entry);
10153 symtab_index = ((this_reloc->r_info) >> 8);
10154
10155 symtab = (Elf32_Sym *) tpnt->dynamic_info[6];
10156 strtab = (char *) tpnt->dynamic_info[5];
10157 sym_ref.sym = &symtab[symtab_index];
10158 sym_ref.tpnt = ((void *)0);
10159 symname= strtab + symtab[symtab_index].st_name;
10160
10161
10162 got_entry = (struct funcdesc_value *) ((Elf32_Addr)__reloc_pointer ((void*)(this_reloc->r_offset), (tpnt->loadaddr).map));
10163
10164
10165 new_addr = _dl_find_hash(symname, &_dl_loaded_modules->symbol_scope, ((void *)0), 0, &sym_ref);
10166 if (!new_addr) {
10167 new_addr = _dl_find_hash(symname, ((void *)0), ((void *)0), 0, &sym_ref);
10168 if (!new_addr) {
10169 _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
10170 _dl_progname, symname);
10171 _dl_exit(1);
10172 }
10173 }
10174
10175 funcval.entry_point = new_addr;
10176 funcval.got_value = sym_ref.tpnt->loadaddr.got_value;
10177# 97 "ldso/ldso/bfin/elfinterp.c"
10178 *got_entry = funcval;
10179
10180
10181 return got_entry;
10182}
10183
10184static int
10185_dl_parse(struct elf_resolve *tpnt, struct r_scope_elem *scope,
10186 unsigned long rel_addr, unsigned long rel_size,
10187 int (*reloc_fnc) (struct elf_resolve *tpnt, struct r_scope_elem *scope,
10188 Elf32_Rel *rpnt, Elf32_Sym *symtab, char *strtab))
10189{
10190 unsigned int i;
10191 char *strtab;
10192 Elf32_Sym *symtab;
10193 Elf32_Rel *rpnt;
10194 int symtab_index;
10195
10196
10197 rpnt = (Elf32_Rel *) rel_addr;
10198 rel_size = rel_size / sizeof(Elf32_Rel);
10199
10200 symtab = (Elf32_Sym *) tpnt->dynamic_info[6];
10201 strtab = (char *) tpnt->dynamic_info[5];
10202
10203 for (i = 0; i < rel_size; i++, rpnt++) {
10204 int res;
10205
10206 symtab_index = ((rpnt->r_info) >> 8);
10207 ;
10208 ;
10209
10210 res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
10211
10212 if (res==0) continue;
10213
10214 _dl_dprintf(2, "\n%s: ",_dl_progname);
10215
10216 if (symtab_index)
10217 _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
10218
10219 if (res <0) {
10220 int reloc_type = ((rpnt->r_info) & 0xff);
10221
10222
10223
10224 _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
10225
10226 _dl_exit(-res);
10227 } else if (res >0) {
10228 _dl_dprintf(2, "can't resolve symbol\n");
10229 return res;
10230 }
10231 }
10232 return 0;
10233}
10234
10235static int
10236_dl_do_reloc (struct elf_resolve *tpnt,struct r_scope_elem *scope,
10237 Elf32_Rel *rpnt, Elf32_Sym *symtab, char *strtab)
10238{
10239 int reloc_type;
10240 int symtab_index;
10241 char *symname;
10242 unsigned long reloc_value = 0, *reloc_addr;
10243 struct { unsigned long v; } __attribute__((__packed__))
10244 *reloc_addr_packed;
10245 unsigned long symbol_addr;
10246 struct elf_resolve *symbol_tpnt;
10247 struct funcdesc_value funcval;
10248
10249
10250
10251 struct symbol_ref sym_ref;
10252
10253 reloc_addr = (unsigned long *) ((Elf32_Addr)__reloc_pointer ((void*)(rpnt->r_offset), (tpnt->loadaddr).map));
10254 __asm__ ("" : "=r" (reloc_addr_packed) : "0" (reloc_addr));
10255 reloc_type = ((rpnt->r_info) & 0xff);
10256 symtab_index = ((rpnt->r_info) >> 8);
10257 symbol_addr = 0;
10258 sym_ref.sym = &symtab[symtab_index];
10259 sym_ref.tpnt = ((void *)0);
10260 symname = strtab + symtab[symtab_index].st_name;
10261
10262 if ((((unsigned char) (symtab[symtab_index].st_info)) >> 4) == 0) {
10263 symbol_addr = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(symtab[symtab_index].st_value), (tpnt->loadaddr).map));
10264 symbol_tpnt = tpnt;
10265 } else {
10266
10267 symbol_addr = (unsigned long)
10268 _dl_find_hash(symname, scope, ((void *)0), 0, &sym_ref);
10269
10270
10271
10272
10273
10274
10275
10276 if (!symbol_addr && (((unsigned char) (symtab[symtab_index].st_info)) >> 4) != 2) {
10277 _dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
10278 _dl_progname, symname);
10279 _dl_exit (1);
10280 }
10281 if (0) {
10282
10283 ;
10284 }
10285 symbol_tpnt = sym_ref.tpnt;
10286 }
10287# 218 "ldso/ldso/bfin/elfinterp.c"
10288 switch (reloc_type) {
10289 case 0x00:
10290 break;
10291 case 0x12:
10292 if ((long)reloc_addr_packed & 3)
10293 reloc_value = reloc_addr_packed->v += symbol_addr;
10294 else
10295 reloc_value = *reloc_addr += symbol_addr;
10296 break;
10297 case 0x1b:
10298 funcval.entry_point = (void*)symbol_addr;
10299
10300
10301
10302
10303
10304 if ((((unsigned char) (symtab[symtab_index].st_info)) >> 4) == 0)
10305 funcval.entry_point += *reloc_addr;
10306 reloc_value = (unsigned long)funcval.entry_point;
10307 if (symbol_addr)
10308 funcval.got_value
10309 = symbol_tpnt->loadaddr.got_value;
10310 else
10311 funcval.got_value = 0;
10312 __asm__ ("%0 = %2; %1 = %H2;"
10313 : "=m" (*(struct funcdesc_value *)reloc_addr), "=m" (((long *)reloc_addr)[1])
10314 : "d" (funcval));
10315 break;
10316 case 0x17:
10317 if ((long)reloc_addr_packed & 3)
10318 reloc_value = reloc_addr_packed->v;
10319 else
10320 reloc_value = *reloc_addr;
10321 if (symbol_addr)
10322 reloc_value = (unsigned long)_dl_funcdesc_for
10323 ((char *)symbol_addr + reloc_value,
10324 symbol_tpnt->loadaddr.got_value);
10325 else
10326 reloc_value = 0;
10327 if ((long)reloc_addr_packed & 3)
10328 reloc_addr_packed->v = reloc_value;
10329 else
10330 *reloc_addr = reloc_value;
10331 break;
10332 default:
10333 return -1;
10334 }
10335# 283 "ldso/ldso/bfin/elfinterp.c"
10336 return 0;
10337}
10338
10339static int
10340_dl_do_lazy_reloc (struct elf_resolve *tpnt,
10341 struct r_scope_elem *scope __attribute__((unused)),
10342 Elf32_Rel *rpnt, Elf32_Sym *symtab __attribute__((unused)),
10343 char *strtab __attribute__((unused)))
10344{
10345 int reloc_type;
10346 struct funcdesc_value volatile *reloc_addr;
10347 struct funcdesc_value funcval;
10348
10349
10350
10351
10352 reloc_addr = (struct funcdesc_value *) ((Elf32_Addr)__reloc_pointer ((void*)(rpnt->r_offset), (tpnt->loadaddr).map));
10353 reloc_type = ((rpnt->r_info) & 0xff);
10354
10355
10356
10357
10358 switch (reloc_type) {
10359 case 0x00:
10360 break;
10361 case 0x1b:
10362 funcval = *reloc_addr;
10363 funcval.entry_point = (void *) ((Elf32_Addr)__reloc_pointer ((void*)(funcval.entry_point), (tpnt->loadaddr).map));
10364 funcval.got_value = tpnt->loadaddr.got_value;
10365 *reloc_addr = funcval;
10366 break;
10367 default:
10368 return -1;
10369 }
10370
10371
10372
10373
10374 return 0;
10375
10376}
10377
10378void
10379_dl_parse_lazy_relocation_information
10380(struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size)
10381{
10382 _dl_parse(rpnt->dyn, ((void *)0), rel_addr, rel_size, _dl_do_lazy_reloc);
10383}
10384
10385int
10386_dl_parse_relocation_information
10387(struct dyn_elf *rpnt, struct r_scope_elem *scope, unsigned long rel_addr, unsigned long rel_size)
10388{
10389 return _dl_parse(rpnt->dyn, scope, rel_addr, rel_size, _dl_do_reloc);
10390}
10391
10392
10393
10394int
10395_dl_parse_copy_information
10396(struct dyn_elf *rpnt __attribute__((unused)),
10397 unsigned long rel_addr __attribute__((unused)),
10398 unsigned long rel_size __attribute__((unused)))
10399{
10400 return 0;
10401}
10402
10403
10404# 1 "./ldso/include/../../libc/sysdeps/linux/bfin/crtreloc.c" 1
10405# 37 "./ldso/include/../../libc/sysdeps/linux/bfin/crtreloc.c"
10406union word {
10407 char c[4];
10408 void *v;
10409};
10410
10411
10412
10413static __inline __attribute__ ((__always_inline__)) void ***
10414reloc_range_indirect (void ***p, void ***e,
10415 const struct elf32_fdpic_loadmap *map)
10416{
10417 while (p < e)
10418 {
10419 if (*p != (void **)-1)
10420 {
10421 void *ptr = __reloc_pointer (*p, map);
10422 if (ptr != (void *)-1)
10423 {
10424 void *pt;
10425 if ((long)ptr & 3)
10426 {
10427 unsigned char *c = ptr;
10428 int i;
10429 unsigned long v = 0;
10430 for (i = 0; i < 4; i++)
10431 v |= c[i] << 8 * i;
10432 pt = (void *)v;
10433 }
10434 else
10435 pt = *(void**)ptr;
10436 pt = __reloc_pointer (pt, map);
10437 if ((long)ptr & 3)
10438 {
10439 unsigned char *c = ptr;
10440 int i;
10441 unsigned long v = (unsigned long)pt;
10442 for (i = 0; i < 4; i++, v >>= 8)
10443 c[i] = v;
10444 }
10445 else
10446 *(void**)ptr = pt;
10447 }
10448 }
10449 p++;
10450 }
10451 return p;
10452}
10453
10454
10455
10456
10457__attribute__ ((visibility ("hidden"))) void*
10458__self_reloc (const struct elf32_fdpic_loadmap *map,
10459 void ***p, void ***e)
10460{
10461 p = reloc_range_indirect (p, e-1, map);
10462
10463 if (p >= e)
10464 return (void*)-1;
10465
10466 return __reloc_pointer (*p, map);
10467}
10468# 352 "ldso/ldso/bfin/elfinterp.c" 2
10469# 47 "ldso/ldso/ldso.c" 2
10470
10471
10472
10473char *_dl_library_path = ((void *)0);
10474
10475
10476char *_dl_preload = ((void *)0);
10477
10478int _dl_errno = 0;
10479size_t _dl_pagesize = 0;
10480struct r_debug *_dl_debug_addr = ((void *)0);
10481void *(*_dl_malloc_function) (size_t size) = ((void *)0);
10482void (*_dl_free_function) (void *p) = ((void *)0);
10483
10484
10485
10486
10487
10488
10489
10490static int _dl_secure = 1;
10491# 89 "ldso/ldso/ldso.c"
10492unsigned long __attribute__ ((visibility ("hidden"))) _dl_skip_args = 0;
10493
10494
10495const char *_dl_progname = "ld-uClibc.so.0";
10496# 1 "ldso/ldso/dl-startup.c" 1
10497# 95 "ldso/ldso/dl-startup.c"
10498# 1 "./ldso/ldso/bfin/dl-startup.h" 1
10499# 39 "./ldso/ldso/bfin/dl-startup.h"
10500__asm__(
10501 " .pushsection .text\n"
10502 " .global __start\n"
10503 " .type __start,@function\n"
10504
10505
10506 " .hidden __start\n"
10507 " .set _start, __start\n"
10508 " .global _start\n"
10509 " .hidden _start\n"
10510 "__start:\n"
10511 " call .Lcall\n"
10512 ".Lcall:\n"
10513 " R4 = RETS;\n"
10514 " SP += -32;\n"
10515 " R5 = P0;\n"
10516 " R6 = P1;\n"
10517 " R7 = P2;\n"
10518 " R0.L = .Lcall;\n"
10519 " R0.H = .Lcall;\n"
10520 " R1.L = __ROFIXUP_LIST__;\n"
10521 " R1.H = __ROFIXUP_LIST__;\n"
10522 " R2.L = __ROFIXUP_END__;\n"
10523 " R2.H = __ROFIXUP_END__;\n"
10524 " R1 = R1 - R0;\n"
10525 " R1 = R1 + R4;\n"
10526 " R2 = R2 - R0;\n"
10527 " R2 = R2 + R4;\n"
10528 " R0 = P1;\n"
10529 " CC = R0 == 0;\n"
10530 " IF CC R0 = P0;\n"
10531 " CALL ___self_reloc;\n"
10532 " P3 = R0;\n"
10533 " P5 = R0;\n"
10534 " R1 = R5;\n"
10535 " R2 = R6;\n"
10536 " [SP + 12] = R7;\n"
10537 " P0 = SP;\n"
10538 " P0 += 24;\n"
10539 " [SP + 16] = P0;\n"
10540 " P0 += 8;\n"
10541 " [SP + 20] = P0;\n"
10542 " CALL __dl_start;\n"
10543 " /* Pass our FINI ptr() to the user in P1 */\n"
10544 " R7 = [P5 + __dl_fini@FUNCDESC_GOT17M4];\n"
10545 " P4 = [SP + 24];\n"
10546 " P3 = [SP + 28];\n"
10547 " P0 = R5;\n"
10548 " SP += 32;\n"
10549 " JUMP (P4);\n"
10550 " .size __start,.-__start\n"
10551 " .popsection\n"
10552);
10553
10554#undef DL_START
10555#define DL_START(X) static void __attribute__ ((used)) _dl_start (Elf32_Addr dl_boot_got_pointer, struct elf32_fdpic_loadmap *dl_boot_progmap, struct elf32_fdpic_loadmap *dl_boot_ldsomap, Elf32_Dyn *dl_boot_ldso_dyn_pointer, struct funcdesc_value *dl_main_funcdesc, X)
10556# 108 "./ldso/ldso/bfin/dl-startup.h"
10557#define GET_ARGV(ARGVP,ARGS) ARGVP = (((unsigned long*) ARGS) + 1)
10558# 117 "./ldso/ldso/bfin/dl-startup.h"
10559#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) switch(ELF_R_TYPE((RELP)->r_info)){ case R_BFIN_BYTE4_DATA: *(REL) += (SYMBOL); break; case R_BFIN_FUNCDESC_VALUE: { struct funcdesc_value fv = { (void*)((SYMBOL) + *(REL)), (LOAD).got_value }; *(struct funcdesc_value volatile *)(REL) = fv; break; } default: _dl_exit(1); }
10560# 140 "./ldso/ldso/bfin/dl-startup.h"
10561#define START() do { struct elf_resolve *exec_mod = _dl_loaded_modules; dl_main_funcdesc->entry_point = _dl_elf_main; while (exec_mod->libtype != elf_executable) exec_mod = exec_mod->next; dl_main_funcdesc->got_value = exec_mod->loadaddr.got_value; return; } while (0)
10562# 96 "ldso/ldso/dl-startup.c" 2
10563
10564
10565
10566
10567
10568
10569
10570static int (*_dl_elf_main) (int, char **, char **);
10571
10572static void* __rtld_stack_end;
10573extern __typeof (__rtld_stack_end) __libc_stack_end __attribute__ ((alias ("__rtld_stack_end")));
10574# 117 "ldso/ldso/dl-startup.c"
10575static void __attribute__ ((used)) _dl_start (Elf32_Addr dl_boot_got_pointer, struct elf32_fdpic_loadmap *dl_boot_progmap, struct elf32_fdpic_loadmap *dl_boot_ldsomap, Elf32_Dyn *dl_boot_ldso_dyn_pointer, struct funcdesc_value *dl_main_funcdesc, unsigned long args)
10576{
10577 unsigned int argc;
10578 char **argv, **envp;
10579 struct elf32_fdpic_loadaddr load_addr;
10580 Elf32_Addr got;
10581 unsigned long *aux_dat;
10582 Elf32_Ehdr *header;
10583 struct elf_resolve tpnt_tmp;
10584 struct elf_resolve *tpnt = &tpnt_tmp;
10585 Elf32_auxv_t auxvt[14 + 1];
10586 Elf32_Dyn *dpnt;
10587 uint32_t *p32;
10588# 138 "ldso/ldso/dl-startup.c"
10589 aux_dat = (((unsigned long*) args) + 1);
10590 argc = aux_dat[-1];
10591 argv = (char **) aux_dat;
10592 aux_dat += argc;
10593 aux_dat++;
10594 envp = (char **) aux_dat;
10595
10596 ;
10597 ;
10598 ;
10599 ;
10600 ;
10601 ;
10602
10603 while (*aux_dat)
10604 aux_dat++;
10605 aux_dat++;
10606
10607
10608
10609 auxvt[11].a_type = -1;
10610
10611
10612
10613
10614 while (*aux_dat) {
10615 Elf32_auxv_t *auxv_entry = (Elf32_auxv_t *) aux_dat;
10616
10617 if (auxv_entry->a_type <= 14) {
10618 _dl_memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(Elf32_auxv_t));
10619 }
10620 aux_dat += 2;
10621 }
10622# 188 "ldso/ldso/dl-startup.c"
10623 if (!auxvt[7].a_un.a_val)
10624 auxvt[7].a_un.a_val = elf_machine_load_address();
10625 (__dl_init_loadaddr_map (&(load_addr), dl_boot_got_pointer, dl_boot_ldsomap ?: dl_boot_progmap));
10626
10627 header = (Elf32_Ehdr *) auxvt[7].a_un.a_val;
10628
10629
10630 if (!header || header->e_ident[4] != 1 ||
10631 header->e_ident[6] != 1
10632
10633
10634
10635 || *(p32 = (uint32_t*)&header->e_ident) != ((uint32_t)(0x7f + 0x100 * ('E' + (0x100 * ('L' + 0x100 * 'F')))))
10636 ) {
10637 do { static const char __attribute__((section(".text"))) __s[] = ("Invalid ELF header\n"); const char *__p, *__scratch; __asm__ ("call 1f;\n1:\n\t" "%1 = RETS;\n\t" "%0 = [%3 + 1b@GOT17M4];\n\t" "%1 = %1 - %0;\n\t" "%1 = %1 + %2;\n\t" : "=&d" (__scratch), "=&d" (__p) : "d" (__s), "a" (dl_boot_got_pointer) : "RETS"); { const char *tmp1 = (__p); ; _dl_write(2, tmp1, _dl_strlen(tmp1)); }; { int __t; for (__t = 0; __t < 0x1000000; __t++) __asm__ __volatile__ (""); } } while (0);
10638 _dl_exit(0);
10639 }
10640 ;
10641
10642 ;
10643
10644
10645
10646
10647
10648 ((got) = dl_boot_got_pointer);
10649
10650
10651 ((dpnt) = dl_boot_ldso_dyn_pointer);
10652
10653 ;
10654 ;
10655 _dl_memset(tpnt, 0, sizeof(struct elf_resolve));
10656 tpnt->loadaddr = load_addr;
10657
10658
10659 ;
10660 tpnt->dynamic_addr = dpnt;
10661
10662
10663
10664
10665 _dl_parse_dynamic_info(dpnt, tpnt->dynamic_info, ((void *)0), load_addr);
10666# 247 "ldso/ldso/dl-startup.c"
10667 ;
10668# 259 "ldso/ldso/dl-startup.c"
10669 ;
10670
10671 {
10672 int indx;
10673
10674#define INDX_MAX 1
10675
10676
10677
10678 for (indx = 0; indx < 1; indx++) {
10679 unsigned long rel_addr, rel_size;
10680 Elf32_Word relative_count = tpnt->dynamic_info[((34 + (1 + 0 + 0) + 0) - (1 + 0 + 0) - 0)];
10681
10682 rel_addr = (indx ? tpnt->dynamic_info[23] :
10683 tpnt->dynamic_info[17]);
10684 rel_size = (indx ? tpnt->dynamic_info[2] :
10685 tpnt->dynamic_info[18]);
10686
10687 if (!rel_addr)
10688 continue;
10689
10690 if (!indx && relative_count) {
10691 rel_size -= relative_count * sizeof(Elf32_Rel);
10692
10693
10694
10695 elf_machine_relative(load_addr, rel_addr, relative_count);
10696 rel_addr += relative_count * sizeof(Elf32_Rel);
10697 }
10698
10699
10700
10701
10702
10703
10704 {
10705 Elf32_Rel *rpnt;
10706 unsigned int i;
10707 Elf32_Sym *sym;
10708 unsigned long symbol_addr;
10709 int symtab_index;
10710 unsigned long *reloc_addr;
10711
10712
10713 rpnt = (Elf32_Rel *) rel_addr;
10714 for (i = 0; i < rel_size; i += sizeof(Elf32_Rel), rpnt++) {
10715 reloc_addr = (unsigned long *) ((Elf32_Addr)__reloc_pointer ((void*)((unsigned long)rpnt->r_offset), (load_addr).map));
10716 symtab_index = ((rpnt->r_info) >> 8);
10717 symbol_addr = 0;
10718 sym = ((void *)0);
10719 if (symtab_index) {
10720 char *strtab;
10721 Elf32_Sym *symtab;
10722
10723 symtab = (Elf32_Sym *) tpnt->dynamic_info[6];
10724 strtab = (char *) tpnt->dynamic_info[5];
10725 sym = &symtab[symtab_index];
10726 symbol_addr = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(sym->st_value), (load_addr).map));
10727
10728
10729
10730
10731
10732 } else {
10733 ;
10734 }
10735
10736 switch((((rpnt)->r_info) & 0xff)){ case 0x12: *(reloc_addr) += (symbol_addr); break; case 0x1b: { struct funcdesc_value fv = { (void*)((symbol_addr) + *(reloc_addr)), (load_addr).got_value }; *(struct funcdesc_value volatile *)(reloc_addr) = fv; break; } default: _dl_exit(1); };
10737 }
10738 }
10739
10740
10741
10742
10743
10744
10745 }
10746 }
10747
10748
10749 ;
10750
10751
10752
10753
10754
10755
10756 __rtld_stack_end = (void *)(argv - 1);
10757
10758 _dl_elf_main = (int (*)(int, char **, char **))
10759 _dl_get_ready_to_run(tpnt, load_addr, auxvt, envp, argv
10760 , dl_boot_progmap, dl_boot_got_pointer);
10761
10762
10763 ;
10764 ;
10765
10766
10767
10768
10769 do { struct elf_resolve *exec_mod = _dl_loaded_modules; dl_main_funcdesc->entry_point = _dl_elf_main; while (exec_mod->libtype != elf_executable) exec_mod = exec_mod->next; dl_main_funcdesc->got_value = exec_mod->loadaddr.got_value; return; } while (0);
10770
10771}
10772# 94 "ldso/ldso/ldso.c" 2
10773# 1 "ldso/ldso/dl-symbols.c" 1
10774# 20 "ldso/ldso/dl-symbols.c"
10775struct elf_resolve *_dl_loaded_modules = ((void *)0);
10776# 95 "ldso/ldso/ldso.c" 2
10777# 1 "ldso/ldso/dl-array.c" 1
10778# 34 "ldso/ldso/dl-array.c"
10779static void _dl_run_array_forward(unsigned long array, unsigned long size,
10780 struct elf32_fdpic_loadaddr loadaddr)
10781{
10782 if (array != 0) {
10783 unsigned int j;
10784 unsigned int jm;
10785 Elf32_Addr *addrs;
10786 jm = size / sizeof (Elf32_Addr);
10787 addrs = (Elf32_Addr *) ((Elf32_Addr)__reloc_pointer ((void*)(array), (loadaddr).map));
10788 for (j = 0; j < jm; ++j) {
10789 void (*dl_elf_func) (void);
10790 dl_elf_func = (void (*)(void)) (intptr_t) addrs[j];
10791 ({ struct funcdesc_value fd = { (void*)(dl_elf_func), (loadaddr).got_value }; void (*pf)(void) = (void*) ({ __asm__ ("" : "+m" (*(&fd))); (&fd); }); (* (void (*)(void)) pf)(); });
10792 }
10793 }
10794}
10795
10796void _dl_run_init_array(struct elf_resolve *tpnt);
10797void _dl_run_init_array(struct elf_resolve *tpnt)
10798{
10799 _dl_run_array_forward(tpnt->dynamic_info[25],
10800 tpnt->dynamic_info[27],
10801 tpnt->loadaddr);
10802}
10803
10804void _dl_app_init_array(void);
10805void _dl_app_init_array(void)
10806{
10807 _dl_run_init_array(_dl_loaded_modules);
10808}
10809
10810void _dl_run_fini_array(struct elf_resolve *tpnt);
10811void _dl_run_fini_array(struct elf_resolve *tpnt)
10812{
10813 if (tpnt->dynamic_info[26]) {
10814 Elf32_Addr *array = (Elf32_Addr *) ((Elf32_Addr)__reloc_pointer ((void*)(tpnt->dynamic_info[26]), (tpnt->loadaddr).map));
10815 unsigned int i = (tpnt->dynamic_info[28] / sizeof(Elf32_Addr));
10816 while (i-- > 0) {
10817 void (*dl_elf_func) (void);
10818 dl_elf_func = (void (*)(void)) (intptr_t) array[i];
10819 ({ struct funcdesc_value fd = { (void*)(dl_elf_func), (tpnt->loadaddr).got_value }; void (*pf)(void) = (void*) ({ __asm__ ("" : "+m" (*(&fd))); (&fd); }); (* (void (*)(void)) pf)(); });
10820 }
10821 }
10822}
10823
10824void _dl_app_fini_array(void);
10825void _dl_app_fini_array(void)
10826{
10827 _dl_run_fini_array(_dl_loaded_modules);
10828}
10829# 96 "ldso/ldso/ldso.c" 2
10830
10831
10832
10833
10834
10835
10836void _dl_debug_state(void);
10837extern __typeof (_dl_debug_state) _dl_debug_state __asm__ ("_" "__GI__dl_debug_state") __attribute__ ((visibility ("hidden"), noinline));;
10838void _dl_debug_state(void)
10839{
10840
10841
10842
10843 __asm__("");
10844}
10845extern __typeof (_dl_debug_state) __EI__dl_debug_state __asm__("_" "_dl_debug_state"); extern __typeof (_dl_debug_state) __EI__dl_debug_state __attribute__((alias ("" "__GI__dl_debug_state")));;
10846
10847static unsigned char *_dl_malloc_addr = ((void *)0);
10848static unsigned char *_dl_mmap_zero = ((void *)0);
10849
10850static struct elf_resolve **init_fini_list;
10851static struct elf_resolve **scope_elem_list;
10852static unsigned int nlist;
10853extern void _start(void);
10854# 135 "ldso/ldso/ldso.c"
10855const char *_dl_ldsopath = ((void *)0);
10856
10857static void _dl_ldsopath_init(struct elf_resolve *tpnt)
10858{
10859 char *ldsopath, *ptmp;
10860# 149 "ldso/ldso/ldso.c"
10861 ldsopath = _dl_strdup(tpnt->libname);
10862 ptmp = _dl_strrchr(ldsopath, '/');
10863
10864
10865
10866
10867 if (!ptmp)
10868 ptmp = ldsopath;
10869 *ptmp = '\0';
10870
10871 _dl_ldsopath = ldsopath;
10872 do {} while (0)
10873
10874 ;
10875}
10876
10877
10878
10879
10880char *_dl_getenv(const char *symbol, char **envp)
10881{
10882 char *pnt;
10883 const char *pnt1;
10884
10885 while ((pnt = *envp++)) {
10886 pnt1 = symbol;
10887 while (*pnt && *pnt == *pnt1)
10888 pnt1++, pnt++;
10889 if (!*pnt || *pnt != '=' || *pnt1)
10890 continue;
10891 return pnt + 1;
10892 }
10893 return 0;
10894}
10895
10896void _dl_unsetenv(const char *symbol, char **envp)
10897{
10898 char *pnt;
10899 const char *pnt1;
10900 char **newenvp = envp;
10901
10902 for (pnt = *envp; pnt; pnt = *++envp) {
10903 pnt1 = symbol;
10904 while (*pnt && *pnt == *pnt1)
10905 pnt1++, pnt++;
10906 if (!*pnt || *pnt != '=' || *pnt1)
10907 *newenvp++ = *envp;
10908 }
10909 *newenvp++ = *envp;
10910 return;
10911}
10912
10913static int _dl_suid_ok(void)
10914{
10915 __kernel_uid_t uid, euid;
10916 __kernel_gid_t gid, egid;
10917
10918 uid = _dl_getuid();
10919 euid = _dl_geteuid();
10920 gid = _dl_getgid();
10921 egid = _dl_getegid();
10922
10923 if (uid == euid && gid == egid) {
10924 return 1;
10925 }
10926 return 0;
10927}
10928
10929void *_dl_malloc(size_t size)
10930{
10931 void *retval;
10932
10933
10934
10935
10936
10937 if (_dl_malloc_function)
10938 return (*_dl_malloc_function) (size);
10939
10940 if (_dl_malloc_addr - _dl_mmap_zero + size > _dl_pagesize) {
10941 size_t rounded_size;
10942# 241 "ldso/ldso/ldso.c"
10943 if (size < _dl_pagesize)
10944 rounded_size = (size + (_dl_pagesize - 1)) & _dl_pagesize;
10945 else
10946 rounded_size = size;
10947
10948 do {} while (0);
10949 _dl_mmap_zero = _dl_malloc_addr = _dl_mmap((void *) 0, rounded_size,
10950 0x1 | 0x2, 0x02 | 0x20 | 0x4000000, -1, 0);
10951 if ((((void *)_dl_mmap_zero) == ((void *) -1))) {
10952 _dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
10953 _dl_exit(20);
10954 }
10955 }
10956 retval = _dl_malloc_addr;
10957 _dl_malloc_addr += size;
10958
10959
10960
10961
10962
10963
10964 _dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr + (32 / 8) - 1) & ~((32 / 8) - 1));
10965 return retval;
10966}
10967
10968static void *_dl_zalloc(size_t size)
10969{
10970 void *p = _dl_malloc(size);
10971 if (p)
10972 _dl_memset(p, 0, size);
10973 return p;
10974}
10975
10976void _dl_free(void *p)
10977{
10978 if (_dl_free_function)
10979 (*_dl_free_function) (p);
10980}
10981# 306 "ldso/ldso/ldso.c"
10982static void __attribute__ ((destructor)) __attribute__ ((__used__)) _dl_fini(void)
10983{
10984 unsigned int i;
10985 struct elf_resolve * tpnt;
10986
10987 for (i = 0; i < nlist; ++i) {
10988 tpnt = init_fini_list[i];
10989 if (tpnt->init_flag & 0x000008)
10990 continue;
10991 tpnt->init_flag |= 0x000008;
10992 _dl_run_fini_array(tpnt);
10993 if (tpnt->dynamic_info[13]) {
10994 void (*dl_elf_func) (void);
10995
10996 dl_elf_func = (void (*)(void)) (intptr_t) ((Elf32_Addr)__reloc_pointer ((void*)(tpnt->dynamic_info[13]), (tpnt->loadaddr).map));
10997 do {} while (0);
10998 ({ struct funcdesc_value fd = { (void*)(dl_elf_func), (tpnt->loadaddr).got_value }; void (*pf)(void) = (void*) ({ __asm__ ("" : "+m" (*(&fd))); (&fd); }); (* (void(*)(void)) pf)(); });
10999 }
11000 }
11001}
11002# 352 "ldso/ldso/ldso.c"
11003static struct elf_resolve * add_ldso(struct elf_resolve *tpnt,
11004 struct elf32_fdpic_loadaddr load_addr,
11005 Elf32_Addr ldso_mapaddr,
11006 Elf32_auxv_t auxvt[14 + 1],
11007 struct dyn_elf *rpnt)
11008{
11009 Elf32_Ehdr *epnt = (Elf32_Ehdr *) auxvt[7].a_un.a_val;
11010 Elf32_Phdr *myppnt = (Elf32_Phdr *)
11011 ((
11012 Elf32_Addr
11013# 360 "ldso/ldso/ldso.c"
11014 )__reloc_pointer ((void*)(epnt->e_phoff), ((load_addr)).map))
11015 ;
11016 int j;
11017 struct stat st;
11018
11019 tpnt = _dl_add_elf_hash_table(tpnt->libname, tpnt->loadaddr,
11020 tpnt->dynamic_info, (unsigned long)tpnt->dynamic_addr,
11021 0);
11022
11023 tpnt->mapaddr = ldso_mapaddr;
11024 if (_dl_stat(tpnt->libname, &st) >= 0) {
11025 tpnt->st_dev = st.st_dev;
11026 tpnt->st_ino = st.st_ino;
11027 }
11028 tpnt->n_phent = epnt->e_phnum;
11029 tpnt->ppnt = myppnt;
11030 for (j = 0; j < epnt->e_phnum; j++, myppnt++) {
11031 if (myppnt->p_type == 0x6474e552) {
11032 tpnt->relro_addr = myppnt->p_vaddr;
11033 tpnt->relro_size = myppnt->p_memsz;
11034 break;
11035 }
11036 }
11037 tpnt->libtype = program_interpreter;
11038 if (rpnt) {
11039 rpnt->next = _dl_zalloc(sizeof(struct dyn_elf));
11040 rpnt->next->prev = rpnt;
11041 rpnt = rpnt->next;
11042 } else {
11043 rpnt = _dl_zalloc(sizeof(struct dyn_elf));
11044 }
11045 rpnt->dyn = tpnt;
11046 tpnt->rtld_flags = 0x00002 | 0x00100;
11047
11048 return tpnt;
11049}
11050
11051static ptrdiff_t _dl_build_local_scope (struct elf_resolve **list,
11052 struct elf_resolve *map)
11053{
11054 struct elf_resolve **p = list;
11055 struct init_fini_list *q;
11056
11057 *p++ = map;
11058 map->init_flag |= 0x000020;
11059 if (map->init_fini)
11060 for (q = map->init_fini; q; q = q->next)
11061 if (! (q->tpnt->init_flag & 0x000020))
11062 p += _dl_build_local_scope (p, q->tpnt);
11063 return p - list;
11064}
11065
11066void *_dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf32_fdpic_loadaddr load_addr,
11067 Elf32_auxv_t auxvt[14 + 1], char **envp, char **argv
11068 , struct elf32_fdpic_loadmap *dl_boot_progmap, Elf32_Addr dl_boot_got_pointer)
11069{
11070 Elf32_Addr app_mapaddr = 0, ldso_mapaddr = 0;
11071 Elf32_Phdr *ppnt;
11072 Elf32_Dyn *dpnt;
11073 char *lpntstr;
11074 unsigned int i, cnt, nscope_elem;
11075 int unlazy = 0, trace_loaded_objects = 0;
11076 struct dyn_elf *rpnt;
11077 struct elf_resolve *tcurr;
11078 struct elf_resolve *tpnt1;
11079 struct elf_resolve *ldso_tpnt = ((void *)0);
11080 struct elf_resolve app_tpnt_tmp;
11081 struct elf_resolve *app_tpnt = &app_tpnt_tmp;
11082 struct r_debug *debug_addr;
11083 unsigned long *lpnt;
11084 unsigned long *_dl_envp;
11085 Elf32_Addr relro_addr = 0;
11086 size_t relro_size = 0;
11087 struct r_scope_elem *global_scope;
11088 struct elf_resolve **local_scope;
11089# 444 "ldso/ldso/ldso.c"
11090 _dl_memset(app_tpnt, 0, sizeof(*app_tpnt));
11091
11092
11093 _dl_pagesize = (auxvt[6].a_un.a_val) ? (size_t) auxvt[6].a_un.a_val : (1UL << 12);
11094
11095
11096
11097
11098 _dl_malloc_addr = (unsigned char *)_dl_pagesize;
11099 _dl_mmap_zero = 0;
11100
11101
11102 do {} while (0);
11103
11104
11105
11106
11107
11108
11109 if (argv[0]) {
11110 _dl_progname = argv[0];
11111 }
11112
11113
11114 if (_start == (void *) auxvt[9].a_un.a_val) {
11115 _dl_dprintf(2, "Standalone execution is not enabled\n");
11116 _dl_exit(1);
11117 }
11118
11119
11120
11121
11122
11123
11124
11125 rpnt = ((void *)0);
11126 if (_dl_getenv("LD_BIND_NOW", envp))
11127 unlazy = 0x00002;
11128
11129
11130
11131
11132
11133 if ((auxvt[11].a_un.a_val == (size_t)-1 && _dl_suid_ok()) ||
11134 (auxvt[11].a_un.a_val != (size_t)-1 &&
11135 auxvt[11].a_un.a_val == auxvt[12].a_un.a_val &&
11136 auxvt[13].a_un.a_val == auxvt[14].a_un.a_val)) {
11137 _dl_secure = 0;
11138
11139 _dl_preload = _dl_getenv("LD_PRELOAD", envp);
11140
11141
11142 _dl_library_path = _dl_getenv("LD_LIBRARY_PATH", envp);
11143
11144 } else {
11145 static const char unsecure_envvars[] =
11146
11147
11148
11149 "LD_PRELOAD\0" "LD_LIBRARY_PATH\0" "LD_DEBUG\0" "LD_DEBUG_OUTPUT\0" "LD_TRACE_LOADED_OBJECTS\0" "TMPDIR\0";
11150 const char *nextp;
11151 _dl_secure = 1;
11152
11153 nextp = unsecure_envvars;
11154 do {
11155 _dl_unsetenv (nextp, envp);
11156
11157 nextp = _dl_strchr(nextp, '\0') + 1;
11158 } while (*nextp != '\0');
11159
11160 _dl_preload = ((void *)0);
11161
11162
11163 _dl_library_path = ((void *)0);
11164
11165
11166 unlazy = 0x00002;
11167 }
11168# 623 "ldso/ldso/ldso.c"
11169 {
11170 unsigned int idx;
11171 Elf32_Phdr *phdr = (Elf32_Phdr *) auxvt[3].a_un.a_val;
11172
11173 for (idx = 0; idx < auxvt[5].a_un.a_val; idx++, phdr++)
11174 if (phdr->p_type == 6) {
11175 (__dl_init_loadaddr_map (&(app_tpnt->loadaddr), 0, dl_boot_progmap));
11176 break;
11177 }
11178
11179 if (((app_tpnt->loadaddr).got_value))
11180 do {} while (0)
11181 ;
11182 }
11183
11184
11185
11186
11187
11188 debug_addr = _dl_zalloc(sizeof(struct r_debug));
11189
11190 ppnt = (Elf32_Phdr *) auxvt[3].a_un.a_val;
11191 for (i = 0; i < auxvt[5].a_un.a_val; i++, ppnt++) {
11192 if (ppnt->p_type == 0x6474e552) {
11193 relro_addr = ppnt->p_vaddr;
11194 relro_size = ppnt->p_memsz;
11195 }
11196 if (!app_mapaddr && (ppnt->p_type == 1)) {
11197 app_mapaddr = ((Elf32_Addr)__reloc_pointer ((void*)(ppnt->p_vaddr), (app_tpnt->loadaddr).map));
11198 }
11199 if (ppnt->p_type == 2) {
11200 dpnt = (Elf32_Dyn *) ((Elf32_Addr)__reloc_pointer ((void*)(ppnt->p_vaddr), (app_tpnt->loadaddr).map));
11201 _dl_parse_dynamic_info(dpnt, app_tpnt->dynamic_info, debug_addr, app_tpnt->loadaddr);
11202
11203
11204
11205
11206
11207
11208 do {} while (0);
11209
11210 if (app_tpnt->dynamic_info[22]) {
11211 Elf32_Phdr *ppnt_outer = ppnt;
11212 ppnt = (Elf32_Phdr *) auxvt[3].a_un.a_val;
11213 for (i = 0; i < auxvt[5].a_un.a_val; i++, ppnt++) {
11214 if (ppnt->p_type == 1 && !(ppnt->p_flags & (1 << 1)))
11215 _dl_mprotect((void *) (((Elf32_Addr)__reloc_pointer ((void*)(ppnt->p_vaddr), (app_tpnt->loadaddr).map)) & (~(_dl_pagesize - 1))),
11216 (((Elf32_Addr)__reloc_pointer ((void*)(ppnt->p_vaddr), (app_tpnt->loadaddr).map)) & (_dl_pagesize - 1)) +
11217 (unsigned long) ppnt->p_filesz,
11218 0x1 | 0x2 | 0x4);
11219 }
11220 ppnt = ppnt_outer;
11221 }
11222# 689 "ldso/ldso/ldso.c"
11223 app_tpnt = _dl_add_elf_hash_table(_dl_progname, app_tpnt->loadaddr,
11224 app_tpnt->dynamic_info,
11225 (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(ppnt->p_vaddr), (app_tpnt->loadaddr).map)),
11226 ppnt->p_filesz);
11227 _dl_loaded_modules->libtype = elf_executable;
11228 _dl_loaded_modules->ppnt = (Elf32_Phdr *) auxvt[3].a_un.a_val;
11229 _dl_loaded_modules->n_phent = auxvt[5].a_un.a_val;
11230 _dl_symbol_tables = rpnt = _dl_zalloc(sizeof(struct dyn_elf));
11231 rpnt->dyn = _dl_loaded_modules;
11232 app_tpnt->mapaddr = app_mapaddr;
11233 app_tpnt->rtld_flags = unlazy | 0x00100;
11234 app_tpnt->usage_count++;
11235 lpnt = (unsigned long *) (app_tpnt->dynamic_info[3]);
11236
11237 if (lpnt)
11238
11239 { (_dl_loaded_modules)->loadaddr.got_value = (lpnt); lpnt[0] = ((unsigned long *)&_dl_linux_resolve)[0]; lpnt[1] = ((unsigned long *)&_dl_linux_resolve)[1]; lpnt[2] = (unsigned long) _dl_loaded_modules; };
11240 }
11241
11242
11243 if (ppnt->p_type == 3) {
11244 tpnt->libname = (char *) ((Elf32_Addr)__reloc_pointer ((void*)(ppnt->p_vaddr), (app_tpnt->loadaddr).map));
11245
11246 _dl_ldsopath_init(tpnt);
11247 }
11248
11249
11250 if (ppnt->p_type == 7) {
11251# 736 "ldso/ldso/ldso.c"
11252 _dl_dprintf(2, "Program uses unsupported TLS data!\n");
11253 _dl_exit(1);
11254
11255 }
11256 }
11257 app_tpnt->relro_addr = relro_addr;
11258 app_tpnt->relro_size = relro_size;
11259# 820 "ldso/ldso/ldso.c"
11260 if (_dl_getenv("LD_TRACE_LOADED_OBJECTS", envp) != ((void *)0)) {
11261 trace_loaded_objects++;
11262 }
11263# 831 "ldso/ldso/ldso.c"
11264 ldso_mapaddr = (Elf32_Addr) auxvt[7].a_un.a_val;
11265
11266
11267
11268
11269
11270 debug_addr->r_map = (struct link_map *) _dl_loaded_modules;
11271 debug_addr->r_version = 1;
11272 debug_addr->r_ldbase = (Elf32_Addr)
11273 (((load_addr)).got_value);
11274 debug_addr->r_brk = (unsigned long) &_dl_debug_state;
11275 _dl_debug_addr = debug_addr;
11276# 852 "ldso/ldso/ldso.c"
11277 _dl_map_cache();
11278
11279
11280 if (_dl_preload) {
11281 char c, *str, *str2;
11282
11283 str = _dl_preload;
11284 while (*str == ':' || *str == ' ' || *str == '\t')
11285 str++;
11286
11287 while (*str) {
11288 str2 = str;
11289 while (*str2 && *str2 != ':' && *str2 != ' ' && *str2 != '\t')
11290 str2++;
11291 c = *str2;
11292 *str2 = '\0';
11293
11294 if (!_dl_secure || _dl_strchr(str, '/') == ((void *)0)) {
11295 do {} while (0);
11296
11297 tpnt1 = _dl_load_shared_library(
11298 _dl_secure ? 0x0001 : 0,
11299 &rpnt, ((void *)0), str, trace_loaded_objects);
11300 if (!tpnt1) {
11301
11302 if (trace_loaded_objects || 0)
11303 _dl_dprintf(1, "\t%s => not found\n", str);
11304 else
11305
11306 {
11307 _dl_dprintf(2, "%s: can't load " "library '%s'\n", _dl_progname, str);
11308 _dl_exit(15);
11309 }
11310 } else {
11311 tpnt1->rtld_flags = unlazy | 0x00100;
11312
11313 do {} while (0);
11314
11315
11316 if (trace_loaded_objects && !0 &&
11317 tpnt1->usage_count == 1) {
11318
11319
11320
11321
11322
11323 if (_dl_strcmp(_dl_progname, str) != 0)
11324 _dl_dprintf(1, "\t%s => %s (%x)\n", str, tpnt1->libname,
11325 ((tpnt1->loadaddr).got_value));
11326 }
11327
11328 }
11329 }
11330
11331 *str2 = c;
11332 str = str2;
11333 while (*str == ':' || *str == ' ' || *str == '\t')
11334 str++;
11335 }
11336 }
11337# 1002 "ldso/ldso/ldso.c"
11338 nlist = 0;
11339 for (tcurr = _dl_loaded_modules; tcurr; tcurr = tcurr->next) {
11340 Elf32_Dyn *this_dpnt;
11341
11342 nlist++;
11343 for (this_dpnt = (Elf32_Dyn *) tcurr->dynamic_addr; this_dpnt->d_tag; this_dpnt++) {
11344 if (this_dpnt->d_tag == 1) {
11345 char *name;
11346 struct init_fini_list *tmp;
11347
11348 lpntstr = (char*) (tcurr->dynamic_info[5] + this_dpnt->d_un.d_val);
11349 name = _dl_get_last_path_component(lpntstr);
11350 do {} while (0);
11351
11352 if (_dl_strcmp(name, "ld-uClibc.so.0") == 0) {
11353 if (!ldso_tpnt) {
11354
11355 ldso_tpnt = add_ldso(tpnt, load_addr,
11356 ldso_mapaddr, auxvt, rpnt);
11357 }
11358 ldso_tpnt->usage_count++;
11359 tpnt1 = ldso_tpnt;
11360 } else
11361 tpnt1 = _dl_load_shared_library(0, &rpnt, tcurr, lpntstr, trace_loaded_objects);
11362
11363 if (!tpnt1) {
11364
11365 if (trace_loaded_objects || 0) {
11366 _dl_dprintf(1, "\t%s => not found\n", lpntstr);
11367 continue;
11368 } else
11369
11370 {
11371 _dl_dprintf(2, "%s: can't load library '%s'\n", _dl_progname, lpntstr);
11372 _dl_exit(16);
11373 }
11374 }
11375
11376 tmp = __builtin_alloca (sizeof(struct init_fini_list));
11377 tmp->tpnt = tpnt1;
11378 tmp->next = tcurr->init_fini;
11379 tcurr->init_fini = tmp;
11380
11381 tpnt1->rtld_flags = unlazy | 0x00100;
11382
11383 do {} while (0);
11384
11385
11386 if (trace_loaded_objects && !0 &&
11387 tpnt1->usage_count == 1) {
11388 _dl_dprintf(1, "\t%s => %s (%x)\n",
11389 lpntstr, tpnt1->libname,
11390 ((tpnt1->loadaddr).got_value));
11391 }
11392
11393 }
11394 }
11395 }
11396 _dl_unmap_cache();
11397
11398
11399 nscope_elem = nlist;
11400
11401 if (_dl_loaded_modules->libtype == elf_executable) {
11402 --nlist;
11403 tcurr = _dl_loaded_modules->next;
11404 } else
11405 tcurr = _dl_loaded_modules;
11406 init_fini_list = _dl_malloc(nlist * sizeof(struct elf_resolve *));
11407 i = 0;
11408 for (; tcurr; tcurr = tcurr->next)
11409 init_fini_list[i++] = tcurr;
11410
11411
11412 for (tcurr = _dl_loaded_modules->next; tcurr; tcurr = tcurr->next) {
11413 unsigned int j, k;
11414
11415 for (j = 0; init_fini_list[j] != tcurr; ++j)
11416 ;
11417 for (k = j + 1; k < nlist; ++k) {
11418 struct init_fini_list *runp = init_fini_list[k]->init_fini;
11419
11420 for (; runp; runp = runp->next) {
11421 if (runp->tpnt == tcurr) {
11422 struct elf_resolve *here = init_fini_list[k];
11423 do {} while (0);
11424 for (i = (k - j); i; --i)
11425 init_fini_list[i+j] = init_fini_list[i+j-1];
11426 init_fini_list[j] = here;
11427 ++j;
11428 break;
11429 }
11430 }
11431 }
11432 }
11433# 1119 "ldso/ldso/ldso.c"
11434 if (!ldso_tpnt) {
11435 tpnt = add_ldso(tpnt, load_addr, ldso_mapaddr, auxvt, rpnt);
11436 tpnt->usage_count++;
11437 nscope_elem++;
11438 } else
11439 tpnt = ldso_tpnt;
11440# 1135 "ldso/ldso/ldso.c"
11441 tpnt->init_flag = 0x000001 | 0x000002;
11442
11443 tpnt = ((void *)0);
11444
11445
11446
11447
11448 scope_elem_list = (struct elf_resolve **) _dl_malloc(nscope_elem * sizeof(struct elf_resolve *));
11449
11450 for (i = 0, tcurr = _dl_loaded_modules; tcurr; tcurr = tcurr->next)
11451 scope_elem_list[i++] = tcurr;
11452
11453 _dl_loaded_modules->symbol_scope.r_list = scope_elem_list;
11454 _dl_loaded_modules->symbol_scope.r_nlist = nscope_elem;
11455
11456
11457
11458
11459
11460 global_scope = &_dl_loaded_modules->symbol_scope;
11461
11462
11463 local_scope = _dl_malloc(nscope_elem * sizeof(struct elf_resolve *));
11464 i = 1;
11465 for (tcurr = _dl_loaded_modules->next; tcurr; tcurr = tcurr->next) {
11466 unsigned int k;
11467 cnt = _dl_build_local_scope(local_scope, scope_elem_list[i++]);
11468 tcurr->symbol_scope.r_list = _dl_malloc(cnt * sizeof(struct elf_resolve *));
11469 tcurr->symbol_scope.r_nlist = cnt;
11470 _dl_memcpy (tcurr->symbol_scope.r_list, local_scope, cnt * sizeof (struct elf_resolve *));
11471
11472 for (k = 1; k < nscope_elem; k++)
11473 scope_elem_list[k]->init_flag &= ~0x000020;
11474 }
11475
11476 _dl_free(local_scope);
11477
11478
11479
11480 if (trace_loaded_objects && !0)
11481 _dl_exit(0);
11482# 1288 "ldso/ldso/ldso.c"
11483 {
11484
11485 do {} while (0);
11486# 1306 "ldso/ldso/ldso.c"
11487 if (_dl_symbol_tables)
11488 if (_dl_fixup(_dl_symbol_tables, global_scope, unlazy))
11489 _dl_exit(-1);
11490
11491 for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
11492 if (tpnt->relro_size)
11493 _dl_protect_relro (tpnt);
11494 }
11495 }
11496# 1345 "ldso/ldso/ldso.c"
11497 _dl_envp = (unsigned long *) (intptr_t) _dl_find_hash("_" "__environ", global_scope, ((void *)0), 0, ((void *)0));
11498 if (_dl_envp)
11499 *_dl_envp = (unsigned long) envp;
11500
11501
11502 {
11503 unsigned int j;
11504 Elf32_Phdr *myppnt;
11505
11506
11507
11508
11509 for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
11510 for (myppnt = tpnt->ppnt, j = 0; j < tpnt->n_phent; j++, myppnt++) {
11511 if (myppnt->p_type == 1 && !(myppnt->p_flags & (1 << 1)) && tpnt->dynamic_info[22]) {
11512 _dl_mprotect((void *) (((Elf32_Addr)__reloc_pointer ((void*)(myppnt->p_vaddr), (tpnt->loadaddr).map)) & (~(_dl_pagesize - 1))),
11513 (myppnt->p_vaddr & (_dl_pagesize - 1)) + (unsigned long) myppnt->p_filesz, ( (((myppnt->p_flags) & (1 << 2)) ? 0x1 : 0) | (((myppnt->p_flags) & (1 << 1)) ? 0x2 : 0) | (((myppnt->p_flags) & (1 << 0)) ? 0x4 : 0)));
11514 }
11515 }
11516 }
11517
11518 }
11519
11520
11521 _dl_debug_addr->r_state = RT_ADD;
11522 _dl_debug_state();
11523
11524
11525 _dl_run_array_forward(_dl_loaded_modules->dynamic_info[32],
11526 _dl_loaded_modules->dynamic_info[33],
11527 _dl_loaded_modules->loadaddr);
11528
11529
11530
11531 for (i = nlist; i; --i) {
11532 tpnt = init_fini_list[i-1];
11533 tpnt->init_fini = ((void *)0);
11534 if (tpnt->init_flag & 0x000004)
11535 continue;
11536 tpnt->init_flag |= 0x000004;
11537
11538 if (tpnt->dynamic_info[12]) {
11539 void (*dl_elf_func) (void);
11540
11541 dl_elf_func = (void (*)(void)) ((Elf32_Addr)__reloc_pointer ((void*)(tpnt->dynamic_info[12]), (tpnt->loadaddr).map));
11542
11543 do {} while (0);
11544
11545 ({ struct funcdesc_value fd = { (void*)(dl_elf_func), (tpnt->loadaddr).got_value }; void (*pf)(void) = (void*) ({ __asm__ ("" : "+m" (*(&fd))); (&fd); }); (* (void(*)(void)) pf)(); });
11546 }
11547
11548 _dl_run_init_array(tpnt);
11549 }
11550
11551
11552 _dl_malloc_function = (void* (*)(size_t)) (intptr_t) _dl_find_hash("_" "malloc",
11553 global_scope, ((void *)0), (0x1), ((void *)0));
11554# 1420 "ldso/ldso/ldso.c"
11555 _dl_debug_addr->r_state = RT_CONSISTENT;
11556 _dl_debug_state();
11557
11558
11559
11560
11561
11562
11563 return (void *) auxvt[9].a_un.a_val;
11564}
11565
11566# 1 "ldso/ldso/dl-hash.c" 1
11567# 40 "ldso/ldso/dl-hash.c"
11568struct dyn_elf *_dl_symbol_tables = ((void *)0);
11569
11570
11571
11572
11573
11574struct dyn_elf *_dl_handles = ((void *)0);
11575# 65 "ldso/ldso/dl-hash.c"
11576static __inline__ Elf_Symndx _dl_elf_hash(const unsigned char *name)
11577{
11578 unsigned long hash=0;
11579 unsigned long tmp;
11580
11581 while (*name) {
11582 hash = (hash << 4) + *name++;
11583 tmp = hash & 0xf0000000;
11584
11585
11586
11587
11588
11589
11590 hash ^= tmp;
11591 hash ^= tmp >> 24;
11592 }
11593 return hash;
11594}
11595
11596
11597
11598
11599
11600
11601struct elf_resolve *_dl_add_elf_hash_table(const char *libname,
11602 struct elf32_fdpic_loadaddr loadaddr, unsigned long *dynamic_info, unsigned long dynamic_addr,
11603 __attribute__ ((unused)) unsigned long dynamic_size)
11604{
11605 Elf_Symndx *hash_addr;
11606 struct elf_resolve *tpnt;
11607 int i;
11608
11609 tpnt = _dl_malloc(sizeof(struct elf_resolve));
11610 _dl_memset(tpnt, 0, sizeof(struct elf_resolve));
11611
11612 if (!_dl_loaded_modules)
11613 _dl_loaded_modules = tpnt;
11614 else {
11615 struct elf_resolve *t = _dl_loaded_modules;
11616 while (t->next)
11617 t = t->next;
11618 t->next = tpnt;
11619 t->next->prev = t;
11620 tpnt = t->next;
11621 }
11622
11623 tpnt->next = ((void *)0);
11624 tpnt->init_flag = 0;
11625 tpnt->libname = _dl_strdup(libname);
11626 tpnt->dynamic_addr = (Elf32_Dyn *)dynamic_addr;
11627 tpnt->libtype = loaded_file;
11628# 140 "ldso/ldso/dl-hash.c"
11629 if (dynamic_info[4] != 0) {
11630 hash_addr = (Elf_Symndx*)dynamic_info[4];
11631 tpnt->nbucket = *hash_addr++;
11632 tpnt->nchain = *hash_addr++;
11633 tpnt->elf_buckets = hash_addr;
11634 hash_addr += tpnt->nbucket;
11635 tpnt->chains = hash_addr;
11636 }
11637 tpnt->loadaddr = loadaddr;
11638 for (i = 0; i < (34 + (1 + 0 + 0) + 0); i++)
11639 tpnt->dynamic_info[i] = dynamic_info[i];
11640 return tpnt;
11641}
11642
11643
11644
11645static __attribute__ ((__noinline__)) const Elf32_Sym *
11646check_match (const Elf32_Sym *sym, char *strtab, const char* undef_name, int type_class)
11647{
11648# 175 "ldso/ldso/dl-hash.c"
11649 if (type_class & (sym->st_shndx == 0))
11650
11651 return ((void *)0);
11652
11653 if (sym->st_value == 0)
11654
11655 return ((void *)0);
11656
11657 if (((sym->st_info) & 0xf) > 2
11658 && ((sym->st_info) & 0xf) != 5)
11659
11660
11661
11662
11663 return ((void *)0);
11664
11665
11666
11667
11668
11669 if (_dl_strcmp(strtab + sym->st_name, undef_name) != 0)
11670 return ((void *)0);
11671
11672
11673 return sym;
11674}
11675# 246 "ldso/ldso/dl-hash.c"
11676static __inline __attribute__ ((__always_inline__)) const Elf32_Sym *
11677_dl_lookup_sysv_hash(struct elf_resolve *tpnt, Elf32_Sym *symtab, unsigned long hash, const char* undef_name, int type_class)
11678{
11679 unsigned long hn;
11680 char *strtab;
11681 const Elf32_Sym *sym;
11682 Elf_Symndx symidx;
11683
11684
11685 ((hn) = (hash) % (tpnt->nbucket));
11686 strtab = (char *) (tpnt->dynamic_info[5]);
11687
11688 ((void)0);
11689
11690 for (symidx = tpnt->elf_buckets[hn]; symidx != 0; symidx = tpnt->chains[symidx]) {
11691 sym = check_match (&symtab[symidx], strtab, undef_name, type_class);
11692 if (sym != ((void *)0))
11693
11694 return sym;
11695 }
11696
11697 return ((void *)0);
11698}
11699
11700
11701
11702
11703
11704char *_dl_find_hash(const char *name, struct r_scope_elem *scope, struct elf_resolve *mytpnt,
11705 int type_class, struct symbol_ref *sym_ref)
11706{
11707 struct elf_resolve *tpnt = ((void *)0);
11708 Elf32_Sym *symtab;
11709 int i = 0;
11710
11711 unsigned long elf_hash_number = 0xffffffff;
11712 const Elf32_Sym *sym = ((void *)0);
11713
11714 char *weak_result = ((void *)0);
11715 struct r_scope_elem *loop_scope;
11716
11717
11718
11719
11720
11721 if ((sym_ref) && (sym_ref->sym) && (((sym_ref->sym->st_other) & 0x03) == 3)) {
11722 sym = sym_ref->sym;
11723 if (mytpnt)
11724 tpnt = mytpnt;
11725 } else
11726 for (loop_scope = scope; loop_scope && !sym; loop_scope = loop_scope->next) {
11727 for (i = 0; i < loop_scope->r_nlist; i++) {
11728 tpnt = loop_scope->r_list[i];
11729
11730 if (!(tpnt->rtld_flags & 0x00100) && mytpnt) {
11731 if (mytpnt == tpnt)
11732 ;
11733 else {
11734 struct init_fini_list *tmp;
11735
11736 for (tmp = mytpnt->rtld_local; tmp; tmp = tmp->next) {
11737 if (tmp->tpnt == tpnt)
11738 break;
11739 }
11740 if (!tmp)
11741 continue;
11742 }
11743 }
11744
11745 if ((type_class & (0x0)) && tpnt->libtype == elf_executable)
11746 continue;
11747
11748
11749 if (tpnt->nbucket == 0)
11750 continue;
11751
11752 symtab = (Elf32_Sym *) (intptr_t) (tpnt->dynamic_info[6]);
11753# 336 "ldso/ldso/dl-hash.c"
11754 if (elf_hash_number == 0xffffffff)
11755 elf_hash_number = _dl_elf_hash((const unsigned char *)name);
11756
11757 sym = _dl_lookup_sysv_hash(tpnt, symtab, elf_hash_number, name, type_class);
11758 if (sym != ((void *)0))
11759
11760 break;
11761
11762
11763
11764 }
11765 }
11766
11767 if (sym) {
11768 if (sym_ref) {
11769 sym_ref->sym = sym;
11770 sym_ref->tpnt = tpnt;
11771 }
11772# 362 "ldso/ldso/dl-hash.c"
11773 switch ((((unsigned char) (sym->st_info)) >> 4)) {
11774 case 2:
11775
11776
11777
11778
11779
11780
11781
11782 case 1:
11783
11784 if (sym_ref)
11785 sym_ref->tpnt = tpnt;
11786
11787 return (char *)(((type_class) & 0x80000000) && (((sym)->st_info) & 0xf) == 2 ? _dl_funcdesc_for ((void *)((Elf32_Addr)__reloc_pointer ((void*)((sym)->st_value), ((tpnt)->loadaddr).map)), (tpnt)->loadaddr.got_value) : ((Elf32_Addr)__reloc_pointer ((void*)((sym)->st_value), ((tpnt)->loadaddr).map)));
11788 default:
11789 break;
11790 }
11791 }
11792
11793 if (sym_ref)
11794 sym_ref->tpnt = tpnt;
11795
11796 return weak_result;
11797}
11798# 1432 "ldso/ldso/ldso.c" 2
11799# 1 "ldso/ldso/dl-elf.c" 1
11800# 37 "ldso/ldso/dl-elf.c"
11801static caddr_t _dl_cache_addr = ((void *)0);
11802static size_t _dl_cache_size = 0;
11803
11804int _dl_map_cache(void)
11805{
11806 int fd;
11807 struct stat st;
11808 header_t *header;
11809 libentry_t *libent;
11810 int i, strtabsize;
11811
11812 if (_dl_cache_addr == ((void *) -1))
11813 return -1;
11814 else if (_dl_cache_addr != ((void *)0))
11815 return 0;
11816
11817 if (_dl_stat("/usr/bfin-linux-uclibc/" "etc/" "ld.so" ".cache", &st)
11818 || (fd = _dl_open("/usr/bfin-linux-uclibc/" "etc/" "ld.so" ".cache", 00|02000000, 0)) < 0) {
11819 _dl_cache_addr = ((void *) -1);
11820 return -1;
11821 }
11822
11823 _dl_cache_size = st.st_size;
11824 _dl_cache_addr = _dl_mmap(0, _dl_cache_size, 0x1, (0x02), fd, 0);
11825 _dl_close(fd);
11826 if ((((void *)_dl_cache_addr) == ((void *) -1))) {
11827 _dl_dprintf(2, "%s:%i: can't map '%s'\n",
11828 _dl_progname, 64, "/usr/bfin-linux-uclibc/" "etc/" "ld.so" ".cache");
11829 return -1;
11830 }
11831
11832 header = (header_t *) _dl_cache_addr;
11833
11834 if (_dl_cache_size < sizeof(header_t) ||
11835 _dl_memcmp(header->magic, "ld.so-", (sizeof "ld.so-" -1))
11836 || _dl_memcmp(header->version, "1.7.0", (sizeof "1.7.0" -1))
11837 || _dl_cache_size <
11838 (sizeof(header_t) + header->nlibs * sizeof(libentry_t))
11839 || _dl_cache_addr[_dl_cache_size - 1] != '\0')
11840 {
11841 _dl_dprintf(2, "%s: cache '%s' is corrupt\n", _dl_progname,
11842 "/usr/bfin-linux-uclibc/" "etc/" "ld.so" ".cache");
11843 goto fail;
11844 }
11845
11846 strtabsize = _dl_cache_size - sizeof(header_t) -
11847 header->nlibs * sizeof(libentry_t);
11848 libent = (libentry_t *) & header[1];
11849
11850 for (i = 0; i < header->nlibs; i++) {
11851 if (libent[i].sooffset >= strtabsize ||
11852 libent[i].liboffset >= strtabsize)
11853 {
11854 _dl_dprintf(2, "%s: cache '%s' is corrupt\n", _dl_progname, "/usr/bfin-linux-uclibc/" "etc/" "ld.so" ".cache");
11855 goto fail;
11856 }
11857 }
11858
11859 return 0;
11860
11861fail:
11862 _dl_munmap(_dl_cache_addr, _dl_cache_size);
11863 _dl_cache_addr = ((void *) -1);
11864 return -1;
11865}
11866
11867int _dl_unmap_cache(void)
11868{
11869 if (_dl_cache_addr == ((void *)0) || _dl_cache_addr == ((void *) -1))
11870 return -1;
11871
11872
11873 _dl_munmap(_dl_cache_addr, _dl_cache_size);
11874 _dl_cache_addr = ((void *)0);
11875
11876
11877 return 0;
11878}
11879
11880
11881
11882void
11883_dl_protect_relro (struct elf_resolve *l)
11884{
11885 Elf32_Addr base = (Elf32_Addr) ((Elf32_Addr)__reloc_pointer ((void*)(l->relro_addr), (l->loadaddr).map));
11886 Elf32_Addr start = (base & (~(_dl_pagesize - 1)));
11887 Elf32_Addr end = ((base + l->relro_size) & (~(_dl_pagesize - 1)));
11888 do {} while (0);
11889 if (start != end &&
11890 _dl_mprotect ((void *) start, end - start, 0x1) < 0) {
11891 _dl_dprintf(2, "%s: cannot apply additional memory protection after relocation", l->libname);
11892 _dl_exit(0);
11893 }
11894}
11895
11896
11897
11898static struct elf_resolve *
11899search_for_named_library(const char *name, unsigned rflags, const char *path_list,
11900 struct dyn_elf **rpnt)
11901{
11902 char *path, *path_n, *mylibname;
11903 struct elf_resolve *tpnt;
11904 int done;
11905
11906 if (path_list==((void *)0))
11907 return ((void *)0);
11908
11909
11910
11911
11912 done = _dl_strlen(path_list);
11913 path = __builtin_alloca (done + 1);
11914
11915
11916 mylibname = __builtin_alloca (2050);
11917
11918 _dl_memcpy(path, path_list, done+1);
11919
11920
11921
11922
11923
11924
11925
11926 done = 0;
11927 path_n = path;
11928 do {
11929 if (*path == 0) {
11930 *path = ':';
11931 done = 1;
11932 }
11933 if (*path == ':') {
11934 *path = 0;
11935 if (*path_n)
11936 _dl_strcpy(mylibname, path_n);
11937 else
11938 _dl_strcpy(mylibname, ".");
11939 _dl_strcat(mylibname, "/");
11940 _dl_strcat(mylibname, name);
11941 if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != ((void *)0))
11942 return tpnt;
11943 path_n = path+1;
11944 }
11945 path++;
11946 } while (!done);
11947 return ((void *)0);
11948}
11949
11950
11951unsigned long _dl_error_number;
11952unsigned long _dl_internal_error_number;
11953
11954struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rpnt,
11955 struct elf_resolve *tpnt, char *full_libname, int __attribute__ ((unused)) trace_loaded_objects)
11956{
11957 char *pnt;
11958 struct elf_resolve *tpnt1;
11959 char *libname;
11960
11961 _dl_internal_error_number = 0;
11962 libname = full_libname;
11963
11964
11965
11966 if (_dl_strlen(full_libname) > 1024)
11967 goto goof;
11968
11969
11970
11971 pnt = _dl_strrchr(libname, '/');
11972 if (pnt) {
11973 libname = pnt + 1;
11974 }
11975
11976 do {} while (0);
11977
11978
11979
11980
11981 if (libname != full_libname) {
11982 do {} while (0);
11983 tpnt1 = _dl_load_elf_shared_library(rflags, rpnt, full_libname);
11984 if (tpnt1) {
11985 return tpnt1;
11986 }
11987 }
11988
11989
11990
11991
11992
11993
11994 pnt = (tpnt ? (char *) tpnt->dynamic_info[15] : ((void *)0));
11995 if (pnt) {
11996 pnt += (unsigned long) tpnt->dynamic_info[5];
11997 do {} while (0);
11998 if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != ((void *)0))
11999 return tpnt1;
12000 }
12001
12002
12003
12004
12005 if (_dl_library_path) {
12006 do {} while (0);
12007 if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt)) != ((void *)0))
12008 {
12009 return tpnt1;
12010 }
12011 }
12012
12013
12014
12015
12016
12017 pnt = (tpnt ? (char *)tpnt->dynamic_info[29] : ((void *)0));
12018 if (pnt) {
12019 pnt += (unsigned long) tpnt->dynamic_info[5];
12020 do {} while (0);
12021 if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != ((void *)0))
12022 return tpnt1;
12023 }
12024# 268 "ldso/ldso/dl-elf.c"
12025 if (_dl_cache_addr != ((void *)0) && _dl_cache_addr != ((void *) -1)) {
12026 int i;
12027 header_t *header = (header_t *) _dl_cache_addr;
12028 libentry_t *libent = (libentry_t *) & header[1];
12029 char *strs = (char *) &libent[header->nlibs];
12030
12031 do {} while (0);
12032 for (i = 0; i < header->nlibs; i++) {
12033 if ((libent[i].flags == 1
12034 || libent[i].flags == 4
12035 || libent[i].flags == 2)
12036 && _dl_strcmp(libname, strs + libent[i].sooffset) == 0
12037 && (tpnt1 = _dl_load_elf_shared_library(rflags, rpnt, strs + libent[i].liboffset))
12038 ) {
12039 return tpnt1;
12040 }
12041 }
12042 }
12043# 297 "ldso/ldso/dl-elf.c"
12044 do {} while (0);
12045 tpnt1 = search_for_named_library(libname, rflags,
12046 "/usr/bfin-linux-uclibc/" "lib:"
12047 "/usr/bfin-linux-uclibc/" "usr/lib"
12048
12049
12050
12051 , rpnt);
12052 if (tpnt1 != ((void *)0))
12053 return tpnt1;
12054
12055goof:
12056
12057 if (_dl_internal_error_number)
12058 _dl_error_number = _dl_internal_error_number;
12059 else
12060 _dl_error_number = 1;
12061 do {} while (0);
12062 return ((void *)0);
12063}
12064
12065
12066;
12067
12068
12069
12070
12071
12072static void *
12073map_writeable (int infile, Elf32_Phdr *ppnt, int piclib, int flags,
12074 unsigned long libaddr)
12075{
12076 int prot_flags = ppnt->p_flags | (1 << 1);
12077 char *status, *retval;
12078 char *tryaddr;
12079 ssize_t size;
12080 unsigned long map_size;
12081 char *cpnt;
12082 char *piclib2map = ((void *)0);
12083
12084 if (piclib == 2 &&
12085# 353 "ldso/ldso/dl-elf.c"
12086 ppnt->p_filesz < ppnt->p_memsz)
12087 {
12088 piclib2map = (char *)
12089 _dl_mmap(0, (ppnt->p_vaddr & (_dl_pagesize - 1)) + ppnt->p_memsz,
12090 ( (((prot_flags) & (1 << 2)) ? 0x1 : 0) | (((prot_flags) & (1 << 1)) ? 0x2 : 0) | (((prot_flags) & (1 << 0)) ? 0x4 : 0)), flags | 0x20, -1, 0);
12091 if ((((void *)piclib2map) == ((void *) -1)))
12092 return 0;
12093 }
12094
12095 tryaddr = piclib == 2 ? piclib2map
12096 : ((char *) (piclib ? libaddr : 0) +
12097 (ppnt->p_vaddr & (~(_dl_pagesize - 1))));
12098
12099 size = (ppnt->p_vaddr & (_dl_pagesize - 1)) + ppnt->p_filesz;
12100
12101
12102
12103
12104
12105
12106 if (piclib2map == 0)
12107
12108 status = (char *) _dl_mmap
12109 (tryaddr, size, ( (((prot_flags) & (1 << 2)) ? 0x1 : 0) | (((prot_flags) & (1 << 1)) ? 0x2 : 0) | (((prot_flags) & (1 << 0)) ? 0x4 : 0)),
12110 flags | (piclib2map ? 0x10 : 0),
12111 infile, ppnt->p_offset & ((~(_dl_pagesize - 1)) & ~(1ul << (sizeof(_dl_pagesize) * 8 - 1))));
12112
12113 else
12114 status = ((void *) -1);
12115
12116
12117 if ((((void *)status) == ((void *) -1)) && piclib2map
12118 && ((_dl_pread((infile), (tryaddr), (size), (ppnt->p_offset & ((~(_dl_pagesize - 1)) & ~(1ul << (sizeof(_dl_pagesize) * 8 - 1))))))
12119 == size))
12120 status = tryaddr;
12121
12122 if ((((void *)status) == ((void *) -1)) || (tryaddr && tryaddr != status))
12123 return 0;
12124
12125 if (piclib2map)
12126 retval = piclib2map;
12127 else
12128 retval = status;
12129# 411 "ldso/ldso/dl-elf.c"
12130 cpnt = (char *) (status + size);
12131
12132
12133
12134 map_size = (ppnt->p_vaddr + ppnt->p_filesz
12135 + (_dl_pagesize - 1)) & (~(_dl_pagesize - 1));
12136
12137 _dl_memset (cpnt, 0,
12138 (((map_size - (ppnt->p_vaddr + ppnt->p_filesz))<(ppnt->p_memsz - ppnt->p_filesz))?(map_size - (ppnt->p_vaddr + ppnt->p_filesz)):(ppnt->p_memsz - ppnt->p_filesz))
12139
12140
12141
12142 );
12143
12144 if (map_size < ppnt->p_vaddr + ppnt->p_memsz && !piclib2map) {
12145 tryaddr = map_size + (char*)(piclib ? libaddr : 0);
12146 status = (char *) _dl_mmap(tryaddr,
12147 ppnt->p_vaddr + ppnt->p_memsz - map_size,
12148 ( (((prot_flags) & (1 << 2)) ? 0x1 : 0) | (((prot_flags) & (1 << 1)) ? 0x2 : 0) | (((prot_flags) & (1 << 0)) ? 0x4 : 0)),
12149 flags | 0x20 | 0x10, -1, 0);
12150 if ((((void *)status) == ((void *) -1)) || tryaddr != status)
12151 return ((void *)0);
12152 }
12153 return retval;
12154}
12155
12156
12157
12158
12159
12160
12161
12162struct elf_resolve *_dl_load_elf_shared_library(unsigned rflags,
12163 struct dyn_elf **rpnt, const char *libname)
12164{
12165 Elf32_Ehdr *epnt;
12166 unsigned long dynamic_addr = 0;
12167 Elf32_Dyn *dpnt;
12168 struct elf_resolve *tpnt;
12169 Elf32_Phdr *ppnt;
12170
12171
12172
12173 char *status, *header;
12174 unsigned long dynamic_info[(34 + (1 + 0 + 0) + 0)];
12175 unsigned long *lpnt;
12176 unsigned long libaddr;
12177 unsigned long minvma = 0xffffffff, maxvma = 0;
12178 unsigned int rtld_flags;
12179 int i, flags, piclib, infile;
12180 Elf32_Addr relro_addr = 0;
12181 size_t relro_size = 0;
12182 struct stat st;
12183 uint32_t *p32;
12184 struct elf32_fdpic_loadaddr lib_loadaddr;
12185 int dl_init_loadaddr_load_count;
12186
12187 libaddr = 0;
12188 infile = _dl_open(libname, 00, 0);
12189 if (infile < 0) {
12190 _dl_internal_error_number = 1;
12191 return ((void *)0);
12192 }
12193
12194 if (_dl_fstat(infile, &st) < 0) {
12195 _dl_internal_error_number = 1;
12196 _dl_close(infile);
12197 return ((void *)0);
12198 }
12199
12200
12201 if (rflags & 0x0001) {
12202 if (!(st.st_mode & 04000)) {
12203 _dl_close(infile);
12204 return ((void *)0);
12205 }
12206 }
12207
12208
12209 for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
12210 if (tpnt->st_dev == st.st_dev && tpnt->st_ino == st.st_ino) {
12211
12212 tpnt->usage_count++;
12213 _dl_close(infile);
12214 return tpnt;
12215 }
12216 }
12217 if (rflags & 0x0002) {
12218 _dl_close(infile);
12219 return ((void *)0);
12220 }
12221 header = _dl_mmap((void *) 0, _dl_pagesize, 0x1 | 0x2,
12222 0x02 | 0x20 | 0x4000000, -1, 0);
12223 if ((((void *)header) == ((void *) -1))) {
12224 _dl_dprintf(2, "%s:%i: can't map '%s'\n", _dl_progname, 505, libname);
12225 _dl_internal_error_number = 6;
12226 _dl_close(infile);
12227 return ((void *)0);
12228 }
12229
12230 _dl_read(infile, header, _dl_pagesize);
12231 epnt = (Elf32_Ehdr *) (intptr_t) header;
12232 p32 = (uint32_t*)&epnt->e_ident;
12233 if (*p32 != ((uint32_t)(0x7f + 0x100 * ('E' + (0x100 * ('L' + 0x100 * 'F')))))) {
12234 _dl_dprintf(2, "%s: '%s' is not an ELF file\n", _dl_progname,
12235 libname);
12236 _dl_internal_error_number = 3;
12237 _dl_close(infile);
12238 _dl_munmap(header, _dl_pagesize);
12239 return ((void *)0);
12240 }
12241
12242 if ((epnt->e_type != 3
12243
12244
12245
12246 ) || (epnt->e_machine != 106
12247
12248
12249
12250 ))
12251 {
12252 _dl_internal_error_number =
12253 (epnt->e_type != 3 ? 5 : 4);
12254 _dl_dprintf(2, "%s: '%s' is not an ELF executable for " "BFIN"
12255 "\n", _dl_progname, libname);
12256 _dl_close(infile);
12257 _dl_munmap(header, _dl_pagesize);
12258 return ((void *)0);
12259 }
12260
12261 ppnt = (Elf32_Phdr *)(intptr_t) & header[epnt->e_phoff];
12262
12263 piclib = 1;
12264 for (i = 0; i < epnt->e_phnum; i++) {
12265
12266 if (ppnt->p_type == 2) {
12267 if (dynamic_addr)
12268 _dl_dprintf(2, "%s: '%s' has more than one dynamic section\n",
12269 _dl_progname, libname);
12270 dynamic_addr = ppnt->p_vaddr;
12271 }
12272
12273 if (ppnt->p_type == 1) {
12274
12275 if (minvma == 0xffffffff && ppnt->p_vaddr > 0x1000000) {
12276 piclib = 0;
12277 minvma = ppnt->p_vaddr;
12278 }
12279 if (piclib && ppnt->p_vaddr < minvma) {
12280 minvma = ppnt->p_vaddr;
12281 }
12282 if (((unsigned long) ppnt->p_vaddr + ppnt->p_memsz) > maxvma) {
12283 maxvma = ppnt->p_vaddr + ppnt->p_memsz;
12284 }
12285 }
12286 if (ppnt->p_type == 7) {
12287# 581 "ldso/ldso/dl-elf.c"
12288 _dl_dprintf(2, "%s: '%s' library contains unsupported TLS\n",
12289 _dl_progname, libname);
12290 _dl_internal_error_number = 8;
12291 _dl_close(infile);
12292 _dl_munmap(header, _dl_pagesize);
12293 return ((void *)0);
12294
12295 }
12296 ppnt++;
12297 }
12298
12299
12300
12301
12302
12303
12304 do { if (((epnt)->e_flags & 0x00000002) && ! ((epnt)->e_flags & 0x00000001)) (piclib) = 2; else { _dl_internal_error_number = 5; _dl_dprintf(2, "%s: '%s' is not an FDPIC shared library" "\n", (_dl_progname), (libname)); _dl_close(infile); return ((void *)0); } } while (0);
12305
12306 maxvma = (maxvma + (_dl_pagesize - 1)) & (~(_dl_pagesize - 1));
12307 minvma = minvma & ~(_dl_pagesize - 1);
12308
12309 flags = 0x02 ;
12310
12311 if (piclib == 0 || piclib == 1) {
12312 status = (char *) _dl_mmap((char *) (piclib ? 0 : minvma),
12313 maxvma - minvma, 0x0, flags | 0x20, -1, 0);
12314 if ((((void *)status) == ((void *) -1))) {
12315 cant_map:
12316 _dl_dprintf(2, "%s:%i: can't map '%s'\n", _dl_progname, 609, libname);
12317 _dl_internal_error_number = 6;
12318 _dl_close(infile);
12319 _dl_munmap(header, _dl_pagesize);
12320 return ((void *)0);
12321 }
12322 libaddr = (unsigned long) status;
12323 flags |= 0x10;
12324 }
12325
12326
12327 ppnt = (Elf32_Phdr *)(intptr_t) & header[epnt->e_phoff];
12328
12329 (dl_init_loadaddr_load_count = __dl_init_loadaddr (&(lib_loadaddr), (ppnt), (epnt->e_phnum)));
12330
12331 ;
12332
12333 for (i = 0; i < epnt->e_phnum; i++) {
12334 if (__dl_is_special_segment(epnt, ppnt)) {
12335 char *addr;
12336
12337 addr = __dl_map_segment (epnt, ppnt, infile, flags);
12338 if (addr == ((void *)0)) {
12339 cant_map1:
12340 (__dl_loadaddr_unmap ((lib_loadaddr), (((void *)0))));
12341 goto cant_map;
12342 }
12343
12344 (__dl_init_loadaddr_hdr ((lib_loadaddr), (addr), (ppnt), dl_init_loadaddr_load_count));
12345 ppnt++;
12346 continue;
12347 }
12348 if (ppnt->p_type == 0x6474e552) {
12349 relro_addr = ppnt->p_vaddr;
12350 relro_size = ppnt->p_memsz;
12351 }
12352 if (ppnt->p_type == 1) {
12353 char *tryaddr;
12354 ssize_t size;
12355
12356 if (ppnt->p_flags & (1 << 1)) {
12357 status = map_writeable (infile, ppnt, piclib, flags, libaddr);
12358 if (status == ((void *)0))
12359 goto cant_map1;
12360 } else {
12361 tryaddr = (piclib == 2 ? 0
12362 : (char *) (ppnt->p_vaddr & (~(_dl_pagesize - 1)))
12363 + (piclib ? libaddr : 0));
12364 size = (ppnt->p_vaddr & (_dl_pagesize - 1)) + ppnt->p_filesz;
12365 status = (char *) _dl_mmap
12366 (tryaddr, size, ( (((ppnt->p_flags) & (1 << 2)) ? 0x1 : 0) | (((ppnt->p_flags) & (1 << 1)) ? 0x2 : 0) | (((ppnt->p_flags) & (1 << 0)) ? 0x4 : 0)),
12367 flags | (piclib == 2 ? 0x01000
12368 | 0x00800 : 0),
12369 infile, ppnt->p_offset & ((~(_dl_pagesize - 1)) & ~(1ul << (sizeof(_dl_pagesize) * 8 - 1))));
12370 if ((((void *)status) == ((void *) -1))
12371 || (tryaddr && tryaddr != status))
12372 goto cant_map1;
12373 }
12374 (__dl_init_loadaddr_hdr ((lib_loadaddr), (status + (ppnt->p_vaddr & (_dl_pagesize - 1))), (ppnt), dl_init_loadaddr_load_count))
12375
12376 ;
12377
12378
12379
12380
12381
12382 }
12383 ppnt++;
12384 }
12385# 686 "ldso/ldso/dl-elf.c"
12386 if (piclib) {
12387
12388 dynamic_addr = (unsigned long) ((Elf32_Addr)__reloc_pointer ((void*)(dynamic_addr), (lib_loadaddr).map));
12389 }
12390# 698 "ldso/ldso/dl-elf.c"
12391 if (!dynamic_addr) {
12392 _dl_internal_error_number = 7;
12393 _dl_dprintf(2, "%s: '%s' is missing a dynamic section\n",
12394 _dl_progname, libname);
12395 _dl_munmap(header, _dl_pagesize);
12396 _dl_close(infile);
12397 return ((void *)0);
12398 }
12399
12400 dpnt = (Elf32_Dyn *) dynamic_addr;
12401 _dl_memset(dynamic_info, 0, sizeof(dynamic_info));
12402 rtld_flags = _dl_parse_dynamic_info(dpnt, dynamic_info, ((void *)0), lib_loadaddr);
12403
12404
12405
12406
12407 if (dynamic_info[22]) {
12408
12409 ppnt = (Elf32_Phdr *)(intptr_t) & header[epnt->e_phoff];
12410 for (i = 0; i < epnt->e_phnum; i++, ppnt++) {
12411 if (ppnt->p_type == 1 && !(ppnt->p_flags & (1 << 1))) {
12412
12413
12414
12415
12416
12417
12418 void *new_addr;
12419 new_addr = map_writeable (infile, ppnt, piclib, flags, libaddr);
12420 if (!new_addr) {
12421 _dl_dprintf(2, "Can't modify %s's text section.",
12422 libname);
12423 _dl_exit(1);
12424 }
12425 (__dl_update_loadaddr_hdr ((lib_loadaddr), (new_addr + (ppnt->p_vaddr & (_dl_pagesize - 1))), (ppnt)))
12426
12427 ;
12428
12429
12430 _dl_parse_dynamic_info(dpnt, dynamic_info, ((void *)0), lib_loadaddr);
12431
12432 }
12433 }
12434
12435
12436
12437
12438
12439
12440 }
12441
12442 _dl_close(infile);
12443
12444 tpnt = _dl_add_elf_hash_table(libname, lib_loadaddr, dynamic_info,
12445 dynamic_addr, 0);
12446 tpnt->mapaddr = libaddr;
12447 tpnt->relro_addr = relro_addr;
12448 tpnt->relro_size = relro_size;
12449 tpnt->st_dev = st.st_dev;
12450 tpnt->st_ino = st.st_ino;
12451 tpnt->ppnt = (Elf32_Phdr *)
12452 ((
12453 Elf32_Addr
12454# 759 "ldso/ldso/dl-elf.c"
12455 )__reloc_pointer ((void*)(epnt->e_phoff), ((tpnt->loadaddr)).map))
12456 ;
12457 tpnt->n_phent = epnt->e_phnum;
12458 tpnt->rtld_flags |= rtld_flags;
12459# 808 "ldso/ldso/dl-elf.c"
12460 if (*rpnt
12461
12462
12463
12464
12465 ) {
12466 (*rpnt)->next = _dl_malloc(sizeof(struct dyn_elf));
12467 _dl_memset((*rpnt)->next, 0, sizeof(struct dyn_elf));
12468 (*rpnt)->next->prev = (*rpnt);
12469 *rpnt = (*rpnt)->next;
12470 }
12471
12472
12473
12474
12475
12476 else {
12477 *rpnt = _dl_symbol_tables = _dl_malloc(sizeof(struct dyn_elf));
12478 _dl_memset(*rpnt, 0, sizeof(struct dyn_elf));
12479 }
12480
12481 (*rpnt)->dyn = tpnt;
12482 tpnt->usage_count++;
12483
12484
12485
12486 tpnt->libtype = elf_lib;
12487# 843 "ldso/ldso/dl-elf.c"
12488 lpnt = (unsigned long *) dynamic_info[3];
12489
12490 if (lpnt) {
12491 lpnt = (unsigned long *) (dynamic_info[3]);
12492 { (tpnt)->loadaddr.got_value = (lpnt); lpnt[0] = ((unsigned long *)&_dl_linux_resolve)[0]; lpnt[1] = ((unsigned long *)&_dl_linux_resolve)[1]; lpnt[2] = (unsigned long) tpnt; };
12493 }
12494# 922 "ldso/ldso/dl-elf.c"
12495 do {} while (0);
12496 do {} while (0);
12497 do {} while (0)
12498 ;
12499
12500 _dl_munmap(header, _dl_pagesize);
12501
12502 return tpnt;
12503}
12504
12505
12506int _dl_fixup(struct dyn_elf *rpnt, struct r_scope_elem *scope, int now_flag)
12507{
12508 int goof = 0;
12509 struct elf_resolve *tpnt;
12510 Elf32_Word reloc_size, relative_count;
12511 Elf32_Addr reloc_addr;
12512
12513 if (rpnt->next)
12514 goof = _dl_fixup(rpnt->next, scope, now_flag);
12515 if (goof)
12516 return goof;
12517 tpnt = rpnt->dyn;
12518
12519 if (!(tpnt->init_flag & 0x000001))
12520 do {} while (0);
12521
12522 if (__builtin_expect((!!(tpnt->dynamic_info[7])),0)) {
12523 do {} while (0)
12524 ;
12525 goof++;
12526 return goof;
12527 }
12528
12529 reloc_size = tpnt->dynamic_info[18];
12530
12531
12532
12533 reloc_size -= tpnt->dynamic_info [2];
12534
12535 if (tpnt->dynamic_info[17] &&
12536 !(tpnt->init_flag & 0x000001)) {
12537 reloc_addr = tpnt->dynamic_info[17];
12538 relative_count = tpnt->dynamic_info[((34 + (1 + 0 + 0) + 0) - (1 + 0 + 0) - 0)];
12539 if (relative_count) {
12540 reloc_size -= relative_count * sizeof(Elf32_Rel);
12541
12542
12543
12544 elf_machine_relative(tpnt->loadaddr, reloc_addr, relative_count);
12545 reloc_addr += relative_count * sizeof(Elf32_Rel);
12546 }
12547 goof += _dl_parse_relocation_information(rpnt, scope,
12548 reloc_addr,
12549 reloc_size);
12550 tpnt->init_flag |= 0x000001;
12551 }
12552 if (tpnt->dynamic_info[24])
12553 now_flag = 0x00002;
12554 if (tpnt->dynamic_info[23] &&
12555 (!(tpnt->init_flag & 0x000002) ||
12556 (now_flag && !(tpnt->rtld_flags & now_flag)))) {
12557 tpnt->rtld_flags |= now_flag;
12558 if (!(tpnt->rtld_flags & 0x00002)) {
12559 _dl_parse_lazy_relocation_information(rpnt,
12560 tpnt->dynamic_info[23],
12561 tpnt->dynamic_info [2]);
12562 } else {
12563 goof += _dl_parse_relocation_information(rpnt, scope,
12564 tpnt->dynamic_info[23],
12565 tpnt->dynamic_info[2]);
12566 }
12567 tpnt->init_flag |= 0x000002;
12568 }
12569# 1006 "ldso/ldso/dl-elf.c"
12570 return goof;
12571}
12572
12573
12574void _dl_dprintf(int fd, const char *fmt, ...)
12575{
12576
12577
12578
12579 int num;
12580
12581 va_list args;
12582 char *start, *ptr, *string;
12583 char *buf;
12584
12585 if (!fmt)
12586 return;
12587
12588 buf = _dl_mmap((void *) 0, _dl_pagesize, 0x1 | 0x2,
12589 0x02 | 0x20, -1, 0);
12590 if ((((void *)buf) == ((void *) -1))) {
12591 _dl_write(fd, "mmap of a spare page failed!\n", 29);
12592 _dl_exit(20);
12593 }
12594
12595 start = ptr = buf;
12596
12597 if (_dl_strlen(fmt) >= (_dl_pagesize - 1)) {
12598 _dl_write(fd, "overflow\n", 11);
12599 _dl_exit(20);
12600 }
12601
12602 _dl_strcpy(buf, fmt);
12603 __builtin_va_start(args,fmt);
12604
12605 while (start) {
12606 while (*ptr != '%' && *ptr) {
12607 ptr++;
12608 }
12609
12610 if (*ptr == '%') {
12611 *ptr++ = '\0';
12612 _dl_write(fd, start, _dl_strlen(start));
12613
12614 switch (*ptr++) {
12615 case 's':
12616 string = __builtin_va_arg(args,char *);
12617
12618 if (!string)
12619 _dl_write(fd, "(null)", 6);
12620 else
12621 _dl_write(fd, string, _dl_strlen(string));
12622 break;
12623
12624 case 'i':
12625 case 'd':
12626 {
12627 char tmp[22];
12628
12629
12630
12631 num = __builtin_va_arg(args,int);
12632
12633 string = _dl_simple_ltoa(tmp, num);
12634 _dl_write(fd, string, _dl_strlen(string));
12635 break;
12636 }
12637 case 'x':
12638 case 'X':
12639 {
12640 char tmp[22];
12641
12642
12643
12644 num = __builtin_va_arg(args,int);
12645
12646 string = _dl_simple_ltoahex(tmp, num);
12647 _dl_write(fd, string, _dl_strlen(string));
12648 break;
12649 }
12650 default:
12651 _dl_write(fd, "(null)", 6);
12652 break;
12653 }
12654
12655 start = ptr;
12656 } else {
12657 _dl_write(fd, start, _dl_strlen(start));
12658 start = ((void *)0);
12659 }
12660 }
12661 _dl_munmap(buf, _dl_pagesize);
12662 return;
12663}
12664
12665char *_dl_strdup(const char *string)
12666{
12667 char *retval;
12668 int len;
12669
12670 len = _dl_strlen(string);
12671 retval = _dl_malloc(len + 1);
12672 _dl_strcpy(retval, string);
12673 return retval;
12674}
12675
12676unsigned int _dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[],
12677 void *debug_addr, struct elf32_fdpic_loadaddr load_off)
12678{
12679 return __dl_parse_dynamic_info(dpnt, dynamic_info, debug_addr, load_off);
12680}
12681# 1432 "ldso/ldso/ldso.c" 2