Project

General

Profile

Feature #10581

ld(1) should know kernel modules are a thing

Added by Rich Lowe 9 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2019-03-23
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

To facilitate features in the link editor that are unsuitable for relocatable objects in general, but acceptable for kernel modules (the first being linker-sets, future examples possibly including -zcombreloc, for eg), the link-editor should know that kernel modules are a distinct kind of object.

Do this by implementing an Oracle-style -ztype that takes =kmod, which clues in the link-editor, and sets a dynamic tag usable by other software
Make ld(1) refuse to accept a kmod as link-editor input (we currently, unfortunately, do that with genunix), teach file(1) to spot the flag for kernel modules.

History

#1

Updated by Rich Lowe 8 months ago

testing: build with -ztype=kmod patched into uts/ and the new linker, elfdump -d, file, etc.

#2

Updated by Electric Monk 8 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit b6a0e2cd4ce8d91fe9dc750c44e662d7c7e5fb8e

commit  b6a0e2cd4ce8d91fe9dc750c44e662d7c7e5fb8e
Author: Richard Lowe <richlowe@richlowe.net>
Date:   2019-04-24T16:59:38.000Z

    10366 ld(1) should support GNU-style linker sets
    10581 ld(1) should know kernel modules are a thing
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF