This is the mail archive of the binutils@sources.redhat.com 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]

Re: [patch] elf.sc: Only do INIT_START, INIT_END, FINI_START and FINI_END if relocating


Hi Hans-Peter,

: I guess this is an oversight rather than intentional.  If not,
: please tell why to do INIT_START, INIT_END, FINI_START or FINI_END
: at other times than when relocating, so we can add a comment there.
: The only current user, elf64hppa.sh, defines it unusable for a
: relative link.

I agree, it does seem to be an oversight.

: 2000-07-11  Hans-Peter Nilsson  <hp@axis.com>
: 
: 	* scripttempl/elf.sc (.init): Only do ${INIT_START} and
: 	${INIT_END} if relocating.
: 	(.fini): Likewise ${FINI_START} and ${FINI_END}.

Approved.


: While we're in elf.sc, imagine ld invoked with -Tbss 0x400000.
: Now, unless data ends at exactly 0x400000, __bss_start and whatever
: use of "." in OTHER_BSS_SYMBOLS will get surprising values.

Setting addresses with -T is a dangerous thing to do, and should
really only be done if you known what you are doing.

: We can do as above for __bss_start in elf.sc, but perhaps having 
: a new ld intrinsic, named for example NEXT_ADDRESS_WITH_CONTENT
: or NEXT_USED_ADDRESS makes sense.

This would still not work if the .sbss section is being used.  Or
rather it would work, but there could now be a large gap between the
.sbss and the .bss section, which is probably not what was wanted.

I doubt though, that is really important enough to people to be worth
hacking on.  If you want to be able to move the bss segment around
then you ought to be writing your own linker scripts anyway, rather
than trying to force the builtin in to do it for you.

Cheers
	Nick

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