This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Preserve e_flags.
On Tue, Dec 18, 2001 at 10:35:10AM -0800, cgd@broadcom.com wrote:
> > 2001-12-18 H.J. Lu <hjl@gnu.org>
> >
> > * elf-bfd.h (_bfd_elf_copy_private_bfd_data): New. Prototype.
> > (_bfd_mips_elf_copy_private_bfd_data): Removed.
> >
> > * elf.c (_bfd_elf_copy_private_bfd_data): New. Copy e_flags in
> > the ELF header.
> > to _bfd_elf_copy_private_bfd_data.
>
> Two comments:
>
> (1) looks like the fn in some of the arch-specific files also copied
> GP, but that's not done in the generic version?
>
> Was that redundant/unnecessary, or a bug? 8-)
Ooops. Here is a patch. Thanks.
>
> (2) I thought changelogs were supposed to exactly name the functions
> (etc.) being modified. I.e. no wildcards...
>
I have no strong opinions on this. At least `*' is used in ChangeLog.
H.J.
-----
2001-12-18 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_copy_private_bfd_data): Also copy GP.
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.115
diff -u -p -r1.115 elf.c
--- elf.c 2001/12/18 18:11:52 1.115
+++ elf.c 2001/12/18 19:00:58
@@ -784,7 +784,8 @@ _bfd_elf_merge_sections (abfd, info)
return true;
}
-/* Copy the program header from one object module to another */
+/* Copy the program header and other data from one object module to
+ another. */
boolean
_bfd_elf_copy_private_bfd_data (ibfd, obfd)
@@ -799,6 +800,7 @@ _bfd_elf_copy_private_bfd_data (ibfd, ob
|| (elf_elfheader (obfd)->e_flags
== elf_elfheader (ibfd)->e_flags));
+ elf_gp (obfd) = elf_gp (ibfd);
elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
elf_flags_init (obfd) = true;
return true;