Blob Blame Raw
Description: <short summary of the patch>
 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
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-02-01

--- gcl-2.6.12.orig/o/sfaslelf.c
+++ gcl-2.6.12/o/sfaslelf.c
@@ -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 *
 
   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
 
   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) {