]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Properly mark all internal function definitions.
authorMark Wielaard <mjw@redhat.com>
Wed, 23 Sep 2015 18:44:06 +0000 (20:44 +0200)
committerMark Wielaard <mjw@redhat.com>
Wed, 23 Sep 2015 18:49:54 +0000 (20:49 +0200)
Since we banned old style function definitions GCC is able to diagnose
function definitions that don't match the function declaration:

  elf32_getehdr.c:78: error: conflicting types for ‘__elf64_getehdr_wrlock’
  libelfP.h:498: note: previous declaration of ‘__elf64_getehdr_wrlock’

This happens on i386 because there internal functions are marked with:

  # define internal_function __attribute__ ((regparm (3), stdcall))

Make sure all internal function declarations and definitions are marked
with internal_function.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
17 files changed:
libasm/ChangeLog
libasm/asm_align.c
libasm/asm_end.c
libasm/asm_error.c
libdw/ChangeLog
libdw/dwarf_error.c
libdw/dwarf_formref.c
libdw/libdw_findcu.c
libdw/libdw_visit_scopes.c
libelf/ChangeLog
libelf/elf32_getehdr.c
libelf/elf32_getshdr.c
libelf/elf_error.c
libelf/elf_getphdrnum.c
libelf/elf_getshdrnum.c
libelf/elf_readall.c
libelf/gelf_getehdr.c

index 0eb84c6ca58a8846df444b73fbc255856565d7ba..7433cb72db0c733815053ec351f6176018403e88 100644 (file)
@@ -1,3 +1,10 @@
+2015-09-23  Mark Wielaard  <mjw@redhat.com>
+
+       * asm_align.c (__libasm_ensure_section_space): Mark as
+       internal_function.
+       * asm_end.c (__libasm_finictx): Likewise.
+       * asm_error.c (__libasm_seterrno): Likewise.
+
 2015-09-22  Mark Wielaard  <mjw@redhat.com>
 
        * asm_*.c: Remove old-style function definitions.
index b7708f596873314be1452585f46c90db270cff81..6631c4d739465d0a9fb4753e1576a44e1d276d1d 100644 (file)
@@ -132,6 +132,7 @@ asm_align (AsmScn_t *asmscn, GElf_Word value)
 /* Ensure there are at least LEN bytes available in the output buffer
    for ASMSCN.  */
 int
