This is the mail archive of the binutils@sourceware.cygnus.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 for N32 ABI


On Tue, Jun 29, 1999 at 12:50:00AM -0700, Mark Mitchell wrote:
> +  /* The linker script will have created a symbol named `_gp' with the
> +     appropriate value.  */
> +  if (sym == (asymbol **) NULL)
> +    i = count;
> +  else
> +    {
> +      for (i = 0; i < count; i++, sym++)

Something like 

	struct elf_link_hash_entry *gp;
	gp = elf_link_hash_lookup (elf_hash_table (info), "_gp",
				   false, false, false)

should work, no?  Better than a loop over the symbols.

> -	  if (sym == (asymbol **) NULL)
> -	    i = count;
> -	  else
> -	    {
> -	      for (i = 0; i < count; i++, sym++)

I see that you've just moved the code, so I won't press the point.

>        /* Common symbols less than the GP size are automatically
>  	 treated as SHN_MIPS_SCOMMON symbols.  */
> -      if (asym->value > elf_gp_size (abfd))
> +      if (asym->value > elf_gp_size (abfd)
> +	  || IRIX_COMPAT (abfd) == ict_irix6)

Might do to update the comment here.

> +  return ((value + 0x8000LL) >> 16) & 0xffff;

Can't use L or U or LL in K&R C.

> +static bfd_vma
> +mips_elf_higher (value)
> +     bfd_vma value;
> +{
> +  return ((value + 0x80008000LL) >> 32) & 0xffff;

Does this make sense without BFD64?

> +#if 0
> +  rel = relocs;
> +  for (; rel < relend; rel++)

I don't like leaving all that if 0 code there.  Just delete it. 
That's what revision control is for.

> +  /* The linker script takes care of providing names and values for
> +     these, but we must place them into the right sections.  */
> +  static const char* text_section_symbols[] = {
> +    "_ftext",
> +    "_etext",
> +    "__dso_displacement",
> +    "__elf_header",
> +    "__program_header_table",

You know, we can just put these in the appropriate sections in the 
linker script. 

  .text      :
  {
    PROVIDE (_ftext = .);
    *(.text)
    *(.stub)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
    *(.gnu.linkonce.t*)
    PROVIDE (_etext = .);
  }

Much cleaner from my point of view.

> +	  /* All of these symbols are given type STT_SECTION by the
> +	     IRIX6 linker.  */

Eww.  Ok, nevermind.

Looks good.



r~

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