New macros for symbol versioning definitions, use them for libdw convenience wrappers...
authorRoland McGrath <roland@redhat.com>
Sun, 9 Aug 2009 22:40:52 +0000 (15:40 -0700)
committerRoland McGrath <roland@redhat.com>
Sun, 9 Aug 2009 22:40:52 +0000 (15:40 -0700)
14 files changed:
lib/ChangeLog
lib/eu-config.h
libdw/ChangeLog
libdw/dwarf_arrayorder.c
libdw/dwarf_bitoffset.c
libdw/dwarf_bitsize.c
libdw/dwarf_bytesize.c
libdw/dwarf_decl_column.c
libdw/dwarf_decl_file.c
libdw/dwarf_decl_line.c
libdw/dwarf_srclang.c
libdw/libdw.map
libdwfl/ChangeLog
libdwfl/dwfl_module_build_id.c

index 0699182..73f8e73 100644 (file)
@@ -1,3 +1,7 @@
+2009-08-09  Roland McGrath  <roland@redhat.com>
+
+       * eu-config.h (OLD_VERSION, NEW_VERSION, COMPAT_VERSION): New macros.
+
 2009-01-23  Roland McGrath  <roland@redhat.com>
 
        * eu-config.h: Add multiple inclusion protection.
index 32f501a..f814604 100644 (file)
@@ -183,4 +183,21 @@ asm (".section predict_data, \"aw\"; .previous\n"
 #define ELFUTILS_HEADER(name) <lib##name.h>
 
 
+#ifdef SHARED
+# define OLD_VERSION(name, version) \
+  asm (".globl _compat." #version "." #name "\n" \
+       "_compat." #version "." #name " = " #name "\n" \
+       ".symver _compat." #version "." #name "," #name "@" #version);
+# define NEW_VERSION(name, version) \
+  asm (".symver " #name "," #name "@@@" #version);
+# define COMPAT_VERSION(name, version, prefix) \
+  asm (".symver _compat." #version "." #name "," #name "@" #version); \
+  __typeof (name) _compat_##prefix##_##name asm ("_compat." #version "." #name);
+#else
+# define OLD_VERSION(name, version) /* Nothing for static linking.  */
+# define NEW_VERSION(name, version) /* Nothing for static linking.  */
+# define COMPAT_VERSION(name, version, prefix) error "should use #ifdef SHARED"
+#endif
+
+
 #endif /* eu-config.h */
index 30c8489..3aa75c8 100644 (file)
@@ -1,3 +1,17 @@
+2009-08-09  Roland McGrath  <roland@redhat.com>
+
+       * libdw.map (ELFUTILS_0.143): New version set,
+       inherits from ELFUTILS_0.142.
+       * dwarf_arrayorder.c: Use OLD_VERSION and NEW_VERSION to define an
+       alias in the ELFUTILS_0.122 version set and the default in the new set.
+       * dwarf_srclang.c: Likewise.
+       * dwarf_decl_file.c: Likewise.
+       * dwarf_decl_line.c: Likewise.
+       * dwarf_decl_column.c: Likewise.
+       * dwarf_bytesize.c: Likewise.
+       * dwarf_bitsize.c: Likewise.
+       * dwarf_bitoffset.c: Likewise.
+
 2009-08-07  Roland McGrath  <roland@redhat.com>
 
        * dwarf_arrayorder.c: Use dwarf_attr_integrate.
index 3593924..4929fb3 100644 (file)
@@ -67,3 +67,5 @@ dwarf_arrayorder (die)
                                  (die, DW_AT_ordering, &attr_mem),
                                  &value) == 0 ? (int) value : -1;
 }
+OLD_VERSION (dwarf_arrayorder, ELFUTILS_0.122)
+NEW_VERSION (dwarf_arrayorder, ELFUTILS_0.143)
index 99d1071..3ab1468 100644 (file)
@@ -67,3 +67,5 @@ dwarf_bitoffset (die)
                                  (die, DW_AT_bit_offset, &attr_mem),
                                  &value) == 0 ? (int) value : -1;
 }
+OLD_VERSION (dwarf_bitoffset, ELFUTILS_0.122)
+NEW_VERSION (dwarf_bitoffset, ELFUTILS_0.143)
index 7cfbc5d..67d97dc 100644 (file)
@@ -67,3 +67,5 @@ dwarf_bitsize (die)
                                  (die, DW_AT_bit_size, &attr_mem),
                                  &value) == 0 ? (int) value : -1;
 }
+OLD_VERSION (dwarf_bitsize, ELFUTILS_0.122)
+NEW_VERSION (dwarf_bitsize, ELFUTILS_0.143)
index 536fcd5..2f2e198 100644 (file)
@@ -67,3 +67,5 @@ dwarf_bytesize (die)
                                  (die, DW_AT_byte_size, &attr_mem),
                                  &value) == 0 ? (int) value : -1;
 }
