Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backward.h binutils compilation issue #507

Open
shrout1 opened this issue Feb 8, 2024 · 0 comments
Open

backward.h binutils compilation issue #507

shrout1 opened this issue Feb 8, 2024 · 0 comments

Comments

@shrout1
Copy link

shrout1 commented Feb 8, 2024

When building kismet from source on Kali-Rolling 2023.4 64 bit I encounter the following error:

In file included from backward_wrapper.h:28,
                 from kismet_server.cc:25:
backward.h: In member function ‘void backward::TraceResolverLinuxImpl<backward::trace_resolver_tag::libbfd>::find_in_section(bfd_vma, bfd_vma, bfd_fileobject&, asection*, find_sym_result&)’:
backward.h:1082:22: error: ‘bfd_get_section_flags’ was not declared in this scope; did you mean ‘bfd_set_section_flags’?
 1082 |                 if ((bfd_get_section_flags(fobj.handle.get(), section)
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      bfd_set_section_flags
backward.h:1086:36: error: ‘bfd_get_section_vma’ was not declared in this scope; did you mean ‘bfd_set_section_vma’?
 1086 |                 bfd_vma sec_addr = bfd_get_section_vma(fobj.handle.get(), section);
      |                                    ^~~~~~~~~~~~~~~~~~~
      |                                    bfd_set_section_vma
backward.h:1087:38: error: ‘bfd_get_section_size’ was not declared in this scope; did you mean ‘bfd_set_section_size’?
 1087 |                 bfd_size_type size = bfd_get_section_size(section);
      |                                      ^~~~~~~~~~~~~~~~~~~~
      |                                      bfd_set_section_size

The problem is present in the file kismet-master/backward.h. By changing this code in the following fashion (per this stack overflow article) this resolves the compilation issue:

if ((bfd_section_flags(section)                                         
                        & SEC_ALLOC) == 0)
        return; // a debug section is never loaded automatically.

bfd_vma sec_addr = bfd_section_vma(section);
bfd_size_type size = bfd_section_size(section);

The application then properly installs and can be accessed at 127.0.0.1:2501 via a web browser after the kismet service is started.

I saw this fix linked in an aws_lambda_cpp issue

My current configuration includes:

GNU Make 4.3
Kali GNU/Linux Rolling 2023.4
OS architecture: aarch64
g++ (Debian 13.2.0-5) 13.2.0a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant