PATCH: ld/2338: objdump -d -l doesn't work correctly

Eric Botcazou ebotcazou@adacore.com
Mon Feb 27 19:39:00 GMT 2006


> Good point. Here is an updated patch.
>
>
> H.J.
> ----
> 2006-02-21  H.J. Lu  <hongjiu.lu@intel.com>
>
> 	PR binutils/2338
> 	* dwarf2.c (loadable_section): New struct.
> 	(dwarf2_debug): Add loadable_section_count and
> 	loadable_sections.
> 	(check_function_name): Removed.
> 	(unset_sections): New.
> 	(place_sections): New.
> 	(_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
> 	and unset_sections on relocatable files.
> 	(_bfd_dwarf2_find_line): Likewise.

Works For Me(tm).  Thanks.

> -/* Return TRUE if there is no mismatch bewteen function FUNC and
> -   section SECTION from symbol table SYMBOLS in ABFD.  */
> +/* Unset vmas for loadable sections in STASH.  */
> +
> +static void
> +unset_sections (struct dwarf2_debug *stash)
> +{
> +  unsigned int i;
> +  struct loadable_section *p;
> +
> +  i = stash->loadable_section_count;
> +  p = stash->loadable_sections;
> +  for (; i > 0; i--, p++)
> +    p->section->vma = p->orig_vma;
> +}

Minor stylistic nit, but I think the "for (;;)" idiom is a little abused here.

-- 
Eric Botcazou



More information about the Binutils mailing list