This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Advice needed on when to synthesize <sym>.high_bound in ld
- To: greg at mcgary dot org
- Subject: Re: Advice needed on when to synthesize <sym>.high_bound in ld
- From: Nick Clifton <nickc at redhat dot com>
- Date: Fri, 8 Sep 2000 17:52:02 -0700
- CC: binutils at sources dot redhat dot com
Hi Greg,
: The problematic part is how to set the value. For common symbols,
: it's easy: h->u.def.value = datum->u.def.value + datum->u.c.size; (h
: is the high_bound symbol, and datum is the base-name symbol). For an
: initialized data symbol, it's not so easy since there's no size field
: in the symbol table. Are you aware of any convenient way out of this?
Symbols do have a size. In fact it is the size of common symbols that
is problematic, as it can change of a bigger definition of the symbol
comes along. (Would your patch handle this BTW ?)
Since we are talking ELF here, in theory all you need to do is to get
hold of the elf_link_hash_entry structure for the symbol and examine
its 'size' field. You might look, for example at the function
bfd_elf_link_hash_newfunc() in bfd/elf.c
Cheers
Nick