+OLD_VERSION (dwarf_bytesize, ELFUTILS_0.122)
+NEW_VERSION (dwarf_bytesize, ELFUTILS_0.143)
index 5e0f3e0..11ba5d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Get column number of beginning of given declaration.
-   Copyright (C) 2005 Red Hat, Inc.
+   Copyright (C) 2005-2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2005.
 
@@ -61,3 +61,5 @@ dwarf_decl_column (Dwarf_Die *decl, int *colp)
 {
   return __libdw_attr_intval (decl, colp, DW_AT_decl_column);
 }
+OLD_VERSION (dwarf_decl_column, ELFUTILS_0.122)
+NEW_VERSION (dwarf_decl_column, ELFUTILS_0.143)
index b5ea27d..c81e35b 100644 (file)
@@ -106,3 +106,5 @@ dwarf_decl_file (Dwarf_Die *die)
 
   return cu->files->info[idx].name;
 }
+OLD_VERSION (dwarf_decl_file, ELFUTILS_0.122)
+NEW_VERSION (dwarf_decl_file, ELFUTILS_0.143)
index 27abc50..ab64e51 100644 (file)
@@ -63,6 +63,8 @@ dwarf_decl_line (Dwarf_Die *func, int *linep)
 {
   return __libdw_attr_intval (func, linep, DW_AT_decl_line);
 }
+OLD_VERSION (dwarf_decl_line, ELFUTILS_0.122)
+NEW_VERSION (dwarf_decl_line, ELFUTILS_0.143)
 
 
 int internal_function
index 7d0e907..f1ff954 100644 (file)
@@ -67,3 +67,5 @@ dwarf_srclang (die)
                                  (die, DW_AT_language, &attr_mem),
                                  &value) == 0 ? (int) value : -1;
 }
+OLD_VERSION (dwarf_srclang, ELFUTILS_0.122)
+NEW_VERSION (dwarf_srclang, ELFUTILS_0.143)
index b4759ba..6fc86b3 100644 (file)
@@ -209,3 +209,19 @@ ELFUTILS_0.142 {
     dwfl_module_dwarf_cfi;
     dwfl_module_eh_cfi;
 } ELFUTILS_0.138;
+
+ELFUTILS_0.143 {
+  global:
+    # Replaced ELFUTILS_0.122 versions.  Both versions point to the
+    # same implementation, but users of the new symbol version can
+    # presume that they use dwarf_attr_integrate properly.
+    dwarf_arrayorder;
+    dwarf_bitoffset;
+    dwarf_bitsize;
+    dwarf_bytesize;
+    dwarf_decl_column;
+    dwarf_decl_file;
+    dwarf_decl_line;
+    dwarf_srclang;
+
+} ELFUTILS_0.142;
index 624f59b..129d520 100644 (file)
@@ -1,3 +1,7 @@
+2009-08-09  Roland McGrath  <roland@redhat.com>
+
+       * dwfl_module_build_id.c: Use new macros for versioned definitions.
+
 2009-07-08  Roland McGrath  <roland@redhat.com>
 
        * dwfl_module_dwarf_cfi.c: New file.
index d7bbb3c..07a62ba 100644 (file)
@@ -150,8 +150,8 @@ __libdwfl_find_build_id (Dwfl_Module *mod, bool set, Elf *elf)
 }
 
 int
-__dwfl_module_build_id (Dwfl_Module *mod,
-                       const unsigned char **bits, GElf_Addr *vaddr)
+dwfl_module_build_id (Dwfl_Module *mod,
+                     const unsigned char **bits, GElf_Addr *vaddr)
 {
   if (mod == NULL)
     return -1;
@@ -174,24 +174,20 @@ __dwfl_module_build_id (Dwfl_Module *mod,
   *vaddr = mod->build_id_vaddr;
   return mod->build_id_len;
 }
+INTDEF (dwfl_module_build_id)
+NEW_VERSION (dwfl_module_build_id, ELFUTILS_0.138)
+
 #ifdef SHARED
-extern __typeof__ (dwfl_module_build_id) INTUSE(dwfl_module_build_id)
-     __attribute__ ((alias ("__dwfl_module_build_id")));
-asm (".symver "
-     "__dwfl_module_build_id, dwfl_module_build_id@@ELFUTILS_0.138");
+COMPAT_VERSION (dwfl_module_build_id, ELFUTILS_0.130, vaddr_at_end)
 
 int
-_BUG_COMPAT_dwfl_module_build_id (Dwfl_Module *mod,
-                                 const unsigned char **bits, GElf_Addr *vaddr)
+_compat_vaddr_at_end_dwfl_module_build_id (Dwfl_Module *mod,
+                                          const unsigned char **bits,
+                                          GElf_Addr *vaddr)
 {
   int result = INTUSE(dwfl_module_build_id) (mod, bits, vaddr);
   if (result > 0)
     *vaddr += (result + 3) & -4;
   return result;
 }
-asm (".symver "
-     "_BUG_COMPAT_dwfl_module_build_id, dwfl_module_build_id@ELFUTILS_0.130");
-#else
-extern __typeof__ (dwfl_module_build_id) dwfl_module_build_id
-     __attribute__ ((alias ("__dwfl_module_build_id")));
 #endif