This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Special names tha ld needs to recognize for hppa64-hp-hpux11.X
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: law at redhat dot com
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 12 Feb 2002 17:39:08 -0500 (EST)
- Subject: Re: Special names tha ld needs to recognize for hppa64-hp-hpux11.X
> In message <200202111708.g1BH8AIA009479@hiauly1.hia.nrc.ca>, "John David
> Anglin
> " writes:
> > I have a patch that leaves the dynamic-loader defined symbols undefined.
> > Something additional would be needed if we actually generated a static
> > binary and need to provide these symbols.
> Right. This could possibly be an issue for the PA64 Linux folks, but I
> don't see it being an issue in HP-UX land.
This is what I currently have. I don't know how to distinguish output
for linux from that for hpux.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-02-12 John David Anglin <dave@hiauly1.hia.nrc.ca>
* elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
(elf_hppa_relocate_section): Ignore dynamic loader defined symbols.
--- elf-hppa.h.orig Tue Feb 12 14:17:51 2002
+++ elf-hppa.h Tue Feb 12 14:20:47 2002
@@ -75,6 +75,9 @@
static boolean elf_hppa_remark_useless_dynamic_symbols
PARAMS ((struct elf_link_hash_entry *, PTR));
+static boolean elf_hppa_is_dynamic_loader_symbol
+ PARAMS ((const char *));
+
static void elf_hppa_record_segment_addrs
PARAMS ((bfd *, asection *, PTR));
@@ -1136,6 +1139,23 @@
return true;
}
+static boolean
+elf_hppa_is_dynamic_loader_symbol (name)
+ const char * name;
+{
+ return (! strcmp (name, "__CPU_REVISION")
+ || ! strcmp (name, "__CPU_KEYBITS_1")
+ || ! strcmp (name, "__SYSTEM_ID_D")
+ || ! strcmp (name, "__FPU_MODEL")
+ || ! strcmp (name, "__FPU_REVISION")
+ || ! strcmp (name, "__ARGC")
+ || ! strcmp (name, "__ARGV")
+ || ! strcmp (name, "__ENVP")
+ || ! strcmp (name, "__TLS_SIZE_D")
+ || ! strcmp (name, "__LOAD_INFO")
+ || ! strcmp (name, "__systab"));
+}
+
/* Record the lowest address for the data and text segments. */
static void
elf_hppa_record_segment_addrs (abfd, section, data)
@@ -1419,11 +1439,17 @@
relocation = 0;
else
{
- if (!((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset, true)))
- return false;
- break;
+ /* Ignore dynamic loader defined symbols. */
+ if (elf_hppa_is_dynamic_loader_symbol (h->root.root.string))
+ relocation = 0;
+ else
+ {
+ if (!((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset, true)))
+ return false;
+ break;
+ }
}
}