[kwlug disc.] "ld" and options and read-only text sections

Robert P. J. Day rpjday at mindspring.com
Mon May 7 09:58:09 EDT 2007


  i'm playing with options to "ld" to affect the final link step in
building an executable, and it seems like some of the advertised
options don't do what they're supposed to.

  consider a bit of the output from "ld --help":

  -M, --print-map             Print map file on standard output
  -n, --nmagic                Do not page align data
  -N, --omagic                Do not page align data, do not make text readonly
  --no-omagic                 Page align data, make text readonly
  ...
  -t, --trace                 Trace file opens


ok, so if i wanted to see the map file, i could compile with:

  $ gcc -Wl,-M hi.c -o hi

which seems to work.  if i wanted to trace the file opens:

  $ gcc -Wl,-t hi.c -o hi

which also seems to work.  but neither of -n or -N does what it's
supposed to:

  $ gcc -Wl,-n hi.c -o hi
  /usr/bin/ld: cannot find -lgcc_s
  collect2: ld returned 1 exit status

am i misreading what this should be doing?  all of the other options
seem to be working fine.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================


More information about the KWLUG-Disc mailing list