aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/Makefile.am
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-08-19 22:50:16 +0000
committerIan Lance Taylor <ian@airs.com>2010-08-19 22:50:16 +0000
commit7223e9ca5a5ab5eecd2d14328ceade93bcb43f3d (patch)
tree81c490fb8d11c59cbbe1d34b4048a471e7fc6def /gold/testsuite/Makefile.am
parent43f3e2ee9482fd01e24eea4fed81856518ec2329 (diff)
downloadgdb-7223e9ca5a5ab5eecd2d14328ceade93bcb43f3d.zip
gdb-7223e9ca5a5ab5eecd2d14328ceade93bcb43f3d.tar.gz
gdb-7223e9ca5a5ab5eecd2d14328ceade93bcb43f3d.tar.bz2
PR 10893
* i386.cc (class Output_data_plt_i386): Update declarations. Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and local_ifuncs_ fields. (Target_i386::do_plt_section_for_global): New function. (Target_i386::do_plt_section_for_local): New function. (Output_data_plt_i386::Output_data_plt_i386): Add symtab parameter; change all callers. Initialize global_ifuncs_ and local_ifuncs_. If doing a static link define __rel_iplt_start and __rel_iplt_end. (Output_data_plt_i386::add_entry): Handle IFUNC symbols. (Output_data_plt_i386::add_local_ifunc_entry): New function. (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC symbols. (Target_i386::make_plt_section): New function, broken out of make_plt_entry. Set sh_info field of .rel.plt to point to .plt. (Target_i386::make_plt_entry): Call make_plt_section. (Target_i386::make_local_ifunc_plt_entry): New function. (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function. (Target_i386::Scan::local): Handle IFUNC symbols. Add R_386_IRELATIVE to switch. (Target_i386::Scan::global): Likewise. (Target_i386::Relocate::relocate): Likewise. (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to switch. * x86_64.cc (class Output_data_plt_x86_64): Update declarations. (Target_x86_64::do_plt_section_for_global): New function. (Target_x86_64::do_plt_section_for_local): New function. (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab parameter; change all callers. If doing a static link define __rela_iplt_start and __rela_iplt_end. (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols. (Output_data_plt_x86_64::add_local_ifunc_entry): New function. (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt to point to .plt. (Target_x86_64::make_local_ifunc_plt_entry): New function. (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to switch. (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function. (Target_x86_64::Scan::local): Handle IFUNC symbols. Add R_X86_64_IRELATIVE to switch. (Target_x86_64::Scan::global): Likewise. (Target_x86_64::Relocate::relocate): Likewise. (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to switch. * target.h (class Target): Add plt_section_for_global and plt_section_for_local functions. Add do_plt_section_for_global and do_plt_section_for_local virtual functions. * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add clarifying comments. (Symbol::use_plt_offset): Handle IFUNC symbol. * object.cc (Sized_relobj::Sized_relobj): Initialize local_plt_offsets_. (Sized_relobj::local_has_plt_offset): New function. (Sized_relobj::local_plt_offset): New function. (Sized_relobj::set_local_plt_offset): New function. (Sized_relobj::do_count): Handle IFUNC symbol. * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take a bit away from input_shndx_ field. Add set_is_func_symbol and is_ifunc_symbol functions. (class Sized_relobj): Update declarations. Remove Tls_got_entry and Local_tls_got_offsets. Define Local_plt_offsets. Add local_plt_offsets_ field. (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_. * output.h (class Output_section_data): Add non-const output_section function. (class Output_data_got): Update declarations. (class Output_data_got::Got_entry): Add use_plt_offset_ field. Add use_plt_offset parameter to global and local constructors. Change all callers. Change local_sym_index_ field to 31 bits. Change GSYM_CODE and CONSTANT_CODE accordingly. * output.cc (Output_data_reloc_base::do_adjust_output_section): If doing a static link don't set sh_link field. (Output_data_got::Got_entry::write): Use PLT offset if appropriate. (Output_data_got::add_global_plt): New function. (Output_data_got::add_local_plt): New function. * target-reloc.h (relocate_section): Handle IFUNC symbol. * defstd.cc (in_section): Remove entries for __rel_iplt_start, __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end. * configure.ac: Set IFUNC automake conditional for glibc >= 2.11. * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within IFUNC conditional. * testsuite/ifunc-sel.h: New file. * testsuite/ifuncmain1.c: New file. * testsuite/ifuncmain1vis.c: New file. * testsuite/ifuncmod1.c: New file. * testsuite/ifuncdep2.c: New file. * testsuite/ifuncmain2.c: New file. * testsuite/ifuncmain3.c: New file. * testsuite/ifuncmod3.c: New file. * testsuite/ifuncmain4.c: New file. * testsuite/ifuncmain5.c: New file. * testsuite/ifuncmod5.c: New file. * testsuite/ifuncmain6pie.c: New file. * testsuite/ifuncmod6.c: New file. * testsuite/ifuncmain7.c: New file. * configure, testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r--gold/testsuite/Makefile.am202
1 files changed, 202 insertions, 0 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index ab3ca55..0aac007 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -1530,6 +1530,208 @@ no_version_test.o: no_version_test.c
no_version_test.stdout: libno_version_test.so
$(TEST_OBJDUMP) -h $< > $@
+# Test STT_GNU_IFUNC symbols.
+if IFUNC
+
+ifuncmod1.o: ifuncmod1.c
+ $(COMPILE) -c -fpic -o $@ $<
+ifuncmod1.so: ifuncmod1.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -shared ifuncmod1.o
+
+ifuncdep1.o: ifuncmod1.c
+ $(COMPILE) -c -o $@ $<
+
+ifuncmain1pic.o: ifuncmain1.c
+ $(COMPILE) -c -fpic -o $@ $<
+ifuncmain1pie.o: ifuncmain1.c
+ $(COMPILE) -c -fpie -o $@ $<
+
+check_PROGRAMS += ifuncmain1static
+ifuncmain1static_SOURCES = ifuncmain1.c
+ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
+ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
+ifuncmain1static_LDADD = ifuncdep1.o
+
+check_PROGRAMS += ifuncmain1picstatic
+ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
+
+check_PROGRAMS += ifuncmain1
+ifuncmain1_SOURCES = ifuncmain1.c
+ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
+ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+ifuncmain1_LDADD = ifuncmod1.so
+
+check_PROGRAMS += ifuncmain1pic
+ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
+
+check_PROGRAMS += ifuncmain1vis
+ifuncmain1vis_SOURCES = ifuncmain1vis.c
+ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
+ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+ifuncmain1vis_LDADD = ifuncmod1.so
+
+check_PROGRAMS += ifuncmain1vispic
+ifuncmain1vispic.o: ifuncmain1vis.c
+ $(COMPILE) -c -fpic -o $@ $<
+ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
+
+check_PROGRAMS += ifuncmain1staticpic
+ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
+
+check_PROGRAMS += ifuncmain1pie
+ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
+
+check_PROGRAMS += ifuncmain1vispie
+ifuncmain1vispie.o: ifuncmain1vis.c
+ $(COMPILE) -c -fpie -o $@ $<
+ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
+
+check_PROGRAMS += ifuncmain1staticpie
+ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
+
+ifuncmain2pic.o: ifuncmain2.c
+ $(COMPILE) -c -fpic -o $@ $<
+
+ifuncdep2pic.o: ifuncdep2.c
+ $(COMPILE) -c -fpic -o $@ $<
+
+check_PROGRAMS += ifuncmain2static
+ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
+ifuncmain2static_DEPENDENCIES = gcctestdir/ld
+ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
+
+check_PROGRAMS += ifuncmain2picstatic
+ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
+
+check_PROGRAMS += ifuncmain2
+ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
+ifuncmain2_DEPENDENCIES = gcctestdir/ld
+ifuncmain2_LDFLAGS = -Bgcctestdir/
+
+check_PROGRAMS += ifuncmain2pic
+ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
+
+ifuncmod3.o: ifuncmod3.c
+ $(COMPILE) -c -fpic -o $@ $<
+ifuncmod3.so: ifuncmod3.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -shared ifuncmod3.o
+
+check_PROGRAMS += ifuncmain3
+ifuncmain3_SOURCES = ifuncmain3.c
+ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
+ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
+ifuncmain3_LDADD = -ldl
+
+ifuncmain4pic.o: ifuncmain4.c
+ $(COMPILE) -c -fpic -o $@ $<
+
+check_PROGRAMS += ifuncmain4static
+ifuncmain4static_SOURCES = ifuncmain4.c
+ifuncmain4static_DEPENDENCIES = gcctestdir/ld
+ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
+
+check_PROGRAMS += ifuncmain4picstatic
+ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
+
+check_PROGRAMS += ifuncmain4
+ifuncmain4_SOURCES = ifuncmain4.c
+ifuncmain4_DEPENDENCIES = gcctestdir/ld
+ifuncmain4_LDFLAGS = -Bgcctestdir/
+
+ifuncmain5pic.o: ifuncmain5.c
+ $(COMPILE) -c -fpic -o $@ $<
+
+ifuncmain5pie.o: ifuncmain5.c
+ $(COMPILE) -c -fpie -o $@ $<
+
+ifuncmod5.o: ifuncmod5.c
+ $(COMPILE) -c -fpic -o $@ $<
+ifuncmod5.so: ifuncmod5.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -shared ifuncmod5.o
+
+ifuncdep5.o: ifuncmod5.c
+ $(COMPILE) -c -o $@ $<
+
+check_PROGRAMS += ifuncmain5static
+ifuncmain5static_SOURCES = ifuncmain5.c
+ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
+ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
+ifuncmain5static_LDADD = ifuncdep5.o
+
+check_PROGRAMS += ifuncmain5picstatic
+ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
+
+check_PROGRAMS += ifuncmain5
+ifuncmain5_SOURCES = ifuncmain5.c
+ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
+ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+ifuncmain5_LDADD = ifuncmod5.so
+
+check_PROGRAMS += ifuncmain5pic
+ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
+
+check_PROGRAMS += ifuncmain5staticpic
+ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
+
+check_PROGRAMS += ifuncmain5pie
+ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
+
+ifuncmain6pie.o: ifuncmain6pie.c
+ $(COMPILE) -c -fpie -o $@ $<
+
+ifuncmod6.o: ifuncmod6.c
+ $(COMPILE) -c -fpic -o $@ $<
+ifuncmod6.so: ifuncmod6.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
+
+check_PROGRAMS += ifuncmain6pie
+ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
+
+ifuncmain7pic.o: ifuncmain7.c
+ $(COMPILE) -c -fpic -o $@ $<
+
+ifuncmain7pie.o: ifuncmain7.c
+ $(COMPILE) -c -fpie -o $@ $<
+
+check_PROGRAMS += ifuncmain7static
+ifuncmain7static_SOURCES = ifuncmain7.c
+ifuncmain7static_DEPENDENCIES = gcctestdir/ld
+ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
+
+check_PROGRAMS += ifuncmain7picstatic
+ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
+
+check_PROGRAMS += ifuncmain7
+ifuncmain7_SOURCES = ifuncmain7.c
+ifuncmain7_DEPENDENCIES = gcctestdir/ld
+ifuncmain7_LDFLAGS = -Bgcctestdir/
+
+check_PROGRAMS += ifuncmain7pic
+ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ ifuncmain7pic.o
+
+check_PROGRAMS += ifuncmain7pie
+ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
+ $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
+
+endif IFUNC
+
# Test that strong reference to a weak symbol in a DSO remains strong.
check_SCRIPTS += strong_ref_weak_def.sh
check_DATA += strong_ref_weak_def.stdout