diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-10-13 05:18:13 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-10-13 05:18:24 -0700 |
commit | 6bf4a34047452f882c5cc66bd85812ee1bb5a41c (patch) | |
tree | 2d96b0c8ef59de1d9e026497798470bc9504bb08 /gold/testsuite/Makefile.in | |
parent | aac1d94f19492fb6bea7193497bce599952c429d (diff) | |
download | gdb-6bf4a34047452f882c5cc66bd85812ee1bb5a41c.zip gdb-6bf4a34047452f882c5cc66bd85812ee1bb5a41c.tar.gz gdb-6bf4a34047452f882c5cc66bd85812ee1bb5a41c.tar.bz2 |
gold: Properly align the NT_GNU_PROPERTY_TYPE_0 note
The NT_GNU_PROPERTY_TYPE_0 note should be aligned to 8 bytes for 64-bit
ELF as specified by gABI. A note section can be only placed in a PT_NOTE
segment with the same alignment.
PR gold/22914
PR gold/23535
* layout.cc (Layout::attach_allocated_section_to_segment): Place
a note section in a PT_NOTE segment with the same alignment. Set
the alignment of the PT_NOTE segment from the alignment of the
note section.
(Layout::create_note): Align the NT_GNU_PROPERTY_TYPE_0 note to 8
bytes for 64-bit ELF.
(Layout::segment_precedes): Place segments with larger alignments
first.
* output.cc (Output_segment::Output_segment): Initialize align_.
* output.h (Output_segment): Add align, set_align and align_.
* testsuite/Makefile.am (gnu_property_test.stdout): Pass -lhSWn
to $(TEST_READELF).
(gnu_property_test): Pass --build-id to ld.
* testsuite/Makefile.in: Regenerated.
* testsuite/gnu_property_test.sh (check_alignment): New.
Use check_alignment to check the NT_GNU_PROPERTY_TYPE_0 note
alignment. Verify that there are 2 PT_NOTE segments.
Diffstat (limited to 'gold/testsuite/Makefile.in')
-rw-r--r-- | gold/testsuite/Makefile.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index dfcafcd..35c442e 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -9525,9 +9525,9 @@ uninstall-am: @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -Wa,-madd-bnd-prefix -o $@ $< @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_test.stdout: gnu_property_test -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -n $< >$@ +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -lhSWn $< >$@ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_test: gcctestdir/ld gnu_property_a.o gnu_property_b.o gnu_property_c.o -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -o $@ gnu_property_a.o gnu_property_b.o gnu_property_c.o +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld --build-id -o $@ gnu_property_a.o gnu_property_b.o gnu_property_c.o @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_main.o: gnu_property_main.c @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_a.o: gnu_property_a.S |