[llvm-dev] FreeBSD notes for ELF2 LLD

Ed Maste via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 6 06:39:44 PDT 2015


LLD ELF2 is at the point where it's worthwhile for me to resume
investigating LLD as the FreeBSD base system linker
(llvm.org/pr23214). At this point I don't think there's value in
tracking these in PRs but do want to capture what I've found.

* PT_INTERP and ABI notes must be in the first page

ELF2 currently rounds up to a page and stores the data for PT_INTERP
and the NT_FREEBSD_ABI_TAG and NT_FREEBSD_NOINIT_TAG ELF notes there.
These have to be in the first page on FreeBSD.

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flg    Align
  INTERP         0x00000000000010cc 0x00000000000110cc 0x00000000000110cc
                 0x0000000000000015 0x0000000000000015  R      0x1
      [Requesting program interpreter: /libexec/ld-elf.so.1]

* Undefined sym in shared library provided by regular object

This is the FreeBSD __progname issue fixed in r218259 for the original
ELF linker.

* Options used in the FreeBSD base system

These are options that need to be ignored or implemented (excluding
those already ignored by ELF2)

--enable-new-dtags
--fatal-warnings and --no-fatal-warnings
--warn-shared-textrel
--output-filetype
--version-script
-Bsymbolic
-r
-znodelete
--no-warn-mismatch
--warn-common
-T

* Linker script support

The FreeBSD base system linker scripts use (at least) the following set:
ALIGN ENTRY GROUP KEEP OUTPUT_ARCH OUTPUT_FORMAT SEARCH_DIR SECTIONS PROVIDE


More information about the llvm-dev mailing list