9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] new contest
@ 2009-02-27 22:42 ron minnich
  2009-02-27 23:39 ` Gorka Guardiola
  0 siblings, 1 reply; 2+ messages in thread
From: ron minnich @ 2009-02-27 22:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Here's the code:
#include <sysdep/SysDep.h>

int main ()
{
  DCMF::Log::Log l;
//  DCMF::Personality p(l);

}

Here's the binary:
-rwxr-xr-x 1 rminnich users 4603961 2009-02-27 16:37 pers.cnk

Here's what it is:
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x01000000 0x01000000 0xc76ae 0xc76ae R E 0x10000
  LOAD           0x0d0000 0x01100000 0x01100000 0x00828 0x06638 RW  0x10000


Beat that.

ron



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

* Re: [9fans] new contest
  2009-02-27 22:42 [9fans] new contest ron minnich
@ 2009-02-27 23:39 ` Gorka Guardiola
  0 siblings, 0 replies; 2+ messages in thread
From: Gorka Guardiola @ 2009-02-27 23:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Feb 27, 2009 at 11:42 PM, ron minnich <rminnich@gmail.com> wrote:

>
> Beat that.
>
> ron
>
>

nm shows that printf gets changed for puts, so after taking everything
out:


int
main(int argc, char *argv[])
{
     printf(¨hello darkness¨);
}

//no includes... no defines, nothing I am paranoid about libc now


gcc -c darkness darkness.c

darkness.c: In function 'main':
darkness.c:5: warning: incompatible implicit declaration of built-in
function 'printf'


wait, builtin??

nm darkness.o

00000000 T main
         U puts

puts?. where did that come from hmm ah builtin...

quoting some anonymous gcc developer
you are not *allowed* to modify the C library
functions unless you ask gcc for permission...

gcc -fno-builtin

gcc -please-let-me-write-my-function-please...

-- 
- curiosity sKilled the cat



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

end of thread, other threads:[~2009-02-27 23:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-27 22:42 [9fans] new contest ron minnich
2009-02-27 23:39 ` Gorka Guardiola

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).