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

shiva-ld.c: error: ‘ELF_LOAD_F_PRIV_MAP’ undeclared #25

Closed
milahu opened this issue May 2, 2024 · 3 comments
Closed

shiva-ld.c: error: ‘ELF_LOAD_F_PRIV_MAP’ undeclared #25

milahu opened this issue May 2, 2024 · 3 comments

Comments

@milahu
Copy link

milahu commented May 2, 2024

gcc  -ggdb shiva-ld.c -o shiva-ld /nix/store/cbblpyx7izddkl27v20xf5gjfcvz15i4-libelfmaster-0.4-alpha-unstable-2023-02-23/lib/libelfmaster.a /nix/store/jagvcafr5xbnriwg6xajw2brvcjxcwi1-capstone-4.0.2/lib/libcapstone.a
shiva-ld.c: In function ‘main’:
shiva-ld.c:1484:53: error: ‘ELF_LOAD_F_PRIV_MAP’ undeclared (first use in this function); did you mean ‘ELF_LOAD_F_STRICT’?
 1484 |                 ELF_LOAD_F_STRICT|ELF_LOAD_F_MODIFY|ELF_LOAD_F_PRIV_MAP, &error) == false) {
      |                                                     ^~~~~~~~~~~~~~~~~~~
      |                                                     ELF_LOAD_F_STRICT

shiva/tools/shiva-ld/shiva-ld.c

int main(int argc, char **argv)
{
// ...
  TAILQ_INIT(&ctx.tailq.xref_tqlist);
  TAILQ_INIT(&ctx.tailq.branch_tqlist);
  /*
   * Open the target executable, with modification privileges.
   */
  if (elf_open_object(ctx.input_exec, &ctx.bin.elfobj,
// FIXME error: ‘ELF_LOAD_F_PRIV_MAP’ undeclared
    ELF_LOAD_F_STRICT|ELF_LOAD_F_MODIFY|ELF_LOAD_F_PRIV_MAP, &error) == false) {
    fprintf(stderr, "elf_open_object(%s, ...) failed: %s\n",
        ctx.input_exec, elf_error_msg(&error));
    exit(EXIT_FAILURE);
  }

build scripts: shiva.nix and libelfmaster.nix

@milahu milahu changed the title error: ‘ELF_LOAD_F_PRIV_MAP’ undeclared shiva-ld.c: error: ‘ELF_LOAD_F_PRIV_MAP’ undeclared May 2, 2024
@elfmaster
Copy link
Contributor

Hi Milahu, you must use the aarch64_support branch in libelfmaster, it has not yet been merged into the main libelfmaster branch. I apologize for the inconvenience.

@milahu
Copy link
Author

milahu commented May 7, 2024

you must use the aarch64_support branch in libelfmaster

aah! yes, that builds : )

i was looking for a x86_64 branch, to build the x86_64_port branch of shiva (#13)

@milahu milahu closed this as completed May 7, 2024
@elfmaster
Copy link
Contributor

Nice :) Yes if you run into more issues let me know. I haven't built a proper build system yet that easily handles both architectures.

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

2 participants