binutils-gdb/ld/testsuite/ld-plugin/pr22983a.c
H.J. Lu 416c34d683 Set non_ir_ref_dynamic if a symbol is made dynamic
If a symbol is made dynamic by --dynamic-list, it has non-IR reference.

bfd/

	PR ld/22983
	* elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
	non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.

ld/

	PR ld/22983
	* testsuite/ld-plugin/lto.exp: Run PR ld/22983 test.
	* testsuite/ld-plugin/pr22983.d: New file.
	* testsuite/ld-plugin/pr22983.t: Likewise.
	* testsuite/ld-plugin/pr22983a.c: Likewise.
	* testsuite/ld-plugin/pr22983b.c: Likewise.
2018-03-20 03:51:48 -07:00

15 lines
387 B
C

#include <stdio.h>
int func_attr_used_disabled(int val);
int func_attr_used_enabled(int val);
extern int var_attr_used_enabled;
extern int var_attr_used_disabled;
int main(int argc, const char **argv){
printf("%d\n", var_attr_used_disabled);
printf("%d\n", var_attr_used_enabled);
printf("%d\n", func_attr_used_disabled(1));
printf("%d\n", func_attr_used_enabled(1));
return 0;
}