Blame NOTES

Packit 032894
Fundamental design decision:
Packit 032894
Packit 032894
- the sizes of external and internal types are assumed to be the same.
Packit 032894
  This leaves byte ordering aside.  While assuming this the code can be
Packit 032894
  greatly simplified and speed increases.  Since no change violating this
Packit 032894
  assumption is in sight this is believed to be a worthwhile optimization.
Packit 032894
Packit 032894
- the ABI of the backend modules is not guaranteed.  Really, no guarantee
Packit 032894
  whatsoever.  We are enforcing this in the code.  The modules and their
Packit 032894
  users must match.  No third-party EBL module are supported or allowed.
Packit 032894
  The only reason there are separate modules is to not have the code for
Packit 032894
  all architectures in all the binaries.
Packit 032894
Packit 032894
- although the public libraries (libasm, libdw) have a stable API and are
Packit 032894
  backwards ABI compatible they, and the elfutils tools, do depend on each
Packit 032894
  others internals, and on internals of libelf to provide their interfaces.
Packit 032894
  So they should always be upgraded in lockstep when packaging the tools
Packit 032894
  and libraries separately. For one example of how to do that, see the
Packit 032894
  config/elfutils.spec.
Packit 032894
Packit 032894
Some notes:
Packit 032894
Packit 032894
- old GNU ld's behavior wrt DSOs seems to be severely broken.
Packit 032894
Packit 032894
     y.o reference foo()
Packit 032894
     y1.o defines foo(), references bar()
Packit 032894
     y2.o defines bar()
Packit 032894
     libbar.so defines bar()
Packit 032894
Packit 032894
  Running
Packit 032894
Packit 032894
     gcc -o y y.o -lbar y1.o y2.o
Packit 032894
Packit 032894
  uses the bar() definition from libbar.so and does not mention the definition
Packit 032894
  in y2.o at all (no duplicate symbol message).  Correct is to use the
Packit 032894
  definition in y2.o.
Packit 032894
Packit 032894
Packit 032894
     y.o reference foo()
Packit 032894
     y1.o defines foo(), references bar()
Packit 032894
     y2.o in liby2.a defines bar()
Packit 032894
     libbar.so defines bar()
Packit 032894
Packit 032894
  Running
Packit 032894
Packit 032894
     gcc -o y y.o -lbar y1.o -ly3
Packit 032894
Packit 032894
  has to use the definition in -lbar and not pull the definition from liby3.a.
Packit 032894
Packit 032894
Packit 032894
- the old linker follows DT_NEEDED entries and adds the objects referenced
Packit 032894
  this way which define a symbol which is needed as a DT_NEEDED to the
Packit 032894
  generated binary.  This is wrong since the DT_NEEDED changes the search
Packit 032894
  path in the object (which is breadth first).
Packit 032894
Packit 032894
Packit 032894
- the old linker supported extern "C++", extern "java" in version scripts.
Packit 032894
  I believe this implementation is severly broken and needs a redesign
Packit 032894
  (how do wildcards work with these languages*?).  Therefore it is left
Packit 032894
  out for now.
Packit 032894
Packit 032894
Packit 032894
- what should happen if two sections in different files with the same
Packit 032894
  name have different types and/or the flags are different
Packit 032894
Packit 032894
Packit 032894
- section names in input files are mostly irrelevant.  Exceptions:
Packit 032894
Packit 032894
  .comment/SHT_PROGBITS		in strip, ld
Packit 032894
Packit 032894
  .debug		\
Packit 032894
  .line			|
Packit 032894
  .debug_srcinfo	|
Packit 032894
  .debug_sfnames	|
Packit 032894
  .debug_aranges	|
Packit 032894
  .debug_pubnames	|
Packit 032894
  .debug_info		|
Packit 032894
  .debug_abbrev		|
Packit 032894
  .debug_line		|
Packit 032894
  .debug_abbrev		 >	DWARF sections in ld
Packit 032894
  .debug_line		|
Packit 032894
  .debug_frame		|
Packit 032894
  .debug_str		|
Packit 032894
  .debug_loc		|
Packit 032894
  .debug_macinfo	|
Packit 032894
  .debug_weaknames	|
Packit 032894
  .debug_funcnames	|
Packit 032894
  .debug_typenames	|
Packit 032894
  .debug_varnames	/
Packit 032894
Packit 032894
  Sections created in output files follow the naming of special section
Packit 032894
  from the gABI.
Packit 032894
Packit 032894
  In no place is a section solely indentified by its name.  Internal
Packit 032894
  references always use the section index.