fix-dwarf-fdpic.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Fix DWARF compilation for FDPIC targets
  2. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  3. diff -Nur gcc-6.1.0.orig/libgcc/unwind-dw2-fde-dip.c gcc-6.1.0/libgcc/unwind-dw2-fde-dip.c
  4. --- gcc-6.1.0.orig/libgcc/unwind-dw2-fde-dip.c 2016-01-04 15:30:50.000000000 +0100
  5. +++ gcc-6.1.0/libgcc/unwind-dw2-fde-dip.c 2016-08-05 02:17:40.424195128 +0200
  6. @@ -124,7 +124,11 @@
  7. {
  8. _Unwind_Ptr pc_low;
  9. _Unwind_Ptr pc_high;
  10. +#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
  11. + struct elf32_fdpic_loadaddr load_base;
  12. +#else
  13. _Unwind_Ptr load_base;
  14. +#endif
  15. const ElfW(Phdr) *p_eh_frame_hdr;
  16. const ElfW(Phdr) *p_dynamic;
  17. struct frame_hdr_cache_element *link;
  18. @@ -163,7 +167,7 @@
  19. struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
  20. const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
  21. long n, match;
  22. -#ifdef __FRV_FDPIC__
  23. +#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
  24. struct elf32_fdpic_loadaddr load_base;
  25. #else
  26. _Unwind_Ptr load_base;
  27. @@ -347,7 +351,7 @@
  28. break;
  29. }
  30. }
  31. -# elif defined __FRV_FDPIC__ && defined __linux__
  32. +# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__
  33. data->dbase = load_base.got_value;
  34. # else
  35. # error What is DW_EH_PE_datarel base on this platform?