#!/usr/bin/perl # Copyright (C) 2012 Christoph Berg # No rights reserved. Do whatever you want with this file. # Gross hack to read the contents of Pg_magic_data from a .so file use strict; use warnings; my $version_only = 0; if ($ARGV[0] eq '-v') { $version_only = 1; shift @ARGV; } my $so = $ARGV[0] || die "Usage: $0 .so"; my $objdump = `objdump -d $so`; my $address; # ... # 50a0 if ($objdump =~ /# ([[:xdigit:]]+) : # 6880: 48 8d 05 19 06 01 00 lea 0x10619(%rip),%rax # 16ea0 <_fini+0x11c> } elsif ($objdump =~ /:\n.* # ([[:xdigit:]]+)