Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 1 | - old GNU ld's behavior wrt DSOs seems to be severely broken. |
| 2 | |
| 3 | y.o reference foo() |
| 4 | y1.o defines foo(), references bar() |
| 5 | y2.o defines bar() |
| 6 | libbar.so defines bar() |
| 7 | |
| 8 | Running |
| 9 | |
| 10 | gcc -o y y.o -lbar y1.o y2.o |
| 11 | |
| 12 | uses the bar() definition from libbar.so and does not mention the definition |
| 13 | in y2.o at all (no duplicate symbol message). Correct is to use the |
| 14 | definition in y2.o. |
| 15 | |
| 16 | |
| 17 | y.o reference foo() |
| 18 | y1.o defines foo(), references bar() |
| 19 | y2.o in liby2.a defines bar() |
| 20 | libbar.so defines bar() |
| 21 | |
| 22 | Running |
| 23 | |
| 24 | gcc -o y y.o -lbar y1.o -ly3 |
| 25 | |
| 26 | has to use the definition in -lbar and not pull the definition from liby3.a. |
| 27 | |
| 28 | |
| 29 | - the old linker follows DT_NEEDED entries and adds the objects referenced |
| 30 | this way which define a symbol which is needed as a DT_NEEDED to the |
| 31 | generated binary. This is wrong since the DT_NEEDED changes the search |
| 32 | path in the object (which is breadth first). |
| 33 | |
| 34 | |
| 35 | - the old linker supported extern "C++", extern "java" in version scripts. |
| 36 | I believe this implementation is severly broken and needs a redesign |
| 37 | (how do wildcards work with these languages*?). Therefore it is left |
| 38 | out for now. |
| 39 | |
| 40 | |
| 41 | - what should happen if two sections in different files with the same |
| 42 | name have different types and/or the flags are different |
| 43 | |
| 44 | |
| 45 | - section names in input files are mostly irrelevant. Exceptions: |
| 46 | |
| 47 | .comment/SHT_PROGBITS in strip, ld |
| 48 | |
| 49 | .debug \ |
| 50 | .line | |
| 51 | .debug_srcinfo | |
| 52 | .debug_sfnames | |
| 53 | .debug_aranges | |
| 54 | .debug_pubnames | |
| 55 | .debug_info | |
| 56 | .debug_abbrev | |
| 57 | .debug_line | |
| 58 | .debug_abbrev > DWARF sections in ld |
| 59 | .debug_line | |
| 60 | .debug_frame | |
| 61 | .debug_str | |
| 62 | .debug_loc | |
| 63 | .debug_macinfo | |
| 64 | .debug_weaknames | |
| 65 | .debug_funcnames | |
| 66 | .debug_typenames | |
| 67 | .debug_varnames / |
| 68 | |
| 69 | Sections created in output files follow the naming of special section |
| 70 | from the gABI. |
| 71 | |
| 72 | In no place is a section solely indentified by its name. Internal |
| 73 | references always use the section index. |