0009-arm-pie-tls.diff 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- binutils-2.25.1/bfd/elf32-arm.c.orig 2019-10-06 20:40:39.213623570 -0400
  2. +++ binutils-2.25.1/bfd/elf32-arm.c 2019-10-06 20:45:09.688207243 -0400
  3. @@ -4097,7 +4097,7 @@
  4. {
  5. int is_local = (h == NULL);
  6. - if (info->shared || (h && h->root.type == bfd_link_hash_undefweak))
  7. + if (!info->executable || (h && h->root.type == bfd_link_hash_undefweak))
  8. return r_type;
  9. /* We do not support relaxations for Old TLS models. */
  10. @@ -9493,7 +9493,7 @@
  11. {
  12. /* If we don't know the module number, create a relocation
  13. for it. */
  14. - if (info->shared)
  15. + if (!info->executable)
  16. {
  17. Elf_Internal_Rela outrel;
  18. @@ -9581,7 +9581,7 @@
  19. now, and emit any relocations. If both an IE GOT and a
  20. GD GOT are necessary, we emit the GD first. */
  21. - if ((info->shared || indx != 0)
  22. + if ((!info->executable || indx != 0)
  23. && (h == NULL
  24. || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
  25. || h->root.type != bfd_link_hash_undefweak))
  26. @@ -9597,7 +9597,7 @@
  27. /* We should have relaxed, unless this is an undefined
  28. weak symbol. */
  29. BFD_ASSERT ((h && (h->root.type == bfd_link_hash_undefweak))
  30. - || info->shared);
  31. + || !info->executable);
  32. BFD_ASSERT (globals->sgotplt_jump_table_size + offplt + 8
  33. <= globals->root.sgotplt->size);
  34. @@ -13504,7 +13504,7 @@
  35. indx = h->dynindx;
  36. if (tls_type != GOT_NORMAL
  37. - && (info->shared || indx != 0)
  38. + && (!info->executable || indx != 0)
  39. && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
  40. || h->root.type != bfd_link_hash_undefweak))
  41. {