+internal_function
 __libasm_ensure_section_space (AsmScn_t *asmscn, size_t len)
 {
   /* The blocks with the section content are kept in a circular
index d629fcd80c1d6b8535635adf2c6a08213cb7ee7a..d21a70a3a2e86a787e5ca8b26cc26906e8cda14e 100644 (file)
@@ -554,6 +554,7 @@ free_section (AsmScn_t *scnp)
 
 
 void
+internal_function
 __libasm_finictx (AsmCtx_t *ctx)
 {
   /* Iterate through section table and free individual entries.  */
index 54430497d25d6d65cfa37f7dbac5c979fca21ebf..cc3e660b5f81fabfcc82bea1ab27633df70b1147 100644 (file)
@@ -52,6 +52,7 @@ asm_errno (void)
 
 
 void
+internal_function
 __libasm_seterrno (int value)
 {
   global_error = value;
index cb5ec9ce75226768ad6da3b7b56871e014cbb40a..5a026d879ee4112e69dd6f3025707b59eba5c601 100644 (file)
@@ -1,3 +1,10 @@
+2015-09-23  Mark Wielaard  <mjw@redhat.com>
+
+       * dwarf_error.c (__libdw_seterrno): Mark as internal_function.
+       * dwarf_formref.c (__libdw_formref): Likewise.
+       * libdw_findcu.c (__libdw_findcu): Likewise.
+       * libdw_visit_scopes.c (__libdw_visit_scopes): Likewise.
+
 2015-09-22  Mark Wielaard  <mjw@redhat.com>
 
        * *.c: Remove old-style function definitions.
index c431bd3e60def5f8fa17d180110f89888a2cba70..66fdc81a701dfc8d632332871fc3f2c4dfa50f57 100644 (file)
@@ -100,6 +100,7 @@ static const char *errmsgs[] =
 
 
 void
+internal_function
 __libdw_seterrno (int value)
 {
   global_error = (value >= 0 && value < (int) nerrmsgs
index c5fb19b16715b5b749aac6ffb76a0af22efc0074..2240a258031810ca2024db6673ac9842e327c5a9 100644 (file)
@@ -35,6 +35,7 @@
 #include "libdwP.h"
 
 int
+internal_function
 __libdw_formref (Dwarf_Attribute *attr, Dwarf_Off *return_offset)
 {
   const unsigned char *datap = attr->valp;
index 5c03843c853113e319e2ccc2d6433b03cdd1995a..082307b0dc1951f45127ae9e5ae2d85efeab5b07 100644 (file)
@@ -133,6 +133,7 @@ __libdw_intern_next_unit (Dwarf *dbg, bool debug_types)
 }
 
 struct Dwarf_CU *
+internal_function
 __libdw_findcu (Dwarf *dbg, Dwarf_Off start, bool debug_types)
 {
   void **tree = debug_types ? &dbg->tu_tree : &dbg->cu_tree;
index c882e4a5af35606b31692830cf46f1ff6eff9c02..5e5c26fddbcf9d94e5d961a1cb3ca2c14df48fed 100644 (file)
@@ -65,6 +65,7 @@ may_have_scopes (Dwarf_Die *die)
 }
 
 int
+internal_function
 __libdw_visit_scopes (unsigned int depth, struct Dwarf_Die_Chain *root,
                      struct Dwarf_Die_Chain *imports,
                      int (*previsit) (unsigned int,
index 193d12674e0a9bae0fbb27a18dba609818470087..1916877c9548162c94442bde569aa7348a049280 100644 (file)
@@ -1,3 +1,17 @@
+2015-09-23  Mark Wielaard  <mjw@redhat.com>
+
+       * elf32_getehdr.c (getehdr_wrlock): Mark as internal_function.
+       * elf32_getshdr.c (getshdr_rdlock): Likewise.
+       (getshdr_wrlock): Likewise.
+       * elf_error.c (__libelf_seterrno): Likewise.
+       * elf_getphdrnum.c (__elf_getphdrnum_rdlock): Likewise.
+       (__elf_getphdrnum_chk_rdlock): Likewise.
+       * elf_getshdrnum.c (__elf_getphdrnum_rdlock): Likewise.
+       (__elf_getphdrnum_chk_rdlock): Likewise.
+       * elf_getshdrnum.c (__elf_getshdrnum_rdlock): Likewise.
+       * elf_readall.c (__libelf_readall): Likewise.
+       * gelf_getehdr.c (__gelf_getehdr_rdlock): Likewise.
+
 2015-09-22  Mark Wielaard  <mjw@redhat.com>
 
        * *.c: Remove old-style function definitions.
index 2b9ad1fa361db4730289add1e917124921495281..89e3c402fdc83e7380cfa9184361eebe580dd60e 100644 (file)
@@ -75,6 +75,7 @@ getehdr_impl (Elf *elf, int wrlock)
 }
 
 ElfW2(LIBELFBITS,Ehdr) *
+internal_function
 __elfw2(LIBELFBITS,getehdr_wrlock) (Elf *elf)
 {
   return getehdr_impl (elf, 1);
index a5fdb5478f6d97c754c0c4398200041a99d53d60..3a6375c110e483e44ef28f3e3947601d2b36fdce 100644 (file)
@@ -243,6 +243,7 @@ scn_valid (Elf_Scn *scn)
 }
 
 ElfW2(LIBELFBITS,Shdr) *
+internal_function
 __elfw2(LIBELFBITS,getshdr_rdlock) (Elf_Scn *scn)
 {
   ElfW2(LIBELFBITS,Shdr) *result;
@@ -264,6 +265,7 @@ __elfw2(LIBELFBITS,getshdr_rdlock) (Elf_Scn *scn)
 }
 
 ElfW2(LIBELFBITS,Shdr) *
+internal_function
 __elfw2(LIBELFBITS,getshdr_wrlock) (Elf_Scn *scn)
 {
   ElfW2(LIBELFBITS,Shdr) *result;
index d6e5183f7f3a58ef814072414ba9ce0c8ad45eea..d6bdaab033c6587a3450af78a5ddbaaf91a6b395 100644 (file)
@@ -283,6 +283,7 @@ static const uint_fast16_t msgidx[ELF_E_NUM] =
 
 
 void
+internal_function
 __libelf_seterrno (int value)
 {
   global_error = value >= 0 && value < nmsgidx ? value : ELF_E_UNKNOWN_ERROR;
index fe70345d5fcbf17370107a11977fd35169ca9f9f..061183bb9ac69a2161c3f65bd07675e699c3b572 100644 (file)
@@ -38,6 +38,7 @@
 
 
 int
+internal_function
 __elf_getphdrnum_rdlock (Elf *elf, size_t *dst)
 {
  if (unlikely (elf->state.elf64.ehdr == NULL))
@@ -78,6 +79,7 @@ __elf_getphdrnum_rdlock (Elf *elf, size_t *dst)
 }
 
 int
+internal_function
 __elf_getphdrnum_chk_rdlock (Elf *elf, size_t *dst)
 {
   int result = __elf_getphdrnum_rdlock (elf, dst);
index 4875c199eaa29b1b86864ea767452efe8a9e867d..18e5d14a13654d109a04dbe77a4643b827fed686 100644 (file)
@@ -39,6 +39,7 @@
 
 
 int
+internal_function
 __elf_getshdrnum_rdlock (Elf *elf, size_t *dst)
 {
   int result = 0;
index 52a0b4e54b907bff54c3aaf57cd3c8b914e9de28..384d25127c3e95338a94d7478e42137184af929c 100644 (file)
@@ -66,6 +66,7 @@ set_address (Elf *elf, size_t offset)
 
 
 char *
+internal_function
 __libelf_readall (Elf *elf)
 {
   /* Get the file.  */
index cace0ef62f0fe67f5e89b197be71fc4a15ffd1fb..abeb70c4a59b4ed686b93a216ed84f97782c4400 100644 (file)
@@ -40,6 +40,7 @@
 
 
 GElf_Ehdr *
+internal_function
 __gelf_getehdr_rdlock (Elf *elf, GElf_Ehdr *dest)
 {
   GElf_Ehdr *result = NULL;