ld: implement -z type=pie

Review Request #295 — Created Dec. 15, 2016 and updated

richlowe
illumos-gate
386b105...
general
- Build shared objects with an interpretter (basic PIE-ness)
- Don't go through the GOT/PLT for local symbols, since we can't be
  interposed.


  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
igork
  1. Ship It!
  2. 
      
jeffpc
  1. 
      
  2. usr/src/cmd/sgs/include/libld.h (Diff revision 1)
     
     

    PIE executable is a bit redundant ;)

  3. 
      
richlowe
jeffpc
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. usr/src/cmd/sgs/libld/common/args.c (Diff revision 2)
     
     
    Trailing comma may break Studio, fwiw.
  3. usr/src/cmd/sgs/libld/common/args.c (Diff revision 2)
     
     
    So what is the expected behavior of things being built PIE and the -z text family of options?
    1. You indicated on IRC that you may have meant -z defs, which rev3 here corrects (it got lost when I rearranged the option parsing).
      Good catch.

      I'm not marking this fixed in case you did mean -z text

    2. Yeah, I did mean -z defs and not -z text.
  4. usr/src/man/man1/ld.1 (Diff revision 2)
     
     
    Should we be consistent in capitalization with the other text form of options?
    
    Should the manual page be calling out that something built with -z type=pie behaves in a similar way to things marked with shared objects? Or what bits actually hold and don't from the rest of the options. e.g. can -B reduce, -B symbolic, -z text, etc. be applied?
    1. I capitalized it as the expansion of an acronym. Is that not a thing people do?

      All the options that can apply to shared objects can apply to pie (modulo the bit with -ztext). (You may not want to, though).

    2. I dunno about the capitalization thing. I saw it and was just thrown off at first. But probably makes sense. We can worry about it later.
  5. 
      
richlowe
Review request changed
rm
  1. I think the changes look good here in general. I'll try and think about how we can better talk about this in the manual page, but I'm not sure I have a great answer at the moment.

  2. 
      
kmays
  1. Ship It!
  2. 
      
Loading...