This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Patch to allow bfd to build natively using solaris cc
- To: binutils at sources dot redhat dot com
- Subject: Patch to allow bfd to build natively using solaris cc
- From: Jeff Holcomb <jeffh at redhat dot com>
- Date: Tue, 16 Oct 2001 15:58:26 -0700 (PDT)
This is to allow bfd to build in a stage1 bootstrap using solaris' cc.
(It's a little more cranky about pointer arithmetic). I had this problem
on both sparc-sun-solaris2.7 and sparc-sun-solaris2.8.
Ok to commit?
2001-10-16 Jeff Holcomb <jeffh@redhat.com>
* elflink.h (elf_link_sort_relocs): Remove unnecessary pointer
casts.
* elf.c (setup_group): Fix pointer arithmetic for Solaris cc.
Index: elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.115
diff -u -p -r1.115 elflink.h
--- elflink.h 2001/10/16 06:33:52 1.115
+++ elflink.h 2001/10/16 22:22:29
@@ -4502,7 +4502,7 @@ elf_link_sort_relocs (abfd, info, psec)
struct elf_link_sort_rela *s;
erel = (Elf_External_Rel *) o->contents;
- erelend = (Elf_External_Rel *) ((PTR) o->contents + o->_raw_size);
+ erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
s = rela + o->output_offset / sizeof (Elf_External_Rel);
for (; erel < erelend; erel++, s++)
{
@@ -4519,7 +4519,7 @@ elf_link_sort_relocs (abfd, info, psec)
struct elf_link_sort_rela *s;
erela = (Elf_External_Rela *) o->contents;
- erelaend = (Elf_External_Rela *) ((PTR) o->contents + o->_raw_size);
+ erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
s = rela + o->output_offset / sizeof (Elf_External_Rela);
for (; erela < erelaend; erela++, s++)
{
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.101
diff -u -p -r1.101 elf.c
--- elf.c 2001/10/15 09:45:45 1.101
+++ elf.c 2001/10/16 22:23:31
@@ -423,8 +423,8 @@ setup_group (abfd, hdr, newsect)
array of elf section indices all in target byte order,
to the flag word followed by an array of elf section
pointers. */
- src = shdr->contents + shdr->sh_size;
- dest = (Elf_Internal_Group *) (shdr->contents + amt);
+ src = ((char *) shdr->contents) + shdr->sh_size;
+ dest = ((Elf_Internal_Group *) shdr->contents) + amt);
while (1)
{
unsigned int idx;