This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
[PATCH] some fixes for powerpc-linux-gnu, please review
- To: binutils@sourceware.cygnus.com
- Subject: [PATCH] some fixes for powerpc-linux-gnu, please review
- From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- Date: Mon, 21 Jun 1999 22:51:27 +0200
- Cc: geoffk@ozemail.com.au
Hi,
please review the following patches carefully, as I don't really have enough
knowledge here. The first 2 hunks fix a problem detected by Mark Mitchell's
recent changes. The changes in ppc_elf_relocate_section() are the result of a
bugreport which showed that on PPC --noinhibit-exec is not respected, due to
returning "false" too often. I changed it to look more like other platforms.
Franz.
Index: elf32-ppc.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-ppc.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-ppc.c
--- elf32-ppc.c 1999/06/04 13:25:20 1.2
+++ bfd/elf32-ppc.c 1999/06/21 12:22:59
@@ -2102,7 +2102,7 @@ ppc_elf_size_dynamic_sections (output_bf
if ((s->flags & SEC_LINKER_CREATED) != 0
|| (s->flags & SEC_ALLOC) == 0)
{
- elf_section_data (s)->dynindx = -1;
+ elf_section_data (s)->dynindx = 0;
continue;
}
@@ -2949,7 +2949,7 @@ ppc_elf_finish_dynamic_sections (output_
indx = elf_section_data (s)->this_idx;
dindx = elf_section_data (s)->dynindx;
- if (dindx != -1)
+ if (dindx != 0)
{
BFD_ASSERT(indx > 0);
BFD_ASSERT(dindx > 0);
@@ -3200,12 +3200,13 @@ ppc_elf_relocate_section (output_bfd, in
relocation = 0;
else
{
- (*info->callbacks->undefined_symbol)(info,
- h->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset);
- ret = false;
+ if (! ((*info->callbacks->undefined_symbol)(info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset)))
+ return false;
+ relocation = 0;
continue;
}
}
@@ -3230,12 +3231,12 @@ ppc_elf_relocate_section (output_bfd, in
|| h->root.type == bfd_link_hash_defweak)
&& sec->output_section == NULL)
{
- (*info->callbacks->undefined_symbol) (info,
- h->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset);
- ret = false;
+ if (! ((*info->callbacks->undefined_symbol) (info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset)))
+ return false;
continue;
}
break;
@@ -3784,14 +3785,14 @@ ppc_elf_relocate_section (output_bfd, in
name = bfd_section_name (input_bfd, sec);
}
- (*info->callbacks->reloc_overflow)(info,
- name,
- howto->name,
- (bfd_vma) 0,
- input_bfd,
- input_section,
- offset);
- ret = false;
+ if (! ((*info->callbacks->reloc_overflow)(info,
+ name,
+ howto->name,
+ (bfd_vma) 0,
+ input_bfd,
+ input_section,
+ offset)))
+ return false;
}
else
ret = false;
? diff
? diffo
Index: elf32-ppc.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-ppc.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-ppc.c
--- elf32-ppc.c 1999/06/04 13:25:20 1.2
+++ bfd/elf32-ppc.c 1999/06/21 12:22:59
@@ -2102,7 +2102,7 @@ ppc_elf_size_dynamic_sections (output_bf
if ((s->flags & SEC_LINKER_CREATED) != 0
|| (s->flags & SEC_ALLOC) == 0)
{
- elf_section_data (s)->dynindx = -1;
+ elf_section_data (s)->dynindx = 0;
continue;
}
@@ -2949,7 +2949,7 @@ ppc_elf_finish_dynamic_sections (output_
indx = elf_section_data (s)->this_idx;
dindx = elf_section_data (s)->dynindx;
- if (dindx != -1)
+ if (dindx != 0)
{
BFD_ASSERT(indx > 0);
BFD_ASSERT(dindx > 0);
@@ -3200,12 +3200,13 @@ ppc_elf_relocate_section (output_bfd, in
relocation = 0;
else
{
- (*info->callbacks->undefined_symbol)(info,
- h->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset);
- ret = false;
+ if (! ((*info->callbacks->undefined_symbol)(info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset)))
+ return false;
+ relocation = 0;
continue;
}
}
@@ -3230,12 +3231,12 @@ ppc_elf_relocate_section (output_bfd, in
|| h->root.type == bfd_link_hash_defweak)
&& sec->output_section == NULL)
{
- (*info->callbacks->undefined_symbol) (info,
- h->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset);
- ret = false;
+ if (! ((*info->callbacks->undefined_symbol) (info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset)))
+ return false;
continue;
}
break;
@@ -3784,14 +3785,14 @@ ppc_elf_relocate_section (output_bfd, in
name = bfd_section_name (input_bfd, sec);
}
- (*info->callbacks->reloc_overflow)(info,
- name,
- howto->name,
- (bfd_vma) 0,
- input_bfd,
- input_section,
- offset);
- ret = false;
+ if (! ((*info->callbacks->reloc_overflow)(info,
+ name,
+ howto->name,
+ (bfd_vma) 0,
+ input_bfd,
+ input_section,
+ offset)))
+ return false;
}
else
ret = false;