diff -Naur binutils-2.18.org/bfd/elf64-mmix.c binutils-2.18/bfd/elf64-mmix.c --- binutils-2.18.org/bfd/elf64-mmix.c 2007-08-07 04:59:32.000000000 +0900 +++ binutils-2.18/bfd/elf64-mmix.c 2008-08-14 22:46:43.000000000 +0900 @@ -1213,7 +1213,7 @@ /* Lowest two bits must be 0. We return bfd_reloc_overflow for everything that looks strange. */ - if (value & 3) + if ((howto->type != R_MMIX_GETA) && (value & 3)) flag = bfd_reloc_overflow; bfd_put_32 (abfd, @@ -1521,6 +1521,8 @@ break; case bfd_reloc_undefined: + if (h->root.type == bfd_link_hash_undefweak) + break; /* We may have sent this message above. */ if (! undefined_signalled) check_ok = info->callbacks->undefined_symbol @@ -1585,6 +1587,13 @@ { /* All these are PC-relative. */ case R_MMIX_PUSHJ_STUBBABLE: + /* + * This relocation is ignored in mmix_elf_relax_section(). + * So ignore here for pjs related data consistency. + */ + if (symsec == NULL) + return bfd_reloc_undefined; + /* fall thru */ case R_MMIX_PUSHJ: case R_MMIX_CBRANCH: case R_MMIX_ADDR19: @@ -1602,8 +1611,14 @@ break; case R_MMIX_BASE_PLUS_OFFSET: - if (symsec == NULL) + if (symsec == NULL) { + /* icrement bpo index for data consistency */ + struct bpo_reloc_section_info *bpodata + = mmix_elf_section_data (input_section)->bpo.reloc; + + bpodata->bpo_index++; return bfd_reloc_undefined; + } /* Check that we're not relocating against a register symbol. */ if (strcmp (bfd_get_section_name (symsec->owner, symsec), diff -Naur binutils-2.18.org/configure binutils-2.18/configure --- binutils-2.18.org/configure 2007-08-07 05:29:40.000000000 +0900 +++ binutils-2.18/configure 2008-07-29 09:36:01.000000000 +0900 @@ -6128,7 +6128,7 @@ # For an installed makeinfo, we require it to be from texinfo 4.4 or # higher, else we use the "missing" dummy. if ${MAKEINFO} --version \ - | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then + | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.([4-9]|[1-9][0-9])|[5-9])' >/dev/null 2>&1; then : else MAKEINFO="$MISSING makeinfo" diff -Naur binutils-2.18.org/ld/emultempl/mmixelf.em binutils-2.18/ld/emultempl/mmixelf.em --- binutils-2.18.org/ld/emultempl/mmixelf.em 2007-08-07 05:00:22.000000000 +0900 +++ binutils-2.18/ld/emultempl/mmixelf.em 2008-07-29 09:37:10.000000000 +0900 @@ -39,6 +39,14 @@ exclude this file. */ config.magic_demand_paged = FALSE; } + +static void +gld${EMULATION_NAME}_finish(void) +{ + gld${EMULATION_NAME}_map_segments (FALSE); + finish_default (); +} EOF LDEMUL_BEFORE_PARSE=elfmmix_before_parse +LDEMUL_FINISH=gld"${EMULATION_NAME}"_finish