---
name: "pbc_merge"
section: "1"
platform: "linux"
package: "parrot-devel"
version: "6.6.0-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/pbc_merge"
---

# pbc\_merge(1)

Merge multiple Parrot bytecode (PBC) files into a single PBC file.

## NAME

pbc\_merge - Merge multiple Parrot bytecode (PBC) files into\
                   a single PBC file.

## SYNOPSIS

```
 pbc_merge -o out.pbc input1.pbc input2.pbc ...
```

## DESCRIPTION

This program takes two or more PBC files and produces a single merged output PBC file with a single fix-up table and constants table.

### Command-Line Options

- "-o out.pbc"

  The name of the PBC file to produce, containing the merged segments from the input PBC files.

### Functions

- "static void help(void)"

  Print out the user help info.

- "static void ensure\_libdep(PARROT\_INTERP, PackFile\_ByteCode \*bc, STRING \*lib)"

  Ensures that the libdep `"lib"` is in the libdeps list for `"bc"`.

- "static PackFile\_ByteCode\* pbc\_merge\_bytecode(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs, PackFile \*pf)"

  This function merges the bytecode from the input packfiles, storing the offsets that each bit of bytecode now exists at.

- "static PackFile\_ConstTable\* pbc\_merge\_constants(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs, PackFile \*pf)"

  This function merges the constants tables from the input PBC files.

- "static PackFile\_Annotations\* pbc\_merge\_annotations(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs, PackFile \*pf, PackFile\_ByteCode \*bc)"

  Merge Annotations segments from `"inputs"` into a new `"PackFile_Annotations"` segment. Returns the new merged segment (which is also already appended to the directory in `"pf"`).

- "static void pbc\_merge\_debugs(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs, PackFile\_ByteCode \*bc)"

  This function merges the debug segments from the input PBC files.

- "static void pbc\_fixup\_bytecode(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs, PackFile\_ByteCode \*bc)"

  Fixup bytecode. This includes correcting pointers into the constant table and updating the ops mapping.

- "static void pbc\_fixup\_constants(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs)"

  Fixup constants. This includes correcting pointers into bytecode.

- "static PackFile\* pbc\_merge\_begin(PARROT\_INTERP, pbc\_merge\_input \*\*inputs, int num\_inputs)"

  This is the function that drives PBC merging process.

- "static void pbc\_merge\_write(PARROT\_INTERP, PackFile \*pf, const char \*filename)"

  This functions writes out the merged packfile.

- "int main(int argc, const char \*\*argv)"

  The main function that grabs console input, reads in the packfiles provided they exist, hands them to another function that runs the merge process and finally writes out the produced packfile.

\*/

/\*\
  \* Local variables:\
  \*   c-file-style: "parrot"\
  \* End:\
  \* vim: expandtab shiftwidth=4 cinoptions='\\:2=2' :\
  \*/
