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] Add make_elf_object target hooks.


"Doug Kwan (éæå)" <dougkwan@google.com> writes:

> +      gold_fatal(_("%s: unsupported ELF machine number %d"),
> +		 name.c_str(), ehdr.get_e_machine());
>        return NULL;

No need to call return after calling gold_fatal.


> +      obj->setup(ehdr);

It no longer makes sense for Object::setup to take an ehdr parameter.
It should take a target parameter, and avoid looking up the target
again.


> +  // make_elf_object hooks.  There are four versions of these for
> +  // different address sizes and endianities.
> +  
> +#ifdef HAVE_TARGET_32_LITTLE
> +  // Virtual functions which may be overriden by the child class.
> +  virtual Object*
> +  do_make_elf_object(const std::string& name, Input_file* input_file,
> +		     off_t offset, const elfcpp::Ehdr<32, false>& ehdr);
> +#endif
> +
> +#ifdef HAVE_TARGET_32_BIG
> +  // Virtual functions which may be overriden by the child class.
> +  virtual Object*
> +  do_make_elf_object(const std::string& name, Input_file* input_file,
> +		     off_t offset, const elfcpp::Ehdr<32, true>& ehdr);
> +#endif
> +
> +#ifdef HAVE_TARGET_64_LITTLE
> +  // Virtual functions which may be overriden by the child class.
> +  virtual Object*
> +  do_make_elf_object(const std::string& name, Input_file* input_file,
> +		     off_t offset, const elfcpp::Ehdr<64, false>& ehdr);
> +#endif
> +
> +#ifdef HAVE_TARGET_64_BIG
> +  // Virtual functions which may be overriden by the child class.
> +  virtual Object*
> +  do_make_elf_object(const std::string& name, Input_file* input_file,
> +		     off_t offset, const elfcpp::Ehdr<64, true>& ehdr);
> +#endif

Interesting problem.  I wonder if there is anything we can do to make
that easier to write.

Ian


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