strcat (n, WRAP);
strcat (n, l);
h = bfd_link_hash_lookup (info->hash, n, create, true, follow);
+ if (h != NULL)
+ h->wrapper_symbol = true;
free (n);
return h;
}
/* The symbol, SYM, is referenced by __real_SYM in an object file. */
unsigned int ref_real : 1;
+ /* The symbol is a wrapper symbol, __wrap_SYM. */
+ unsigned int wrapper_symbol : 1;
+
/* Symbol is a built-in define. These will be overridden by PROVIDE
in a linker script. */
unsigned int linker_def : 1;
if (syms[n].def != LDPK_UNDEF && syms[n].def != LDPK_WEAKUNDEF)
{
blhe = h;
- if (blhe && link_info.wrap_hash != NULL)
- {
- /* Check if a symbol is a wrapper symbol. */
- struct bfd_link_hash_entry *unwrap
- = unwrap_hash_lookup (&link_info, (bfd *) abfd, blhe);
- if (unwrap && unwrap != h)
- wrap_status = wrapper;
- }
+ /* Check if a symbol is a wrapper symbol. */
+ if (blhe && blhe->wrapper_symbol)
+ wrap_status = wrapper;
}
else
{
{} \
"pr29086" \
] \
+ [list \
+ "PR ld/31956 (a)" \
+ "-Wl,--wrap=parse_line" \
+ "-O2 -flto" \
+ {pr31956a.c pr31956b.c} \
+ {} \
+ "pr31956a" \
+ ] \
+ [list \
+ "PR ld/31956 (b)" \
+ "-Wl,--wrap=parse_line" \
+ "-O2 -flto" \
+ {pr31956b.c pr31956a.c} \
+ {} \
+ "pr31956b" \
+ ] \
[list \
"Build pr30281.so" \
"-shared -Wl,--version-script,pr30281.t \
--- /dev/null
+extern void parse_line(void);
+void _cmocka_run_group_tests(void *) {}
+void argv_parse_cmd(void) { parse_line(); }
--- /dev/null
+struct CMUnitTest {
+ void *test_func;
+};
+
+extern void _cmocka_run_group_tests(void *);
+
+extern void argv_parse_cmd(void);
+void __wrap_parse_line(void) {};
+
+void foo (void) {
+ argv_parse_cmd();
+}
+
+struct CMUnitTest main_tests = {
+ foo
+};
+
+int
+main (void)
+{
+ _cmocka_run_group_tests (&main_tests);
+ return 0;
+}