_end symbol in parisc linux?
Anybody know how to get PA-Linux to have an _end symbol like most other programs, including Intel Linux?
-Paul Bame
Quoted 2 lines
Anybody know how to get PA-Linux to have an
_endsymbol 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
In message <[email protected]>you write:
Quoted 8 lines
Quoted 2 lines
Anybody know how to get PA-Linux to have an
_endsymbol 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
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
In message <[email protected]>you write:
Quoted 3 lines
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.
Quoted 5 lines
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
= 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
In message <[email protected]>you write:
Quoted 4 lines
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
Quoted 2 lines
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
Signature · 2 lines
J. David Anglin [email protected] National Research Council of Canada (613) 990-0752 (FAX: 952-6605)