409-ldso-avr32-startup-hack.patch 1.6 KB

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