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]
Other format: [Raw text]

Re: binutils-doc 2.15-5: glitches in ld.info


On Thu, Jan 20, 2005 at 05:21:48PM +0100, Edward Welbourne wrote:
> I have version 2.15-5 of the binutils-doc package as shipped with
> Debian/sarge.  I was reading up on Linker Scripts in the ld info pages
> and noticed what I suppose to be some errors;

Thanks.  The CONSTRUCTOR paragraph is wrong, fixed by the following.

	* ld.texinfo (Output Section Keywords <CONSTRUCTORS>): Correct
	__DTOR_LIST__ description.

>        extern char __load_start_text1, __load_stop_text1;
>        memcpy ((char *) 0x1000, &__load_start_text1,
>                &__load_stop_text1 - &__load_start_text1);

However, this example is correct, and your suggested change

>        extern char *__load_start_text1, *__load_stop_text1;
>        memcpy ((char *) 0x1000, __load_start_text1,
>                __load_stop_text1 - __load_start_text1);

won't work like you think it will..

Index: ld.texinfo
===================================================================
RCS file: /cvs/src/src/ld/ld.texinfo,v
retrieving revision 1.136
diff -u -p -r1.136 ld.texinfo
--- ld.texinfo	23 Jan 2005 05:36:37 -0000	1.136
+++ ld.texinfo	23 Jan 2005 07:37:22 -0000
@@ -3396,7 +3396,9 @@ linker to place constructor information 
 ignored for other object file formats.
 
 The symbol @w{@code{__CTOR_LIST__}} marks the start of the global
-constructors, and the symbol @w{@code{__DTOR_LIST}} marks the end.  The
+constructors, and the symbol @w{@code{__CTOR_END__}} marks the end.
+Similarly, @w{@code{__DTOR_LIST__}} and @w{@code{__DTOR_END__}} mark
+the start and end of the global destructors.  The
 first word in the list is the number of entries, followed by the address
 of each constructor or destructor, followed by a zero word.  The
 compiler must arrange to actually run the code.  For these object file

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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