RFC/A: Add a bfd hook for defining common symbols
Nick Clifton
nickc@redhat.com
Thu Apr 2 09:31:00 GMT 2009
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
More information about the Binutils
mailing list