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][m68k] Support generation of multiple GOTs


Maxim Kuvyrkov <maxim@codesourcery.com> writes:

> +  /* List of GOT entries for this symbol.  This list is build during
> +     offset finalization and is used within elf_m68k_finish_dynamic_symbol ()
> +     to traverse all GOT entries for a particular symbol.

Please don't add parens when referring to functions in comments.  There
are several occurrences throughout the patch.

> +  if ((got->rel_8o_n_entries
> +       > ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT (info))
> +      || (got->rel_8o_16o_n_entries
> +	  > ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT (info)))
> +    /* This BFD has too many relocation.  */
> +    {
> +      char *rel;
> +      int num;
> +
> +      if (got->rel_8o_n_entries
> +	  > ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT (info))
> +	{
> +	  rel = "R_68K_GOT8O";
> +	  num = ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT (info);
> +	}
> +      else
> +	{
> +	  rel = "R_68K_GOT8O and R_68K_GOT16O";
> +	  num = ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT (info);
> +	}
> +
> +      (*_bfd_error_handler) (_("%B: GOT overflow: "
> +			       "Number of %s relocations > %d"),
> +			     abfd, rel, num);

This may be difficult to translate to some languages due to the
substituted sentence fragment.  It's probably better to move the error
handler call into the condition above to avoid the fragment.

> +AC_ARG_ENABLE([got],
> +AS_HELP_STRING([--enable-got=<type>],
> +               [GOT handling scheme (target, single, negative, multigot)]),
> +[case "${enableval}" in
> +  target | single | negative | multigot)  got_handling=$enableval ;;
> +  *)  AC_ERROR(bad value ${enableval} for --enable-got option) ;;
> +esac],
> +[got_handling=target])

I don't think we need that configure option.  Passing the right option
by default via gcc should be enough.

> +@ifset M68K
> +@subsection Options specific to Motorola 68K target
> +
> +@c man begin OPTIONS
> +
> +The following options are supported to control handling of GOT generation
> +when linking for 68K targets.
> +
> +@table @gcctabopt
> +
> +@kindex --got
> +@item --got=@var{type}
> +This option tells the linker which GOT generation scheme to use.
> +@var{type} should be one of @samp{single}, @samp{negative},
> +@samp{multigot} or @samp{target}.  For more information refer to the
> +Info entry for @file{ld}.

The last sentence should use @xref, doesn't it?

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]