aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/pep.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/pep.em')
-rw-r--r--ld/emultempl/pep.em32
1 files changed, 18 insertions, 14 deletions
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index bf36276..8b30b1c 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -515,7 +515,7 @@ set_entry_point (void)
/* Entry point name for arbitrary subsystem numbers. */
static const char default_entry[] = "mainCRTStartup";
- if (link_info.shared || dll)
+ if (bfd_link_pic (&link_info) || dll)
{
entry = "DllMainCRTStartup";
}
@@ -903,9 +903,9 @@ gld_${EMULATION_NAME}_set_symbols (void)
if (!init[IMAGEBASEOFF].inited)
{
- if (link_info.relocatable)
+ if (bfd_link_relocatable (&link_info))
init[IMAGEBASEOFF].value = 0;
- else if (init[DLLOFF].value || (link_info.shared && !link_info.pie))
+ else if (init[DLLOFF].value || bfd_link_dll (&link_info))
{
#ifdef DLL_SUPPORT
init[IMAGEBASEOFF].value = (pep_enable_auto_image_base
@@ -921,7 +921,7 @@ gld_${EMULATION_NAME}_set_symbols (void)
}
/* Don't do any symbol assignments if this is a relocatable link. */
- if (link_info.relocatable)
+ if (bfd_link_relocatable (&link_info))
return;
/* Glue the assignments into the abs section. */
@@ -1459,7 +1459,7 @@ gld_${EMULATION_NAME}_after_open (void)
find it, so enable it in that case. */
if (pep_use_coff_long_section_names < 0 && link_info.strip == strip_none)
{
- if (link_info.relocatable)
+ if (bfd_link_relocatable (&link_info))
pep_use_coff_long_section_names = 1;
else
{
@@ -1495,9 +1495,9 @@ gld_${EMULATION_NAME}_after_open (void)
pep_fixup_stdcalls ();
#ifndef TARGET_IS_i386pep
- if (link_info.shared)
+ if (bfd_link_pic (&link_info))
#else
- if (!link_info.relocatable)
+ if (!bfd_link_relocatable (&link_info))
#endif
pep_dll_build_sections (link_info.output_bfd, &link_info);
@@ -1789,7 +1789,10 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB
/* def_file_print (stdout, pep_def_file); */
if (pep_def_file->is_dll == 1)
- link_info.shared = 1;
+ {
+ link_info.type = type_dll;
+ link_info.pic = 1;
+ }
if (pep_def_file->base_address != (bfd_vma)(-1))
{
@@ -1846,8 +1849,9 @@ gld_${EMULATION_NAME}_finish (void)
finish_default ();
#ifdef DLL_SUPPORT
- if (link_info.shared
- || (!link_info.relocatable && pep_def_file->num_exports != 0))
+ if (bfd_link_pic (&link_info)
+ || (!bfd_link_relocatable (&link_info)
+ && pep_def_file->num_exports != 0))
{
pep_dll_fill_sections (link_info.output_bfd, &link_info);
if (pep_implib_filename)
@@ -1897,7 +1901,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
lang_statement_union_type **pl;
/* Look through the script to see where to place this section. */
- if (!link_info.relocatable
+ if (!bfd_link_relocatable (&link_info)
&& (dollar = strchr (secname, '\$')) != NULL)
{
size_t len = dollar - secname;
@@ -2031,7 +2035,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
os = lang_insert_orphan (s, secname, constraint, after, place, address,
&add_child);
- if (link_info.relocatable)
+ if (bfd_link_relocatable (&link_info))
{
os->section_alignment = s->alignment_power;
os->bfd_section->alignment_power = s->alignment_power;
@@ -2187,11 +2191,11 @@ fragment <<EOF
{
*isfile = 0;
- if (link_info.relocatable && config.build_constructors)
+ if (bfd_link_relocatable (&link_info) && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (bfd_link_relocatable (&link_info)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c