• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision493f652c956f2037c1c638c1887b634d67da0835 (tree)
l'heure2016-04-30 00:27:29
AuteurH.J. Lu <hjl.tools@gmai...>
CommiterH.J. Lu

Message de Log

Set interpreter in x86 create_dynamic_sections

Set interpreter in x86 create_dynamic_sections to make this information
available to x86 check_relocs.

* elf32-i386.c (elf_i386_size_dynamic_sections): Move interp
setting to ...
(elf_i386_create_dynamic_sections): Here.
* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Move
interp setting to ...
(elf_x86_64_create_dynamic_sections): Here.

Change Summary

Modification

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,14 @@
11 2016-04-29 H.J. Lu <hongjiu.lu@intel.com>
22
3+ * elf32-i386.c (elf_i386_size_dynamic_sections): Move interp
4+ setting to ...
5+ (elf_i386_create_dynamic_sections): Here.
6+ * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Move
7+ interp setting to ...
8+ (elf_x86_64_create_dynamic_sections): Here.
9+
10+2016-04-29 H.J. Lu <hongjiu.lu@intel.com>
11+
312 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take GOT_RELOC
413 and replace (EH)->has_got_reloc with GOT_RELOC.
514 (elf_i386_fixup_symbol): Pass has_got_reloc to
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1066,6 +1066,17 @@ elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
10661066 if (htab == NULL)
10671067 return FALSE;
10681068
1069+ /* Set the contents of the .interp section to the interpreter. */
1070+ if (bfd_link_executable (info) && !info->nointerp)
1071+ {
1072+ asection *s = bfd_get_linker_section (dynobj, ".interp");
1073+ if (s == NULL)
1074+ abort ();
1075+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
1076+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
1077+ htab->interp = s;
1078+ }
1079+
10691080 htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss");
10701081 if (!htab->sdynbss)
10711082 abort ();
@@ -3089,20 +3100,6 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
30893100 if (dynobj == NULL)
30903101 abort ();
30913102
3092- if (htab->elf.dynamic_sections_created)
3093- {
3094- /* Set the contents of the .interp section to the interpreter. */
3095- if (bfd_link_executable (info) && !info->nointerp)
3096- {
3097- s = bfd_get_linker_section (dynobj, ".interp");
3098- if (s == NULL)
3099- abort ();
3100- s->size = sizeof ELF_DYNAMIC_INTERPRETER;
3101- s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
3102- htab->interp = s;
3103- }
3104- }
3105-
31063103 /* Set up .got offsets for local syms, and space for local dynamic
31073104 relocs. */
31083105 for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1109,6 +1109,17 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
11091109 if (htab == NULL)
11101110 return FALSE;
11111111
1112+ /* Set the contents of the .interp section to the interpreter. */
1113+ if (bfd_link_executable (info) && !info->nointerp)
1114+ {
1115+ asection *s = bfd_get_linker_section (dynobj, ".interp");
1116+ if (s == NULL)
1117+ abort ();
1118+ s->size = htab->dynamic_interpreter_size;
1119+ s->contents = (unsigned char *) htab->dynamic_interpreter;
1120+ htab->interp = s;
1121+ }
1122+
11121123 htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss");
11131124 if (!htab->sdynbss)
11141125 abort ();
@@ -3446,20 +3457,6 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
34463457 if (dynobj == NULL)
34473458 abort ();
34483459
3449- if (htab->elf.dynamic_sections_created)
3450- {
3451- /* Set the contents of the .interp section to the interpreter. */
3452- if (bfd_link_executable (info) && !info->nointerp)
3453- {
3454- s = bfd_get_linker_section (dynobj, ".interp");
3455- if (s == NULL)
3456- abort ();
3457- s->size = htab->dynamic_interpreter_size;
3458- s->contents = (unsigned char *) htab->dynamic_interpreter;
3459- htab->interp = s;
3460- }
3461- }
3462-
34633460 /* Set up .got offsets for local syms, and space for local dynamic
34643461 relocs. */
34653462 for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)