binutils-gdb/ld/testsuite/ld-plugin/lto-19a.c
Alan Modra b1a92c635c PR26806, Suspected linker bug with LTO
This patch reverts most of git commit 1e3b96fd6c, so IR symbols are
again not marked def_regular or ref_regular.  That should be enough to
stop IR symbols from becoming dynamic.  To mark as-needed shared
libraries referenced by IR symbols, use the referencing BFD rather
than the ref flags.

bfd/
	PR 15146
	PR 26314
	PR 26530
	PR 26806
	* elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
	for plugin syms.  Do allow plugin syms to mark as-needed libs.
ld/
	PR 26806
	* testsuite/ld-plugin/lto-19.h,
	* testsuite/ld-plugin/lto-19a.c,
	* testsuite/ld-plugin/lto-19b.c,
	* testsuite/ld-plugin/lto-19c.c: New test.
	* testsuite/ld-plugin/pr26806.c,
	* testsuite/ld-plugin/pr26806.d: New test.
	* testsuite/ld-plugin/lto.exp: Run them.
2020-11-02 09:39:53 +10:30

20 lines
365 B
C

#include <stdio.h>
#include <stdlib.h>
#include "lto-19.h"
static const int utf8_sb_map[4] = { 0x12, 0x34, 0x56, 0x78 };
struct re_dfa_t *
rpl_regcomp ()
{
struct re_dfa_t *dfa = malloc (sizeof (struct re_dfa_t));
dfa->sb_char = utf8_sb_map;
return dfa;
}
void
rpl_regfree (struct re_dfa_t *dfa)
{
puts (dfa->sb_char == utf8_sb_map ? "PASS" : "FAIL");
}