e_align = exp_unop (ALIGN_K,
exp_intop ((bfd_vma) 1 << s->alignment_power));
lang_add_assignment (exp_assign (".", e_align));
- if (link_info.shared)
- lang_add_assignment (exp_assign (symname,
- exp_unop (ABSOLUTE,
- exp_nameop (NAME, "."))));
- else
- lang_add_assignment (exp_provide (symname,
- exp_unop (ABSOLUTE,
- exp_nameop (NAME, ".")),
- FALSE));
+ lang_add_assignment (exp_provide (symname,
+ exp_unop (ABSOLUTE,
+ exp_nameop (NAME, ".")),
+ FALSE));
}
}
symname = (char *) xmalloc (ps - secname + sizeof "__stop_" + 1);
symname[0] = bfd_get_symbol_leading_char (link_info.output_bfd);
sprintf (symname + (symname[0] != 0), "__stop_%s", secname);
- if (link_info.shared)
- lang_add_assignment (exp_assign (symname,
- exp_nameop (NAME, ".")));
- else
- lang_add_assignment (exp_provide (symname,
- exp_nameop (NAME, "."),
- FALSE));
+ lang_add_assignment (exp_provide (symname,
+ exp_nameop (NAME, "."),
+ FALSE));
}
/* Restore the global list pointer. */
#endif
#endif
+/*
+ * GLOBL macro exists to preserve __start_set_* and __stop_set_* sections
+ * of kernel modules which are discarded from binutils 2.17.50+ otherwise.
+ */
+
+#define __GLOBL1(sym) __asm__(".globl " #sym)
+#define __GLOBL(sym) __GLOBL1(sym)
+
#endif /* !_SYS_CDEFS_H_ */
#endif
-#define __MAKE_SET(set, sym) \
- static void const * const __set_##set##_sym_##sym \
+#define __MAKE_SET(set, sym) \
+ __GLOBL(__CONCAT(__start_set_,set)); \
+ __GLOBL(__CONCAT(__stop_set_,set)); \
+ static void const * const __set_##set##_sym_##sym \
__section("set_" #set) __used = &sym
#define TEXT_SET(set, sym) __MAKE_SET(set, sym)
#undef DATA_SET
#define __MAKE_SET(set, sym) \
+ __GLOBL(__CONCAT(__start_set_,set)); \
+ __GLOBL(__CONCAT(__stop_set_,set)); \
static void const * const __set_##set##_sym_##sym \
__section("set_" #set) __used = &sym