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: RFC/A: Add a bfd hook for defining common symbols


Hi Richard,

What I'm trying to do is here is change something that ld/ does directly
in such a way that some internal bfd datastructures are kept up to date.
If we added a linker emulation hook, it would exist _purely_ for bookkeeping
reasons, not semantic reasons.

I agree. I also like your proposal, although I think that the new define-a-common function needs a bit of work. Specifically:


* Be paranoid - this is an API function - add some error checking of the inputs. (eg H being NULL or H->type not being bfd_link_hash_common).

* Add a boolean return value. If the function fails to perform its duties it should set bfd_error and return FALSE.

* The code in lang_one_common() took note of the setting of bfd_arch_mach_octets_per_byte (via the opb_shift variable), whereas you appear to have dropped this.

* A more descriptive description would be nice. Eg something like "Convert the common symbol H to a regular defined symbol. Returns TRUE upon success, FALSE otherwise."


Cheers Nick


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