def-tool: Replace buf.size() with len(buf).

This commit replaces `buf.size()` with `len(buf)`.  The former
returns the file size and the later returns the mapped buffer size.
`len(buf)` is more general because `buf.size()` is only available to
`mmap` instances.

Test: tests/run.py
Change-Id: I66e8ecd5b475f4fc686aba062b3486ce4ac7f882
diff --git a/vndk/tools/definition-tool/vndk_definition_tool.py b/vndk/tools/definition-tool/vndk_definition_tool.py
index 143761e..13a2310 100755
--- a/vndk/tools/definition-tool/vndk_definition_tool.py
+++ b/vndk/tools/definition-tool/vndk_definition_tool.py
@@ -519,7 +519,7 @@
         """Parse ELF image resides in the buffer"""
 
         # Check ELF ident.
-        if buf.size() < 8:
+        if len(buf) < 8:
             raise ELFError('bad ident')
 
         if buf[0:4] != ELF.ELF_MAGIC:
@@ -533,7 +533,7 @@
         if self.ei_data not in (ELF.ELFDATA2LSB, ELF.ELFDATA2MSB):
             raise ELFError('unknown endianness')
 
-        self.file_size = buf.size()
+        self.file_size = len(buf)
 
         # ELF structure definitions.
         endian_fmt = '<' if self.ei_data == ELF.ELFDATA2LSB else '>'