Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 74 lines (52 sloc) 1.972 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
- old GNU ld's behavior wrt DSOs seems to be severely broken.

     y.o reference foo()
     y1.o defines foo(), references bar()
     y2.o defines bar()
     libbar.so defines bar()

  Running

     gcc -o y y.o -lbar y1.o y2.o

  uses the bar() definition from libbar.so and does not mention the definition
  in y2.o at all (no duplicate symbol message). Correct is to use the
  definition in y2.o.


     y.o reference foo()
     y1.o defines foo(), references bar()
     y2.o in liby2.a defines bar()
     libbar.so defines bar()

  Running

     gcc -o y y.o -lbar y1.o -ly3

  has to use the definition in -lbar and not pull the definition from liby3.a.


- the old linker follows DT_NEEDED entries and adds the objects referenced
  this way which define a symbol which is needed as a DT_NEEDED to the
  generated binary. This is wrong since the DT_NEEDED changes the search
  path in the object (which is breadth first).


- the old linker supported extern "C++", extern "java" in version scripts.
  I believe this implementation is severly broken and needs a redesign
  (how do wildcards work with these languages*?). Therefore it is left
  out for now.


- what should happen if two sections in different files with the same
  name have different types and/or the flags are different


- section names in input files are mostly irrelevant. Exceptions:

  .comment/SHT_PROGBITS in strip, ld

  .debug \
  .line |
  .debug_srcinfo |
  .debug_sfnames |
  .debug_aranges |
  .debug_pubnames |
  .debug_info |
  .debug_abbrev |
  .debug_line |
  .debug_abbrev > DWARF sections in ld
  .debug_line |
  .debug_frame |
  .debug_str |
  .debug_loc |
  .debug_macinfo |
  .debug_weaknames |
  .debug_funcnames |
  .debug_typenames |
  .debug_varnames /

  Sections created in output files follow the naming of special section
  from the gABI.

  In no place is a section solely indentified by its name. Internal
  references always use the section index.
Something went wrong with that request. Please try again.