(amiga_handle_rest): Factor out common code. Rearrange switch.

This commit is contained in:
Gunther Nikl
2008-12-23 16:52:27 +00:00
parent c769148c66
commit a4ccb0ea31
+14 -23
View File
@@ -1093,18 +1093,30 @@ amiga_handle_rest (abfd, current_section, isload)
if (bfd_seek (abfd, len<<2, SEEK_CUR))
return FALSE;
/* We have symbols */
abfd->flags |= HAS_SYMS;
abfd->symcount++;
switch (type)
{
case EXT_SYMB: /* Symbol hunks are relative to hunk start... */
case EXT_DEF: /* def relative to hunk */
case EXT_ABS: /* def absolute */
abfd->flags |= HAS_SYMS; /* We have symbols */
abfd->symcount++;
/* skip the value */
if (!get_long (abfd, &no))
return FALSE;
break;
case EXT_ABSCOMMON: /* Common ref/def */
case EXT_DEXT32COMMON:
case EXT_DEXT16COMMON:
case EXT_DEXT8COMMON:
/* FIXME: skip the size of common block */
if (!get_long (abfd, &no))
return FALSE;
/* Fall through */
case EXT_ABSREF32: /* 32 bit ref */
case EXT_RELREF16: /* 16 bit ref */
case EXT_RELREF8: /* 8 bit ref */
@@ -1113,8 +1125,6 @@ amiga_handle_rest (abfd, current_section, isload)
case EXT_DEXT8: /* 8 bit baserel */
case EXT_RELREF32:
case EXT_RELREF26:
abfd->flags |= HAS_SYMS;
abfd->symcount++;
if (!get_long (abfd, &no))
return FALSE;
if (no)
@@ -1126,25 +1136,6 @@ amiga_handle_rest (abfd, current_section, isload)
}
break;
case EXT_ABSCOMMON: /* Common ref/def */
case EXT_DEXT32COMMON:
case EXT_DEXT16COMMON:
case EXT_DEXT8COMMON:
abfd->flags |= HAS_SYMS;
abfd->symcount++;
/* FIXME: skip the size of common block */
if (!get_long (abfd, &no))
return FALSE;
if (!get_long (abfd, &no))
return FALSE;
if (no)
{
relno += no;
if (bfd_seek (abfd, no<<2, SEEK_CUR))
return FALSE;
}
break;
default: /* error */
bfd_msg ("unexpected type %ld(0x%lx) in hunk_ext2 at offset 0x%lx\n",
type, type, bfd_tell (abfd));