Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6923355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:31:31+00:00 2026-05-27T10:31:31+00:00

I have a kernel module that needs to have access to the kernel’s _stext

  • 0

I have a kernel module that needs to have access to the kernel’s _stext and _etext symbols. For some reason, even though the kernel has definitions for these symbols (/proc/kallsyms), whenever I load my module I get

mymodule: Unknown symbol _etext (err 0)
mymodule: Unknown symbol _stext (err 0)

I’m not running a tainted kernel, and everything else in the module seems to link ok. Are there module or license restrictions on linking to _stext and _etext? Is there a substitute definition in the kernel that I could use for the beginning and end of code memory?

Update:

I’m looking at the kernel source, and in kallsyms.c, there’s this:

static int read_symbol_tr(const char *sym, unsigned long long addr)
{
size_t i;
struct text_range *tr;

for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) {
    tr = &text_ranges[i];

    if (strcmp(sym, tr->stext) == 0) {
        tr->start = addr;
        return 0;
    } else if (strcmp(sym, tr->etext) == 0) {
        tr->end = addr;
        return 0;
    }
}

return 1;
}

Does this mean that the _etext and _stext entries that I’m seeing the /proc/kallsyms are fake symbols that a kernel module can’t actually link to?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:31:32+00:00Added an answer on May 27, 2026 at 10:31 am

    The kernel module linker will only link symbols that have been “exported” via an additional mechanism: the symbol must be exported with EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL(). (The _GPL variant indicates that the kernel developers are labeling that an internal interface and thus available only to GPL-licensed code.) I cannot find exports for either _stext or _etext on my kernel sources, so I don’t believe they are available to you to use.

    What are you trying to accomplish?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a kernel module that provides data to a userland process through read().
On an x86 system, I have a Linux kernel module (watcher module) that gets
I have a module that I load it by Kernel when my application starts
I writing a linux kernel module that does some work with /proc... I'm trying
I have the following code in a kernel module that walks up the process
I have an application that is currently divided into Service and Data Access Layers
I am using Ninject for DI. I have Ninject Modules that bind some services
I have a problem loading a kernel module, there is a large data structure,
I'm currently trying to create a kernel module that will produce data based on
How can I instruct the system to reload all kernel modules that have changed?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.