OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.8 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../binutils/binutils-ld-fix-static-linking.patch
  5. # Copyright (C) 2015 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. This fixes static linking for our hardened toolchain
  17. diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
  18. index e8126cb..9532bfb 100644
  19. --- a/ld/scripttempl/elf.sc
  20. +++ b/ld/scripttempl/elf.sc
  21. @@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
  22. if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
  23. SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
  24. SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
  25. - CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
  26. - DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
  27. + CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
  28. + DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
  29. else
  30. SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
  31. SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
  32. @@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
  33. doesn't matter which directory crtbegin.o
  34. is in. */
  35. - KEEP (*crtbegin.o(.ctors))
  36. - KEEP (*crtbegin?.o(.ctors))
  37. + KEEP (*crtbegin*.o(.ctors))
  38. /* We don't want to include the .ctor section from
  39. the crtend.o file until after the sorted ctors.
  40. The .ctor section from the crtend file contains the
  41. end of ctors marker and it must be last */
  42. - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
  43. + KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
  44. KEEP (*(SORT(.ctors.*)))
  45. KEEP (*(.ctors))
  46. ${CONSTRUCTING+${CTOR_END}}
  47. @@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
  48. DTOR=".dtors ${CONSTRUCTING-0} :
  49. {
  50. ${CONSTRUCTING+${DTOR_START}}
  51. - KEEP (*crtbegin.o(.dtors))
  52. - KEEP (*crtbegin?.o(.dtors))
  53. - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
  54. + KEEP (*crtbegin*.o(.dtors))
  55. + KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
  56. KEEP (*(SORT(.dtors.*)))
  57. KEEP (*(.dtors))
  58. ${CONSTRUCTING+${DTOR_END}}