9f1d377b33
* layout.cc (Layout::Layout): Initialize relro_segment_. (Layout::add_output_section_data): Return the output section. (Layout::make_output_section): Rcognize relro sections and mark them appropriately. (Layout::attach_allocated_section_to_segment): Put relro sections in a PT_GNU_RELRO segment. (Layout::create_initial_dynamic_sections): Mark the .dynamic section as relro. (Layout::segment_precedes): Sort PT_GNU_RELRO segments after PT_TLS segments. (Layout::linkonce_mapping): Map d.rel.ro.local to .data.rel.ro.local. (Layout::output_section_name): Us .data.rel.ro.local for any section which begins with that. * layout.h (class Layout): Update add_output_section_data declaration. Add relro_segment_ field. * output.cc (Output_section::Output_section): Initialize is_relro_ and is_relro_local_ fields. (Output_segment::add_output_section): Group relro sections. (Output_segment::is_first_section_relro): New function. (Output_segment::maximum_alignment): If there is a relro section, align the segment to the common page size. (Output_segment::set_section_addresses): Track whether we are looking at relro sections. If the last section is a relro section, align to the common page size. (Output_segment::set_section_list_addresses): Add in_relro parameter. Change all callers. Align to the page size when moving from relro to non-relro section. (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO segment. * output.h (class Output_section): Add is_relro_ and is_relro_local_ fields. (Output_section::is_relro): New function. (Output_section::set_is_relro): New function. (Output_section::is_relro_local): New function. (Output_section::set_is_relro_local): New function. (class Output_segment): Update declarations. * i386.cc (Target_i386::got_section): Mark .got section as relro. * sparc.cc (Target_sparc::got_section): Likewise. * x86_64.cc (Target_x86_64::got_section): Likewise. * testsuite/relro_test_main.cc: New file. * testsuite/relro_test.cc: New file. * testsuite/Makefile.am (check_PROGRAMS): Add relro_test. (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables. (relro_test_LDFLAGS, relro_test_LDADD): New variables. (relro_test.so, relro_test_pic.o): New targets. * testsuite/Makefile.in: Rebuild. |
||
---|---|---|
.. | ||
basic_test.cc | ||
binary.in | ||
binary_test.cc | ||
binary_unittest.cc | ||
common_test_1.c | ||
constructor_test.cc | ||
debug_msg.cc | ||
debug_msg.sh | ||
exception_test.h | ||
exception_test_1.cc | ||
exception_test_2.cc | ||
exception_test_main.cc | ||
initpri1.c | ||
justsyms.t | ||
justsyms_1.cc | ||
justsyms_2.cc | ||
Makefile.am | ||
Makefile.in | ||
many_sections_test.cc | ||
object_unittest.cc | ||
odr_violation1.cc | ||
odr_violation2.cc | ||
protected_1.cc | ||
protected_2.cc | ||
protected_3.cc | ||
protected_main_1.cc | ||
protected_main_2.cc | ||
protected_main_3.cc | ||
relro_test.cc | ||
relro_test_main.cc | ||
script_test_1.cc | ||
script_test_1.t | ||
script_test_2.cc | ||
script_test_2.t | ||
script_test_2a.cc | ||
script_test_2b.cc | ||
script_test_3.sh | ||
script_test_3.t | ||
script_test_4.sh | ||
script_test_4.t | ||
test.cc | ||
test.h | ||
testfile.cc | ||
testfile.h | ||
testmain.cc | ||
tls_test.cc | ||
tls_test.h | ||
tls_test_c.c | ||
tls_test_file2.cc | ||
tls_test_main.cc | ||
two_file_test.h | ||
two_file_test_1.cc | ||
two_file_test_1b.cc | ||
two_file_test_2.cc | ||
two_file_test_main.cc | ||
undef_symbol.cc | ||
undef_symbol.sh | ||
undef_symbol_main.cc | ||
ver_matching_def.cc | ||
ver_matching_test.sh | ||
ver_test.h | ||
ver_test_1.cc | ||
ver_test_2.cc | ||
ver_test_2.script | ||
ver_test_2.sh | ||
ver_test_3.cc | ||
ver_test_4.cc | ||
ver_test_4.script | ||
ver_test_4.sh | ||
ver_test_5.cc | ||
ver_test_5.script | ||
ver_test_5.sh | ||
ver_test_6.c | ||
ver_test_7.cc | ||
ver_test_7.sh | ||
ver_test_8.script | ||
ver_test_main.cc | ||
ver_test_main_2.cc | ||
version_script.map | ||
weak_alias_test_1.cc | ||
weak_alias_test_2.cc | ||
weak_alias_test_3.cc | ||
weak_alias_test_4.cc | ||
weak_alias_test_main.cc | ||
weak_test.cc | ||
weak_undef.h | ||
weak_undef_file1.cc | ||
weak_undef_file2.cc | ||
weak_undef_test.cc |