aboutsummaryrefslogtreecommitdiff
path: root/bfd/som.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-03-24 17:21:50 +0000
committerJeff Law <law@redhat.com>1994-03-24 17:21:50 +0000
commit9d7f682f8cd146e5c6161717610f27158fe3ced8 (patch)
treea00f6fee832852c1e2e5e14bd7c752dce210507d /bfd/som.c
parent18d94a58c060302505c8bb5600aaf94cf98061b1 (diff)
downloadgdb-9d7f682f8cd146e5c6161717610f27158fe3ced8.zip
gdb-9d7f682f8cd146e5c6161717610f27158fe3ced8.tar.gz
gdb-9d7f682f8cd146e5c6161717610f27158fe3ced8.tar.bz2
* som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects.
(som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise.
Diffstat (limited to 'bfd/som.c')
-rw-r--r--bfd/som.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/bfd/som.c b/bfd/som.c
index a75b26d..43f29f5 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -3118,7 +3118,7 @@ som_begin_writing (abfd)
zeros are filled in. Ugh. */
if (abfd->flags & EXEC_P)
current_offset = SOM_ALIGN (current_offset, PA_PAGESIZE);
- if (bfd_seek (abfd, current_offset, SEEK_SET) < 0)
+ if (bfd_seek (abfd, current_offset - 1, SEEK_SET) < 0)
{
bfd_set_error (bfd_error_system_call);
return false;
@@ -5071,6 +5071,14 @@ som_bfd_prep_for_ar_write (abfd, num_syms, stringsize)
unsigned int curr_count, i;
som_symbol_type *sym;
+ /* Don't bother for non-SOM objects. */
+ if (curr_bfd->format != bfd_object
+ || curr_bfd->xvec->flavour != bfd_target_som_flavour)
+ {
+ curr_bfd = curr_bfd->next;
+ continue;
+ }
+
/* Make sure the symbol table has been read, then snag a pointer
to it. It's a little slimey to grab the symbols via obj_som_symtab,
but doing so avoids allocating lots of extra memory. */
@@ -5260,6 +5268,14 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst)
unsigned int curr_count, i;
som_symbol_type *sym;
+ /* Don't bother for non-SOM objects. */
+ if (curr_bfd->format != bfd_object
+ || curr_bfd->xvec->flavour != bfd_target_som_flavour)
+ {
+ curr_bfd = curr_bfd->next;
+ continue;
+ }
+
/* Make sure the symbol table has been read, then snag a pointer
to it. It's a little slimey to grab the symbols via obj_som_symtab,
but doing so avoids allocating lots of extra memory. */
@@ -5478,7 +5494,10 @@ som_write_armap (abfd)
lst.module_count = 0;
while (curr_bfd != NULL)
{
- lst.module_count++;
+ /* Only true SOM objects count. */
+ if (curr_bfd->format == bfd_object
+ && curr_bfd->xvec->flavour == bfd_target_som_flavour)
+ lst.module_count++;
curr_bfd = curr_bfd->next;
}
lst.module_limit = lst.module_count;