}
if ((IRIX_COMPAT (abfd) == ict_irix5 || IRIX_COMPAT (abfd) == ict_none)
- && !info->shared
+ && info->executable
&& bfd_get_section_by_name (abfd, ".rld_map") == NULL)
{
s = bfd_make_section_with_flags (abfd, ".rld_map",
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
+ }
+
+ if (info->executable)
+ {
+ const char *name;
if (! mips_elf_hash_table (info)->use_rld_obj_head)
{
of .text section. So put a dummy. XXX */
s->size += htab->function_stub_size;
}
- else if (! info->shared
+ else if (info->executable
&& ! mips_elf_hash_table (info)->use_rld_obj_head
&& strncmp (name, ".rld_map", 8) == 0)
{
return FALSE;
}
}
+ else if (info->pie)
+ {
+ if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP_REL, 0))
+ return FALSE;
+ if (!SGI_COMPAT (output_bfd))
+ {
+ if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
+ return FALSE;
+ }
+ }
else
{
/* Shared libraries on traditional mips have DT_DEBUG. */
if (IRIX_COMPAT (output_bfd) == ict_irix6)
mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym);
- if (! info->shared)
+ if (info->executable)
{
if (! mips_elf_hash_table (info)->use_rld_obj_head
&& (strcmp (name, "__rld_map") == 0
break;
case DT_MIPS_RLD_MAP:
+ case DT_MIPS_RLD_MAP_REL:
dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value;
break;
/* Address of auxiliary .dynamic. */
#define DT_MIPS_AUX_DYNAMIC 0x70000031
+
+/* Relative address of run time loader map, used for debugging. */
+#define DT_MIPS_RLD_MAP_REL 0x70000035
+
\f
/* Flags which may appear in a DT_MIPS_FLAGS entry. */