aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-12-20 20:31:36 +0000
committerKen Raeburn <raeburn@cygnus>1994-12-20 20:31:36 +0000
commit85200ebce939e078627c8c2cdbb8dd43b7314fcd (patch)
treec8a81cb4f8685d445cac94f80f2b1c32667ebcf4 /bfd/elfcode.h
parent9ad5755f7b0301a8af735aff341c4b78200a07d5 (diff)
downloadgdb-85200ebce939e078627c8c2cdbb8dd43b7314fcd.zip
gdb-85200ebce939e078627c8c2cdbb8dd43b7314fcd.tar.gz
gdb-85200ebce939e078627c8c2cdbb8dd43b7314fcd.tar.bz2
* elfcode.h (assign_file_positions_except_relocs): In assertion, force all
values to the same type.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index e59402e..f0b515b 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1498,7 +1498,7 @@ elf_map_symbols (abfd)
for (idx = 0; idx < symcount; idx++)
{
if ((syms[idx]->flags & BSF_SECTION_SYM) != 0
- && syms[idx]->value == asect->vma)
+ && syms[idx]->value == 0)
{
asection *sec;
@@ -1507,6 +1507,8 @@ elf_map_symbols (abfd)
{
if (sec->owner != abfd)
{
+ if (sec->output_offset != 0)
+ continue;
sec = sec->output_section;
BFD_ASSERT (sec->owner == abfd);
}
@@ -1527,7 +1529,7 @@ elf_map_symbols (abfd)
return false;
sym->the_bfd = abfd;
sym->name = asect->name;
- sym->value = asect->vma;
+ sym->value = 0;
/* Set the flags to 0 to indicate that this one was newly added. */
sym->flags = 0;
sym->section = asect;
@@ -2114,7 +2116,7 @@ assign_file_positions_except_relocs (abfd, dosyms)
phdr_map = map_program_segments (abfd, phdr_off, first, phdr_size);
if (phdr_map == (file_ptr) -1)
return false;
- BFD_ASSERT (phdr_map <= phdr_off + phdr_size);
+ BFD_ASSERT ((bfd_size_type) phdr_map <= (bfd_size_type) phdr_off + phdr_size);
}
/* Place the section headers. */
@@ -2605,13 +2607,6 @@ elf_section_from_bfd_section (abfd, asect)
Elf_Internal_Shdr *hdr;
int maxindex = elf_elfheader (abfd)->e_shnum;
- if (bfd_is_abs_section (asect))
- return SHN_ABS;
- if (bfd_is_com_section (asect))
- return SHN_COMMON;
- if (bfd_is_und_section (asect))
- return SHN_UNDEF;
-
for (index = 0; index < maxindex; index++)
{
hdr = i_shdrp[index];
@@ -2633,6 +2628,13 @@ elf_section_from_bfd_section (abfd, asect)
}
}
+ if (bfd_is_abs_section (asect))
+ return SHN_ABS;
+ if (bfd_is_com_section (asect))
+ return SHN_COMMON;
+ if (bfd_is_und_section (asect))
+ return SHN_UNDEF;
+
return -1;
}