aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-08-17 09:50:05 +0000
committerAlan Modra <amodra@gmail.com>2001-08-17 09:50:05 +0000
commit0ac450b689f758b9ff145ae4b0cf910f6686f12f (patch)
tree5bf4a16bf7b24bd53fa0b6329db164ce1c714901
parent5d964dfa3eeb841f9df66cf73e0b26a21edfa7fa (diff)
downloadgdb-0ac450b689f758b9ff145ae4b0cf910f6686f12f.zip
gdb-0ac450b689f758b9ff145ae4b0cf910f6686f12f.tar.gz
gdb-0ac450b689f758b9ff145ae4b0cf910f6686f12f.tar.bz2
* linker.c (default_fill_link_order): Handle four byte fill value.
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/linker.c29
2 files changed, 26 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 93d76d8..93af021 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
2001-08-17 Alan Modra <amodra@bigpond.net.au>
+ * linker.c (default_fill_link_order): Handle four byte fill value.
+
+2001-08-17 Alan Modra <amodra@bigpond.net.au>
+
* elf64-sparc.c (sparc64_elf_output_arch_syms): Add missing
prototype.
* nlm32-alpha.c (nlm_alpha_write_external): Fix warning.
@@ -31,6 +35,8 @@
(elfNN_ia64_relocate_section): Fix warning.
(elfNN_ia64_unwind_entry_compare): Make params const.
+2001-08-17 Alan Modra <amodra@bigpond.net.au>
+
* config.bfd (targ64_selvecs): New.
<powerpc-*-aix* entry>: Use it here instead of ineffectual #ifdef.
@@ -43,6 +49,8 @@
* bfd-in2.h: Regenerate.
* configure: Regenerate.
+2001-08-17 Alan Modra <amodra@bigpond.net.au>
+
* bfd.c (enum bfd_error): Add bfd_error_wrong_object_format.
(bfd_errmsgs): Add corresponding message.
* archive.c (bfd_generic_archive_p): Don't release bfd_ardata when
diff --git a/bfd/linker.c b/bfd/linker.c
index 1144e92..00389ac 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -2655,28 +2655,35 @@ default_fill_link_order (abfd, info, sec, link_order)
struct bfd_link_order *link_order;
{
size_t size;
- char *space;
+ unsigned char *space;
size_t i;
- int fill;
+ unsigned int fill;
+ file_ptr loc;
boolean result;
BFD_ASSERT ((sec->flags & SEC_HAS_CONTENTS) != 0);
size = (size_t) link_order->size;
- space = (char *) bfd_malloc (size);
- if (space == NULL && size != 0)
+ if (size == 0)
+ return true;
+
+ space = (unsigned char *) bfd_malloc (size);
+ if (space == NULL)
return false;
fill = link_order->u.fill.value;
- for (i = 0; i < size; i += 2)
+ for (i = 0; i < size; i += 4)
+ space[i] = fill >> 24;
+ for (i = 1; i < size; i += 4)
+ space[i] = fill >> 16;
+ for (i = 2; i < size; i += 4)
space[i] = fill >> 8;
- for (i = 1; i < size; i += 2)
+ for (i = 3; i < size; i += 4)
space[i] = fill;
- result = bfd_set_section_contents (abfd, sec, space,
- (file_ptr)
- (link_order->offset *
- bfd_octets_per_byte (abfd)),
- link_order->size);
+
+ loc = (file_ptr) (link_order->offset * bfd_octets_per_byte (abfd));
+ result = bfd_set_section_contents (abfd, sec, space, loc, link_order->size);
+
free (space);
return result;
}