Skip to content

elf-deps: Make single quotes and backslashes optional #4

@stephen-fox

Description

@stephen-fox

When parsing an ELF with -R, oki includes single quotes and backslashes in the output to help write shell scripts. For example:

$ oki -R rizin
-u 'r:/usr/local/lib/librz_util.so.0.7' \
-u 'r:/usr/lib/libm.so.10.1' \
-u 'r:/usr/lib/libutil.so.17.0' \
(...)

It would be nice if we could make this behavior optional so it does this instead:

$ oki -R rizin
-u r:/usr/local/lib/librz_util.so.0.7
-u r:/usr/lib/libm.so.10.1
-u r:/usr/lib/libutil.so.17.0
(...)

The latter format makes it easier to create shared config files that can be used in multiple shell scripts. For example:

#!/bin/sh

set -u

work_dir="${OKI_WORKDIR:-${HOME}/memla}"

oki \
  -p stdio \
  (...)
  -u rwc:/tmp \
  -u r:/usr/libexec/ld.so \
  -u r:/usr/lib \
  -u r:/usr/lib/libc.so.97.0 \
  $(/bin/cat /tmp/rules-example.txt) \
  -- rizin $@

... where /tmp/rules-example.txt contains:

-u r:/usr/local/lib/librz_util.so.0.7
-u r:/usr/lib/libm.so.10.1
-u r:/usr/lib/libutil.so.17.0
(...)

Perhaps this can even be the default behavior and the current behavior can be optional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions