All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] _end symbol in parisc linux?
@ 1999-11-02  0:39 Paul Bame
  1999-11-06 18:26 ` Philipp Rumpf
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Bame @ 1999-11-02  0:39 UTC (permalink / raw)
  To: parisc-linux


Anybody know how to get PA-Linux to have an _end symbol like
most other programs, including Intel Linux?

	-Paul Bame

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [parisc-linux] _end symbol in parisc linux?
@ 1999-11-02 19:13 Donald Scobbie
  0 siblings, 0 replies; 10+ messages in thread
From: Donald Scobbie @ 1999-11-02 19:13 UTC (permalink / raw)
  To: parisc-linux



> Anybody know how to get PA-Linux to have an _end symbol like
> most other programs, including Intel Linux?
>
>         -Paul Bame

Define the symbol as:

extern void *_end;

and the linker will sort it out for you. See the HP-UX man page for
'end'.
I think everyone is linking with the HP-UX ld, but it works for gcc ld
too.

Cheers

Donald

-------------------------------------------------------
Donald Scobbie
Hewlett Packard Ltd.        email:  dscobbie@sqf.hp.com
Telecom Systems Division    Phone:  +44 131 331 6149

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-02  0:39 [parisc-linux] _end symbol in parisc linux? Paul Bame
@ 1999-11-06 18:26 ` Philipp Rumpf
  1999-11-06 20:08   ` Jeffrey A Law
  0 siblings, 1 reply; 10+ messages in thread
From: Philipp Rumpf @ 1999-11-06 18:26 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux

> Anybody know how to get PA-Linux to have an _end symbol like
> most other programs, including Intel Linux?

AFAIK we would need to have linker scripts to do so, which seems to be impossible
with the HP/UX ld.  So this is on the "things that will get nicer when we have
GNU binutils again" list.

	Philipp Rumpf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-06 18:26 ` Philipp Rumpf
@ 1999-11-06 20:08   ` Jeffrey A Law
  1999-11-11 15:36     ` Paul Bame
  0 siblings, 1 reply; 10+ messages in thread
From: Jeffrey A Law @ 1999-11-06 20:08 UTC (permalink / raw)
  To: Philipp Rumpf; +Cc: Paul Bame, parisc-linux


  In message <19991106192614.H11609@mathe.stud.uni-erlangen.de>you write:
  > > Anybody know how to get PA-Linux to have an _end symbol like
  > > most other programs, including Intel Linux?
  > 
  > AFAIK we would need to have linker scripts to do so, which seems to be impo
  > ssible
  > with the HP/UX ld.  So this is on the "things that will get nicer when we h
  > ave
  > GNU binutils again" list.
Actually, you can with SOM with clever use of the sort_key attribute within
a subspace.  Create a new subspace with a larger than normal sort key.  Within
that space create a single symbol "_end".

Though I'd worry about precisely *why* someone wants the _end symbol; whatever
they're trying to do there's probably a better way.

jeff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
@ 1999-11-08 19:18 Cary Coutant
  0 siblings, 0 replies; 10+ messages in thread
From: Cary Coutant @ 1999-11-08 19:18 UTC (permalink / raw)
  To: Jeff Law, Philipp Rumpf; +Cc: Paul Bame, parisc-linux

>  > > Anybody know how to get PA-Linux to have an _end symbol like
>  > > most other programs, including Intel Linux?
>  > 
>  > AFAIK we would need to have linker scripts to do so, which seems to be 
>impo
>  > ssible
>  > with the HP/UX ld.  So this is on the "things that will get nicer when 
>we h
>  > ave
>  > GNU binutils again" list.
>Actually, you can with SOM with clever use of the sort_key attribute within
>a subspace.  Create a new subspace with a larger than normal sort key.  
>Within
>that space create a single symbol "_end".

Donald Scobbie already answered the question:

>Define the symbol as:
>
>extern void *_end;
>
>and the linker will sort it out for you. See the HP-UX man page for
>'end'.

The HP-UX SOM linker will create the symbols _etext, _edata, and _end if 
they are referenced; it won't create them if they're not referenced.

-cary

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-06 20:08   ` Jeffrey A Law
@ 1999-11-11 15:36     ` Paul Bame
  1999-11-11 15:51       ` Jeffrey A Law
  1999-11-11 16:46       ` John David Anglin
  0 siblings, 2 replies; 10+ messages in thread
From: Paul Bame @ 1999-11-11 15:36 UTC (permalink / raw)
  To: parisc-linux


I'm also worried about why there are data symbols following BSS in
our current palinux kernel...

= Though I'd worry about precisely *why* someone wants the _end symbol; whatever
= they're trying to do there's probably a better way.

Maybe there is a better way.  The first reason I want to use _end
(and _edata) is to clear the kernel BSS reliably (which is working
great).

The second reason, which doesn't currently work, is to have a symbol
pointing at the very end of kernel memory, since that is where
free memory will start.

Both these tasks are currently being done at run-time -- in one case
by parsing the SOM header and in another case by guessing about a
parameter passed in by the hpux bootloader -- neither is currently
reliable despite the considerable experimentation and
sweat others have poured into the effort.  I want to avoid parsing
the SOM header and guessing about bootloaders in the future.  It
would also be great to use an old, reliable, and language-system
independent.

	-P

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-11 15:36     ` Paul Bame
@ 1999-11-11 15:51       ` Jeffrey A Law
  1999-11-11 16:14         ` Paul Bame
  1999-11-11 16:46       ` John David Anglin
  1 sibling, 1 reply; 10+ messages in thread
From: Jeffrey A Law @ 1999-11-11 15:51 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux

  In message <199911111536.IAA19092@debian.fc.hp.com>you write:
  > Maybe there is a better way.  The first reason I want to use _end
  > (and _edata) is to clear the kernel BSS reliably (which is working
  > great).
Parse the som exec header.

  > Both these tasks are currently being done at run-time -- in one case
  > by parsing the SOM header and in another case by guessing about a
  > parameter passed in by the hpux bootloader -- neither is currently
  > reliable despite the considerable experimentation and
  > sweat others have poured into the effort.
Then I'd suggest looking at code from folks that have done this in the past;
Utah's BSD & Mach kernels both handle parsing of the SOM exec header just
fine.


jeff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-11 15:51       ` Jeffrey A Law
@ 1999-11-11 16:14         ` Paul Bame
  1999-11-11 17:32           ` Jeffrey A Law
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Bame @ 1999-11-11 16:14 UTC (permalink / raw)
  Cc: parisc-linux


= Parse the som exec header.

I guess I mangled my earlier note.  I also want a language-system
independent method since we'll not always be wedded to SOM.  More
urgently, the SOM header is apparently unavailable to a program
launched from the hpux bootloader.  I just checked, and HP-UX doesn't
parse the SOM header either -- it uses _end and _edata.

Perhaps you'd be kind enough to write a scrap of assembly magic
which performs the subspace trick you mentioned earlier?  Yeah
it may be ugly and still language-system dependent, but without access
to the SOM header at boot time there's not a prettier option.

Thanks!

	-P

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-11 15:36     ` Paul Bame
  1999-11-11 15:51       ` Jeffrey A Law
@ 1999-11-11 16:46       ` John David Anglin
  1 sibling, 0 replies; 10+ messages in thread
From: John David Anglin @ 1999-11-11 16:46 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux

> I'm also worried about why there are data symbols following BSS in
> our current palinux kernel...

I presume that the method of using the linker to define _end isn't
working.  Possibly, it is because the sort order for the sections $ANS$
and $CI$ is wrong.

164 (hiauly1)dave> objdump --headers vmlinux

vmlinux:          file format som

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 $TEXT$        0007a658  c0010000  00000000  00035000  2**3

  1 $FIRST$       00000208  c0010000  00000000  00035000  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 $SHLIB_INFO$  00000000  c0010208  00000000  00035208  2**3
		  ALLOC, LOAD, READONLY, CODE
  3 $MILLICODE$   00001ab8  c0011000  00000000  00036000  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  4 $LIT$         0000e340  c0012ab8  00000000  00037ab8  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  5 $CODE$        00062c28  c0020df8  00000000  00045df8  2**3
	          CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 $UNWIND_START$ 000063d0  c0083a20  00000000  000a8a20  2**3
		  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 $UNWIND_END$  00000868  c0089df0  00000000  000aedf0  2**3
	          CONTENTS, ALLOC, LOAD, READONLY, CODE
  8 $PRIVATE$     0006f2c8  c008b000  00000000  000b0000  2**3

  9 $GLOBAL$      00000008  c008b000  00000000  000b0000  2**3
		  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 $DATA_START$  00000000  c008b008  00000000  000b0008  2**3
		  ALLOC, LOAD, DATA
 11 .data.cacheline_aligned 00000020  c008c000  00000000  000b1000  2**3
		  CONTENTS, ALLOC, LOAD, DATA
 12 $DATA$        0006d2c8  c008d000  00000000  000b2000  2**12
		  CONTENTS, ALLOC, LOAD, DATA
 13 $BSS$         00015930  c00fa2c8  00000000  00000000  2**3
		  ALLOC
 14 $ANS$         00000a42  00000000  00000000  00120000  2**2
		  DEBUGGING
 15 $CI$          00000a42  00000000  00000000  00120000  2**2
	          CONTENTS, DATA, DEBUGGING

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [parisc-linux] _end symbol in parisc linux?
  1999-11-11 16:14         ` Paul Bame
@ 1999-11-11 17:32           ` Jeffrey A Law
  0 siblings, 0 replies; 10+ messages in thread
From: Jeffrey A Law @ 1999-11-11 17:32 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux

  In message <199911111614.JAA19293@debian.fc.hp.com>you write:
  > Perhaps you'd be kind enough to write a scrap of assembly magic
  > which performs the subspace trick you mentioned earlier?  Yeah
  > it may be ugly and still language-system dependent, but without access
  > to the SOM header at boot time there's not a prettier option.

	.space $PRIVATE$
	.subspa $AFTERBSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=83
_end:


Or something close to that.

What it does is create a new data section $AFTERBSS$ which has a sort key
greater than $BSS$ ($BSS$'s sort key is 82).  Within that section we define
one symbol "_end".

jeff

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1999-11-11 17:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-11-02  0:39 [parisc-linux] _end symbol in parisc linux? Paul Bame
1999-11-06 18:26 ` Philipp Rumpf
1999-11-06 20:08   ` Jeffrey A Law
1999-11-11 15:36     ` Paul Bame
1999-11-11 15:51       ` Jeffrey A Law
1999-11-11 16:14         ` Paul Bame
1999-11-11 17:32           ` Jeffrey A Law
1999-11-11 16:46       ` John David Anglin
  -- strict thread matches above, loose matches on Subject: below --
1999-11-02 19:13 Donald Scobbie
1999-11-08 19:18 Cary Coutant

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.