0

So basically I want to use this command to get the .plt section info.

readelf -S ELF_Binary | awk '/plt/ {print $2,$4,$5,$6} '

and the output is like this:

.rel.plt 08048b20 000b20 0001f0
.plt 08048d40 000d40 0003f0
.got.plt 08050ff4 007ff4 000104

So basically I only want to get the middle line, which is :

.plt 08048d40 000d40 0003f0

I tried several ways but I just cannot make it...

Could anyone give me some help?

lllllllllllll
  • 8,519
  • 9
  • 45
  • 80

1 Answers1

3

Instead of matching lines containing plt, say that you want the second field to be .plt:

readelf -S ELF_Binary | awk '$2==".plt" {print $2,$4,$5,$6}'
devnull
  • 118,548
  • 33
  • 236
  • 227