elf64-ppc.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* PowerPC64-specific support for 64-bit ELF.
  2. Copyright (C) 2002-2022 Free Software Foundation, Inc.
  3. This file is part of BFD, the Binary File Descriptor library.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. /* Used to pass info between ld and bfd. */
  17. struct ppc64_elf_params
  18. {
  19. /* Linker stub bfd. */
  20. bfd *stub_bfd;
  21. /* Linker call-backs. */
  22. asection * (*add_stub_section) (const char *, asection *);
  23. void (*layout_sections_again) (void);
  24. void (*edit) (void);
  25. /* Maximum size of a group of input sections that can be handled by
  26. one stub section. A value of +/-1 indicates the bfd back-end
  27. should use a suitable default size. */
  28. bfd_signed_vma group_size;
  29. /* Whether to use a special call stub for __tls_get_addr. */
  30. int tls_get_addr_opt;
  31. /* Whether the special call stub should save r4..r12. */
  32. int no_tls_get_addr_regsave;
  33. /* Whether to allow multiple toc sections. */
  34. int no_multi_toc;
  35. /* Set if PLT call stubs should load r11. */
  36. int plt_static_chain;
  37. /* Set if PLT call stubs need to be thread safe on power7+. */
  38. int plt_thread_safe;
  39. /* Set if individual PLT call stubs should be aligned. */
  40. int plt_stub_align;
  41. /* Set if PLT call stubs for localentry:0 functions should omit r2 save. */
  42. int plt_localentry0;
  43. /* Whether to use power10 instructions in linkage stubs. */
  44. int power10_stubs;
  45. /* Whether R_PPC64_PCREL_OPT should be ignored. */
  46. int no_pcrel_opt;
  47. /* Whether to canonicalize .opd so that there are no overlapping
  48. .opd entries. */
  49. int non_overlapping_opd;
  50. /* Whether to emit symbols for stubs. */
  51. int emit_stub_syms;
  52. /* Whether to generate out-of-line register save/restore for gcc -Os code. */
  53. int save_restore_funcs;
  54. /* Set when a potential variable is detected in .toc. */
  55. int object_in_toc;
  56. };
  57. bool ppc64_elf_init_stub_bfd
  58. (struct bfd_link_info *, struct ppc64_elf_params *);
  59. bool ppc64_elf_edit_opd
  60. (struct bfd_link_info *);
  61. bool ppc64_elf_inline_plt
  62. (struct bfd_link_info *);
  63. bool ppc64_elf_tls_setup
  64. (struct bfd_link_info *);
  65. bool ppc64_elf_tls_optimize
  66. (struct bfd_link_info *);
  67. bool ppc64_elf_edit_toc
  68. (struct bfd_link_info *);
  69. bool ppc64_elf_has_small_toc_reloc
  70. (asection *);
  71. bfd_vma ppc64_elf_set_toc
  72. (struct bfd_link_info *, bfd *);
  73. int ppc64_elf_setup_section_lists
  74. (struct bfd_link_info *);
  75. void ppc64_elf_start_multitoc_partition
  76. (struct bfd_link_info *);
  77. bool ppc64_elf_next_toc_section
  78. (struct bfd_link_info *, asection *);
  79. bool ppc64_elf_layout_multitoc
  80. (struct bfd_link_info *);
  81. void ppc64_elf_finish_multitoc_partition
  82. (struct bfd_link_info *);
  83. bool ppc64_elf_check_init_fini
  84. (struct bfd_link_info *);
  85. bool ppc64_elf_next_input_section
  86. (struct bfd_link_info *, asection *);
  87. bool ppc64_elf_size_stubs
  88. (struct bfd_link_info *);
  89. bool ppc64_elf_build_stubs
  90. (struct bfd_link_info *, char **);