static void
gld_${EMULATION_NAME}_before_parse (void)
{
+ int u;
+ /* Now we check target's default for getting proper symbol_char. */
+ u = pe_leading_underscore;
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
+
+ if (u == -1)
+ abort ();
+ pe_leading_underscore = u;
+
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "${EXECUTABLE_NAME:-a.exe}";
#ifdef DLL_SUPPORT
static void
set_pe_name (char *name, long val)
{
- int i;
+ int i, u;
+
+ /* Now we check target's default for getting proper symbol_char. */
+ u = pe_leading_underscore;
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
+
+ if (u == -1)
+ abort ();
+ pe_leading_underscore = u;
/* Find the name and set it. */
for (i = 0; init[i].ptr; i++)
/* Now we check target's default for getting proper symbol_char. */
u = pe_leading_underscore;
- if (u == -1 && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
- if (u == 0)
- initial_symbol_char = "";
- else if (u != -1)
- initial_symbol_char = "_";
- else
+ if (u == -1)
abort ();
+ initial_symbol_char = (u == 1 ? "_" : "");
pe_leading_underscore = u;
if (*initial_symbol_char != '\0')
{
/* Run through and invent symbols for all the
names and insert the defaults. */
- int j;
+ int j, u;
+ /* Now we check target's default for getting proper symbol_char. */
+ u = pe_leading_underscore;
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
+
+ if (u == -1)
+ abort ();
+ pe_leading_underscore = u;
if (!init[IMAGEBASEOFF].inited)
{
static void
gld_${EMULATION_NAME}_before_parse (void)
{
+ int u;
+ /* Now we check target's default for getting proper symbol_char. */
+ u = pep_leading_underscore;
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
+
+ if (u == -1)
+ abort ();
+ pep_leading_underscore = u;
+
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "${EXECUTABLE_NAME:-a.exe}";
#ifdef DLL_SUPPORT
#define GET_INIT_SYMBOL_NAME(IDX) \
(init[(IDX)].symbol \
- + ((init[(IDX)].is_c_symbol == FALSE || pep_leading_underscore != 0) ? 0 : 1))
+ + ((init[(IDX)].is_c_symbol == FALSE || pep_leading_underscore == 1) ? 0 : 1))
/* Decorates the C visible symbol by underscore, if target requires. */
#define U(CSTR) \
- (pep_leading_underscore == 0 ? CSTR : "_" CSTR)
+ (pep_leading_underscore != 1 ? CSTR : "_" CSTR)
/* Get size of constant string for a possible underscore prefixed
C visible symbol. */
#define U_SIZE(CSTR) \
- (sizeof (CSTR) + pep_leading_underscore == 0 ? 0 : 1)
+ (sizeof (CSTR) + pep_leading_underscore == 1 ? 0 : 1)
#define D(field,symbol,def,usc) {&pep.field,sizeof(pep.field), def, symbol,0, usc}
static void
set_pep_name (char *name, bfd_vma val)
{
- int i;
+ int i, u;
+
+ /* Now we check target's default for getting proper symbol_char. */
+ u = pep_leading_underscore;
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
+
+ if (u == -1)
+ abort ();
+ pep_leading_underscore = u;
/* Find the name and set it. */
for (i = 0; init[i].ptr; i++)
/* Now we check target's default for getting proper symbol_char. */
u = pep_leading_underscore;
- if (u == -1 && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
- if (u == 0)
- initial_symbol_char = "";
- else if (u != -1)
- initial_symbol_char = "_";
- else
+ if (u == -1)
abort ();
+ initial_symbol_char = (u == 1 ? "_" : "");
pep_leading_underscore = u;
if (*initial_symbol_char != '\0')
{
/* Run through and invent symbols for all the
names and insert the defaults. */
- int j;
+ int j, u;
+ /* Now we check target's default for getting proper symbol_char. */
+ u = pep_leading_underscore;
+ if (u == -1
+ && !bfd_get_target_info ("${OUTPUT_FORMAT}", NULL, NULL, &u, NULL))
+ bfd_get_target_info ("${RELOCATEABLE_OUTPUT_FORMAT}", NULL, NULL, &u, NULL);
+
+ if (u == -1)
+ abort ();
+ pep_leading_underscore = u;
if (!init[IMAGEBASEOFF].inited)
{