This is the mail archive of the binutils@sources.redhat.com 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]

Re: [patch] to ld: embedded relocs for m68k ELF, part 2 of 2


Hi Michael,

: 2000-09-10  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
: 
: 	* elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function.
: 	* bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration.
: 	* bfd-in2.h: Regenerate.

: 2000-09-10  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
: 
: 	* emultempl/m68kelf.em: New file.
: 	* emulparams/m68kelf.sh (EXTRA_EM_FILE): Use it.
: 	* Makefile.am (em68kelf.c): Add dependency on m68kelf.em.
: 	* Makefile.in: Regenerate.

Approved and applied.

Note - I had to fix a bug in the code that you submitted, which leads
me to believe that you may not have tested this code before submitting
it:

: +   else
: +     {
: +       /* Go get them off disk.  */
: +       if (info.keep_memory)
: + 	extsyms = ((Elf32_External_Sym *)
: + 		   bfd_alloc (abfd, symtab_hdr->sh_size));
: +       else
: + 	extsyms = ((Elf32_External_Sym *)
: + 		   bfd_malloc (symtab_hdr->sh_size));
: +       if (extsyms == NULL)
: + 	goto error_return;
: +       if (! info.keep_memory)
: + 	free_extsyms = extsyms;
: +       if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
: + 	  || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd)
: + 	      != symtab_hdr->sh_size))
: + 	goto error_return;
: +       if (info.keep_memory)
: + 	symtab_hdr->contents = extsyms;
: +     }

'info' is a pointer, not a structure, so the references to
'info.keep_memory' in the code above fail.  I replaced these with
'info->keep_memory'.

Cheers
	Nick

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