uClibc NPTL: remove the pthread daemon() fix and revert r15343
[openwrt/staging/chunkeey.git] / toolchain / uClibc / patches-0.9.28 / 409-ldso-avr32-startup-hack.patch
1 Subject: [PATCH] ldso: AVR32 startup hack
2
3 AVR32 needs to do both PERFORM_BOOTSTRAP_GOT and a full relocation of
4 the GOT. I don't quite remember why, but I think it's because some GOT
5 entries just need the load address added to them, while the rest need
6 the full relocation code.
7
8 This patch should be revisited to figure out whether we're processing
9 relocations against undefined symbols and whether that's something we
10 should be doing...
11
12 ---
13
14 ldso/ldso/dl-startup.c | 6 ++++--
15 1 file changed, 4 insertions(+), 2 deletions(-)
16
17 Index: uClibc-0.9.28/ldso/ldso/dl-startup.c
18 ===================================================================
19 --- uClibc-0.9.28.orig/ldso/ldso/dl-startup.c 2006-02-07 16:49:27.000000000 +0100
20 +++ uClibc-0.9.28/ldso/ldso/dl-startup.c 2006-02-07 17:12:09.000000000 +0100
21 @@ -217,7 +217,9 @@ static void * __attribute_used__ _dl_sta
22 /* some arches (like MIPS) we have to tweak the GOT before relocations */
23 PERFORM_BOOTSTRAP_GOT(tpnt);
24
25 -#else
26 +#endif
27 +
28 +#if !defined(PERFORM_BOOTSTRAP_GOT) || defined(__avr32__)
29
30 /* OK, now do the relocations. We do not do a lazy binding here, so
31 that once we are done, we have considerably more flexibility. */
32 @@ -259,7 +261,7 @@ static void * __attribute_used__ _dl_sta
33 rel_addr += relative_count * sizeof(ELF_RELOC);;
34 }
35
36 - rpnt = (ELF_RELOC *) (rel_addr + load_addr);
37 + rpnt = (ELF_RELOC *) (rel_addr /* + load_addr */);
38 for (i = 0; i < rel_size; i += sizeof(ELF_RELOC), rpnt++) {
39 reloc_addr = (unsigned long *) (load_addr + (unsigned long) rpnt->r_offset);
40 symtab_index = ELF_R_SYM(rpnt->r_info);