1. 06 Jan, 2018 17 commits
  2. 04 Dec, 2017 8 commits
  3. 15 Nov, 2017 2 commits
  4. 12 Nov, 2017 1 commit
  5. 11 Nov, 2017 8 commits
  6. 06 Oct, 2017 2 commits
  7. 31 Jul, 2017 2 commits
    • Baptiste Daroussin's avatar
      Update NEWS · 481ba032
      Baptiste Daroussin authored
      481ba032
    • jrmarino's avatar
      Fix ELF note parsing and recognize NT_GNU_ABI_TAG · 9182756e
      jrmarino authored
      The logic on the ELF note parsing was incorrect.  It happens to work
      on *BSD, but the issue shows on other platforms (e.g. Linux ABI gets
      set to "GNU:0").
      
      The first mistake is assuming the note always has a namespace and that
      this namespace equals the standard name of the operating system.  In
      fact, having a namespace is not even required as there are default
      definitions for tags: NT_VERSION (=1) and NT_ARCH (=2).
      
      The BSDs (at least FreeBSD, DragonFly, and NetBSD) define their
      own namespace (aka "Owner" on readelf" and the NT_VERSION tag, which
      is a single word.  Pkg currently assumes the namespace is equal to
      the osname and assumes there's a NT_VERSION note defined.  For
      correctness, pkg must check that the namespace length is either zero
      or equal to an operating system name before assume a n_type value of
      1 is equivalent to an NT_VERSION note.
      
      A very popular namespace is "GNU".  The tag values of "GNU" overlap
      with with all other namespaces; for example NT_GNU_ABI_TAG is
      value 1 (same as NT_VERSION) and  NT_GNU_ABI_TAG is value 2 (same as
      the default NT_ARCH).  Thus the namespace has to be checked when
      examining n_type of ELF notes.
      
      The second issue is a lack of support for NT_GNU_ABI_TAG.  Linux
      does not use NT_VERSION note, the only one pkg supports.  The ELF
      note parsing code then mistakenly converts the note namespace "GNU"
      into the osname, thus resulting in "GNU:0:..." ABI for Linux.
      
      This code implements NT_GNU_ABI_TAG along side NT_VERSION.  As a
      result, this is the output on x86_64 Linux:
      
      ABI = "Linux:2.6.32:amd64";
      ALTABI = "linux:2.6.32:x86:64";
      
      This is the correct value in the case of Linux.  The glibc was
      compiled with Linux kernel headers from version 2.6.32 and all
      later kernels should be binary-compatible with it.
      
      It has been verified that FreeBSD and DragonFly still function as
      before with this patch.
      9182756e