* nlmconv.c (setup_sections): Remove special handling of .reginfo

section.
	(copy_sections): Likewise.
	(alpha_mangle_relocs): Use bfd_ecoff_get_gp_value rather than the
	special ECOFF .reginfo section.
This commit is contained in:
Ian Lance Taylor
1994-04-22 22:13:23 +00:00
parent 92867d8efa
commit f645a4bf38
2 changed files with 9 additions and 29 deletions

View File

@ -1,5 +1,11 @@
Fri Apr 22 11:14:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* nlmconv.c (setup_sections): Remove special handling of .reginfo
section.
(copy_sections): Likewise.
(alpha_mangle_relocs): Use bfd_ecoff_get_gp_value rather than the
special ECOFF .reginfo section.
* objcopy.c (copy_object): Call bfd_copy_private_bfd_data after
copying everything else, to let it fiddle with the file in its
final state.

View File

@ -1169,13 +1169,6 @@ setup_sections (inbfd, insec, data_ptr)
bfd_size_type add;
bfd_size_type secsecsize;
/* FIXME: We don't want to copy the .reginfo section of an ECOFF
file. However, I don't have a good way to describe this section.
We do want to copy the section when using objcopy. */
if (bfd_get_flavour (inbfd) == bfd_target_ecoff_flavour
&& strcmp (bfd_section_name (inbfd, insec), ".reginfo") == 0)
return;
f = bfd_get_section_flags (inbfd, insec);
if (f & SEC_CODE)
outname = NLM_CODE_NAME;
@ -1248,13 +1241,6 @@ copy_sections (inbfd, insec, data_ptr)
inname = bfd_section_name (inbfd, insec);
/* FIXME: We don't want to copy the .reginfo section of an ECOFF
file. However, I don't have a good way to describe this section.
We do want to copy the section when using objcopy. */
if (bfd_get_flavour (inbfd) == bfd_target_ecoff_flavour
&& strcmp (inname, ".reginfo") == 0)
return;
outsec = insec->output_section;
assert (outsec != NULL);
@ -1633,22 +1619,10 @@ alpha_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents,
++(*reloc_count_ptr);
}
/* Get the GP value from bfd. It is in the .reginfo section. */
/* Get the GP value from bfd. */
if (nlm_alpha_backend_data (outbfd)->gp == 0)
{
bfd *inbfd;
asection *reginfo_sec;
struct ecoff_reginfo sreginfo;
inbfd = insec->owner;
assert (bfd_get_flavour (inbfd) == bfd_target_ecoff_flavour);
reginfo_sec = bfd_get_section_by_name (inbfd, REGINFO);
if (reginfo_sec != (asection *) NULL
&& bfd_get_section_contents (inbfd, reginfo_sec,
(PTR) &sreginfo, (file_ptr) 0,
sizeof sreginfo) != false)
nlm_alpha_backend_data (outbfd)->gp = sreginfo.gp_value;
}
nlm_alpha_backend_data (outbfd)->gp =
bfd_ecoff_get_gp_value (insec->owner);
*relocs = (arelent *) xmalloc (sizeof (arelent));
(*relocs)->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr;