This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] MIPS/BFD: Correct IRIX 6 DT_MIPS_OPTIONS processing


"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> Index: binutils-fsf-trunk-quilt/bfd/elfxx-mips.c
> ===================================================================
> --- binutils-fsf-trunk-quilt.orig/bfd/elfxx-mips.c	2012-07-26 03:29:00.000000000 +0100
> +++ binutils-fsf-trunk-quilt/bfd/elfxx-mips.c	2012-07-26 04:45:31.560520511 +0100
> @@ -9268,11 +9268,17 @@ _bfd_mips_elf_size_dynamic_sections (bfd
>  	      && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
>  	    return FALSE;
>  
> -	  if (IRIX_COMPAT (dynobj) == ict_irix6
> -	      && (bfd_get_section_by_name
> -		  (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
> -	      && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
> -	    return FALSE;
> +	  if (IRIX_COMPAT (dynobj) == ict_irix6)
> +	    {
> +	      const char *const name = MIPS_ELF_OPTIONS_SECTION_NAME (dynobj);
> +	      asection *opt_sec;
> +
> +	      opt_sec = bfd_get_section_by_name (dynobj, name);
> +	      if (opt_sec != NULL
> +		  && opt_sec->output_section != bfd_abs_section_ptr
> +		  && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
> +		return FALSE;
> +	    }
>  	}

Looks to me like the code was simply checking the wrong bfd.
It should be checking output_bfd instead.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]