From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felix Lee To: binutils@sourceware.cygnus.com Subject: patch for elf32-mips.c Date: Sat, 25 Sep 1999 06:14:00 -0000 Message-id: <24836.938265289.0@NO-ID-FOUND.mhonarc.org> X-SW-Source: 1999-q3/msg00717.html symptom: for some mips-elf targets, the linker sometimes spuriously complains: relocation truncated to fit: R_MIPS_LITERAL no symbol analysis: mips_elf_calculate_relocation () sometimes neglects to set gp and gp0 before using them. fix: 1999-09-25 Felix Lee * elf32-mips.c (mips_elf_calculate_relocation): Typo and R_MIPS_LITERAL bug. Index: elf32-mips.c =================================================================== RCS file: /cvs/binutils/binutils/bfd/elf32-mips.c,v retrieving revision 1.51 diff -c -p -r1.51 elf32-mips.c *** elf32-mips.c 1999/08/27 00:08:49 1.51 --- elf32-mips.c 1999/09/25 12:53:02 *************** mips_elf_calculate_relocation (abfd, *** 5895,5901 **** *namep = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); ! if (*namep == '\0') *namep = bfd_section_name (input_bfd, sec); target_is_16_bit_code_p = (sym->st_other == STO_MIPS16); --- 5895,5901 ---- *namep = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); ! if (**namep == '\0') *namep = bfd_section_name (input_bfd, sec); target_is_16_bit_code_p = (sym->st_other == STO_MIPS16); *************** mips_elf_calculate_relocation (abfd, *** 6070,6075 **** --- 6070,6077 ---- case R_MIPS_HI16: case R_MIPS_LO16: + case R_MIPS_LITERAL: + case R_MIPS16_GPREL: case R_MIPS_GPREL16: case R_MIPS_GPREL32: gp0 = _bfd_get_gp_value (input_bfd);