Updated patch for binutils 2.9.1.0.4
Hi,
here is an updated patch for binutils 2.9.1.0.4. If you want to successfully recompile glibc 2.0.99 you'll need this patch. This bug is probably in ld as long as it exists. For a more detailed explanation of the bug see the comment in ld/ldlang.c. The bugs mentioned in my previous posting are all still unfixed.
Ralf
bfd/elf32-mips.c +33 -26
@@ -5113,36 +5113,43 @@ }else { -long indx; - -if (h ==NULL ) - sec = local_sections[r_symndx]; -else - { -BFD_ASSERT (h->root.type == bfd_link_hash_defined - || (h->root.type - == bfd_link_hash_defweak)); - sec = h->root.u.def.section; - } -if (sec !=NULL &&bfd_is_abs_section (sec)) - indx =0 ; -else if (sec ==NULL || sec->owner ==NULL ) +if (r_type ==R_MIPS_32 ) { -bfd_set_error (bfd_error_bad_value); -return false; + outrel.r_info =ELF32_R_INFO (0 ,R_MIPS_REL32 ); + addend += relocation; } -else - { -asection *osec; +else + { +long indx; - osec = sec->output_section; - indx =elf_section_data (osec)->dynindx; -if (indx ==0 ) -abort (); - } +if (h ==NULL ) + sec = local_sections[r_symndx]; +else + { +BFD_ASSERT (h->root.type == bfd_link_hash_defined + || (h->root.type + == bfd_link_hash_defweak)); + sec = h->root.u.def.section; + } +if (sec !=NULL &&bfd_is_abs_section (sec)) + indx =0 ; +else if (sec ==NULL || sec->owner ==NULL ) + { +bfd_set_error (bfd_error_bad_value); +return false; + } +else + { +asection *osec; - outrel.r_info =ELF32_R_INFO (indx,R_MIPS_REL32 ); - addend += relocation; + osec = sec->output_section; + indx =elf_section_data (osec)->dynindx; +if (indx ==0 ) +abort (); + } + outrel.r_info =ELF32_R_INFO (indx,R_MIPS_REL32 ); + addend += relocation; + } }if (! skip)
gas/ChangeLog +7 -0
@@ -1,3 +1,10 @@ +Thu Nov 4 03:23:59 1998 Ralf Baechle <[email protected]> + + * config/tc-mips.c (macro): Only emit a BFD_RELOC_MIPS_LITERAL + when the symbol is in the .lit section. Required for a.out + support. + (mips_ip): Fix %HI, %hi and %lo operators. + Mon Apr 27 13:45:04 1998 Ian Lance Taylor <[email protected]> * configure.in: Set version number to 2.9.1.
gas/config/tc-mips.c +52 -17
97 lines not on this page · raw message
ld/ldlang.c +18 -0
@@ -2353,6 +2353,24 @@ {asection *i; +/* MIPS specific hack. The .reginfo section on MIPS is special in +that it's not being produced by concatenting the input sections. +The size is always constant. Here we check if an output +.reginfo section has already been created. If so, we skip the +rest of the sizing process the output .reginfo section as all +section fields which need to be set have already reached their +final values. We can't do this in the backend since by the time +when the backend gets involved the vmas etc. have already been +computed based on the assumption of concatenating all section. +In case of a large number of files to be linked this may result +in a third PT_LOAD header being created which will crash the +linking process since we don't have header space for it. */ +if (output_section_statement->bfd_section->name + &&strcmp (".reginfo" , + output_section_statement->bfd_section->name) ==0 + && output_section_statement->bfd_section->_raw_size) +break ; + i = (*prev)->input_section.section;if (! relax) {