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: bfd_sizeof_headers


Alan Modra <amodra@bigpond.net.au> writes:

> @@ -26,13 +26,19 @@ cat >>e${EMULATION_NAME}.c <<EOF
>  static void
>  gld${EMULATION_NAME}_map_segments (bfd_boolean need_layout)
>  {
> -  while (1)
> +  int tries = 10;
> +
> +  while (tries)
>      {
>        if (output_bfd->xvec->flavour == bfd_target_elf_flavour)
>  	{
>  	  bfd_size_type phdr_size;
>  
>  	  phdr_size = elf_tdata (output_bfd)->program_header_size;
> +	  /* If we don't have user supplied phdrs, throw away any
> +	     previous linker generated program headers.  */
> +	  if (lang_phdr_list == NULL)
> +	    elf_tdata (output_bfd)->segment_map = NULL;

Can this leak significant amount of memory?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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