summaryrefslogtreecommitdiff
path: root/ld/ldexp.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2007-09-18 00:25:07 +0000
committerH.J. Lu <hjl@lucon.org>2007-09-18 00:25:07 +0000
commit3c8bca635ded22b968b65af5fea0169b4e4e2525 (patch)
tree84b90958e6e8fc0eff6964b6a46f78f2c5d1605b /ld/ldexp.h
parent8c472bee43710005d4ce0166f951d87f6ea8997a (diff)
downloadbinutils-redhat-3c8bca635ded22b968b65af5fea0169b4e4e2525.tar.gz
bfd/
2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * elf-bfd.h (elf_obj_tdata): Remove relro. * elf.c (get_program_header_size): Check info->relro instead of elf_tdata (abfd)->relro. (_bfd_elf_map_sections_to_segments): Likewise. (assign_file_positions_for_load_sections): Don't set PT_GNU_RELRO segment alignment here. (assign_file_positions_for_non_load_sections): Properly set up PT_GNU_RELRO segment for copying executable/shared library. (rewrite_elf_program_header): Remove PT_GNU_RELRO segment. (copy_elf_program_header): Set p_size and p_size_valid fields for PT_GNU_RELRO segment. include/elf/ 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * internal.h (elf_segment_map): Add p_size and p_size_valid. (ELF_IS_SECTION_IN_SEGMENT): Allow SHF_TLS sections in PT_GNU_RELRO segments. ld/ 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * ldexp.h (ldexp_control): Add relro, relro_start_stat and relro_end_stat. * ldexp.c (fold_binary): Set expld.dataseg.relro to exp_dataseg_relro_start or exp_dataseg_relro_end when seeing DATA_SEGMENT_ALIGN or DATA_SEGMENT_RELRO_END, respectively. * ldlang.c (lang_size_sections_1): Properly set expld.dataseg.relro_start_stat and expld.dataseg.relro_end_stat. (find_relro_section_callback): New function. (lang_find_relro_sections_1): Likewise. (lang_find_relro_sections): Likewise. (lang_process): Call lang_find_relro_sections for non-relocatable link. ld/testsuite/ 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * ld-elf/binutils.exp: Update "-z relro" tests to use relro1.s. Add "-z relro" tests with relro2.s. Add "-z relro" tests with TLS for objcopy. * ld-elf/relro1.s: New file. * ld-elf/relro2.s: Likewise.
Diffstat (limited to 'ld/ldexp.h')
-rw-r--r--ld/ldexp.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/ldexp.h b/ld/ldexp.h
index 5c8bad22d8..1e0069dc02 100644
--- a/ld/ldexp.h
+++ b/ld/ldexp.h
@@ -98,6 +98,8 @@ typedef enum {
lang_final_phase_enum
} lang_phase_type;
+union lang_statement_union;
+
struct ldexp_control {
/* Modify expression evaluation depending on this. */
lang_phase_type phase;
@@ -125,6 +127,15 @@ struct ldexp_control {
} phase;
bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize;
+
+ enum {
+ exp_dataseg_relro_none,
+ exp_dataseg_relro_start,
+ exp_dataseg_relro_end,
+ } relro;
+
+ union lang_statement_union *relro_start_stat;
+ union lang_statement_union *relro_end_stat;
} dataseg;
};