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] gold: Maintain sparc ELF header bits properly


David Miller <davem@davemloft.net> writes:

> gold/
>
> 	* sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
> 	and elf_flags_set_.
> 	(Target_sparc::Target_sparc): Initialize new fields.
> 	(Target_sparc::do_make_elf_object): New function.
> 	(Target_sparc::do_adjust_elf_header): New function.

> +template<int size, bool big_endian>
> +Object*
> +Target_sparc<size, big_endian>::do_make_elf_object(
> +    const std::string& name,
> +    Input_file* input_file,
> +    off_t offset, const elfcpp::Ehdr<size, big_endian>& ehdr)
> +{
> +  elfcpp::Elf_Word omm, mm, flags = ehdr.get_e_flags();
> +  elfcpp::Elf_Half machine = ehdr.get_e_machine();

Sorry, but please write the flags with the initializer on a separate
line.  I find it confusing when some variables are declared and some are
initialized on the same line (or when there are multiple initializers on
one line).

> +  // Validate that the little-endian flag matches how we've
> +  // been instantiated.
> +  if (!(flags & elfcpp::EF_SPARC_LEDATA) != big_endian)
> +    {
> +      if (big_endian)
> +	gold_error(_("%s: Little endian elf flag set on BE object"),
> +		     name.c_str());
> +      else
> +	gold_error(_("%s: Little endian elf flag clear on LE object"),
> +		     name.c_str());
> +    }

Gold error message start with lower case letters, so /Little/little/,
twice.

This is OK with those changes.

Thanks.

Ian


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