From 8e2f54bcee7e3e8315d4a39a302eaf8e4389e07d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 30 May 2017 06:34:05 -0700 Subject: Add bfd_get_file_size to get archive element size We can't use stat() to get archive element size. Add bfd_get_file_size to get size for both normal files and archive elements. bfd/ PR binutils/21519 * bfdio.c (bfd_get_file_size): New function. * bfd-in2.h: Regenerated. binutils/ PR binutils/21519 * objdump.c (dump_relocs_in_section): Replace get_file_size with bfd_get_file_size to get archive element size. * testsuite/binutils-all/objdump.exp (test_objdump_f): New proc. (test_objdump_h): Likewise. (test_objdump_t): Likewise. (test_objdump_r): Likewise. (test_objdump_s): Likewise. Add objdump tests on archive. --- bfd/bfd-in2.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bfd/bfd-in2.h') diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index ae2fceb..a23bb98 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1242,6 +1242,8 @@ long bfd_get_mtime (bfd *abfd); file_ptr bfd_get_size (bfd *abfd); +file_ptr bfd_get_file_size (bfd *abfd); + void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, void **map_addr, bfd_size_type *map_len); -- cgit v1.1