<short summary of the patch>
authorCamm Maguire <camm@debian.org>
Thu, 11 Aug 2022 17:16:42 +0000 (18:16 +0100)
committerCamm Maguire <camm@debian.org>
Thu, 11 Aug 2022 17:16:42 +0000 (18:16 +0100)
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.

gcl (2.6.12-61) unstable; urgency=medium

  * list_order.21

Gbp-Pq: Name list_order.22

o/sfaslelf.c

index d2b623ffcd05ae50298769e2b8e19462d831fc58..5a96c3f4bd6ddeb8c8f67e0167178fc220e43ab4 100755 (executable)
@@ -55,12 +55,10 @@ License for more details.
 #define ulmax(a_,b_) ({ul _a=a_,_b=b_;_a<_b ? _b : _a;})
 #define ALLOC_SEC(sec) (sec->sh_flags&SHF_ALLOC && (sec->sh_type==SHT_PROGBITS || sec->sh_type==SHT_NOBITS))
 #define LOAD_SEC(sec) (sec->sh_flags&SHF_ALLOC &&  sec->sh_type==SHT_PROGBITS)
-#define EXT_SYM(sym) ({ul _b=ELF_ST_BIND(sym->st_info); \
-      sym->st_value && (_b==STB_GLOBAL || _b==STB_WEAK);})
-#define LOCAL_SYM(sym) (sym->st_value && \
-                       ELF_ST_BIND(sym->st_info)==STB_LOCAL)
-                       /* && ELF_ST_TYPE(sym->st_info)==STT_FUNC) */
-#define LOAD_SYM(sym) (EXT_SYM(sym)||LOCAL_SYM(sym))
+#define LOAD_SYM(sym,st1) (sym->st_value && (EXT_SYM(sym,st1)||LOCAL_SYM(sym)))
+#define EXT_SYM(sym,st1) (ELF_ST_BIND(sym->st_info)==STB_GLOBAL||ELF_ST_BIND(sym->st_info)==STB_WEAK||LOAD_SYM_BY_NAME(sym,st1))
+#define LOCAL_SYM(sym) ELF_ST_BIND(sym->st_info)==STB_LOCAL
+#define LOAD_SYM_BY_NAME(sym,st1) 0
 
 #define MASK(n) (~(~0ULL << (n)))
 
@@ -412,7 +410,7 @@ calc_space(ul *ns,ul *sl,Sym *sym1,Sym *syme,const char *st1,Sym *d1,Sym *de,con
 
   for (sym=sym1;sym<syme;sym++) {
     
-    if (!LOAD_SYM(sym))
+    if (!LOAD_SYM(sym,st1))
       continue;
 
     if (d1) {
@@ -438,7 +436,7 @@ load_ptable(struct node **a,char **s,Sym *sym1,Sym *syme,const char *st1,
 
   for (sym=sym1;sym<syme;sym++) {
 
-    if (!LOAD_SYM(sym) || (LOCAL_SYM(sym) ? !lp : lp))
+    if (!LOAD_SYM(sym,st1) || (EXT_SYM(sym,st1) ? lp : !lp))
       continue;
 
     if (d1) {