9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 5a and optimization
@ 2006-01-19 11:30 Noah Evans
  2006-01-19 15:49 ` jmk
  0 siblings, 1 reply; 4+ messages in thread
From: Noah Evans @ 2006-01-19 11:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs Bell Labs

How do you keep the linker from optimizing away your rom headers and  
other data? I had to put a noop in front of my first text section to  
keep the linker from putting the main loop in front of it. I also had  
to code the branch past the rom header in hex to keep the linker from  
eating the header(it's unreachable).

Best,

Noah


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

* Re: [9fans] 5a and optimization
  2006-01-19 11:30 [9fans] 5a and optimization Noah Evans
@ 2006-01-19 15:49 ` jmk
  2006-01-19 15:59   ` Noah Evans
  0 siblings, 1 reply; 4+ messages in thread
From: jmk @ 2006-01-19 15:49 UTC (permalink / raw)
  To: 9fans

One way is to make it TEXT, e.g. the multiboot header and GDT stuff
in /sys/src/9/pc/l.s.

Agreed, the loaders don't make such things easy to do, but writing
assembler and making odd format binaries is the exception, not the
rule.

--jim

On Thu Jan 19 06:31:30 EST 2006, noah.evans@gmail.com wrote:
> How do you keep the linker from optimizing away your rom headers and  
> other data? I had to put a noop in front of my first text section to  
> keep the linker from putting the main loop in front of it. I also had  
> to code the branch past the rom header in hex to keep the linker from  
> eating the header(it's unreachable).
> 
> Best,
> 
> Noah


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

* Re: [9fans] 5a and optimization
  2006-01-19 15:49 ` jmk
@ 2006-01-19 15:59   ` Noah Evans
  2006-01-19 17:05     ` Bruce Ellis
  0 siblings, 1 reply; 4+ messages in thread
From: Noah Evans @ 2006-01-19 15:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Yeah, I put it in l.s(probably should put it in rom.s but who knows).  
The linker eats the text if I leave the branch in. So I put the  
branch in a WORD and(thanks to Charles' advice) use -E to go to the  
initial TEXT _rom section.

Very true about the rom weirdness.

Thank you very much for the advice. I really appreciate the support.

Noah

On Jan 20, 2006, at 12:49 AM, jmk@plan9.bell-labs.com wrote:

> One way is to make it TEXT, e.g. the multiboot header and GDT stuff
> in /sys/src/9/pc/l.s.
>
> Agreed, the loaders don't make such things easy to do, but writing
> assembler and making odd format binaries is the exception, not the
> rule.
>
> --jim
>
> On Thu Jan 19 06:31:30 EST 2006, noah.evans@gmail.com wrote:
>> How do you keep the linker from optimizing away your rom headers and
>> other data? I had to put a noop in front of my first text section to
>> keep the linker from putting the main loop in front of it. I also had
>> to code the branch past the rom header in hex to keep the linker from
>> eating the header(it's unreachable).
>>
>> Best,
>>
>> Noah



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

* Re: [9fans] 5a and optimization
  2006-01-19 15:59   ` Noah Evans
@ 2006-01-19 17:05     ` Bruce Ellis
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Ellis @ 2006-01-19 17:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

the mips compilers (at least 0c and ec etc.) support psuedo instrs
(NOSCHED, SCHED i think) which really stops your low level
code being screwed with.

brucee

On 1/20/06, Noah Evans <noah.evans@gmail.com> wrote:
> Yeah, I put it in l.s(probably should put it in rom.s but who knows).
> The linker eats the text if I leave the branch in. So I put the
> branch in a WORD and(thanks to Charles' advice) use -E to go to the
> initial TEXT _rom section.
>
> Very true about the rom weirdness.
>
> Thank you very much for the advice. I really appreciate the support.
>
> Noah
>
> On Jan 20, 2006, at 12:49 AM, jmk@plan9.bell-labs.com wrote:
>
> > One way is to make it TEXT, e.g. the multiboot header and GDT stuff
> > in /sys/src/9/pc/l.s.
> >
> > Agreed, the loaders don't make such things easy to do, but writing
> > assembler and making odd format binaries is the exception, not the
> > rule.
> >
> > --jim
> >
> > On Thu Jan 19 06:31:30 EST 2006, noah.evans@gmail.com wrote:
> >> How do you keep the linker from optimizing away your rom headers and
> >> other data? I had to put a noop in front of my first text section to
> >> keep the linker from putting the main loop in front of it. I also had
> >> to code the branch past the rom header in hex to keep the linker from
> >> eating the header(it's unreachable).
> >>
> >> Best,
> >>
> >> Noah
>
>


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

end of thread, other threads:[~2006-01-19 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-19 11:30 [9fans] 5a and optimization Noah Evans
2006-01-19 15:49 ` jmk
2006-01-19 15:59   ` Noah Evans
2006-01-19 17:05     ` Bruce Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).