Re: Fix compile of programs/winedbg/elf.c on NetBSD 1.6
Yorick Hardy a écrit :
Changelog: Use SHN_UNDEF instead of STN_UNDEF when it is defined and STN_UNDEF is not. Fixes compiling on NetBSD 1.6.
Kind regards,
both STN_UNDEF and SHN_UNDEF exist in ELF definition and are meant to be used in different cases, which your patch mixes. Hence the fix is wrong (even if by change STN_UNDEF and SHN_UNDEF both are defined as 0) So, I'd rather suggest something (at the top of the file) as #ifndef STN_UNDEF # define STN_UNDEF 0 #endif A+
Thanks for your input. It is very likely that I misunderstood, but I found the following in /usr/include/elf.h on NetBSD 1.6 /* * Symbol Table */ typedef struct { ... Elf32_Half st_shndx; /* section index of symbol */ } Elf32_Sym; ... /* * Special section indexes */ #define SHN_UNDEF 0 /* Undefined section */ Is this consistent with what you said? If so, I can try submit what you suggested tonight. Kind regards, Yorick Hardy.
Yorick Hardy a écrit :
Changelog: Use SHN_UNDEF instead of STN_UNDEF when it is defined and STN_UNDEF is not. Fixes compiling on NetBSD 1.6.
Kind regards,
both STN_UNDEF and SHN_UNDEF exist in ELF definition and are meant to be used in different cases, which your patch mixes. Hence the fix is wrong (even if by change STN_UNDEF and SHN_UNDEF both are defined as 0) So, I'd rather suggest something (at the top of the file) as #ifndef STN_UNDEF # define STN_UNDEF 0 #endif
A+
-------------------------------------------------------- This message was sent using MetroWEB's AirMail service. http://www.metroweb.co.za/ - full access for only R59. Free WebMail, Calendar, Anti-Virus, Anti-Spam, 10 emails Phone Now! 086 11 11 440
Yorick Hardy a écrit :
Thanks for your input. It is very likely that I misunderstood, but I found the following in /usr/include/elf.h on NetBSD 1.6 [snip] Is this consistent with what you said? seems like i misread some of the ELF specs. Your fix is right (sorry for the noise). BTW, you could also remove the use of STN_UNDEF in elf.c while you're at it. A+
seems like i misread some of the ELF specs. Your fix is right (sorry for the noise). BTW, you could also remove the use of STN_UNDEF in elf.c while you're at it.
Not to worry, I am now more confused than ever :-). By the way, what is STN_UNDEF for ? Changelog: Use SHN_UNDEF instead of STN_UNDEF to specify undefined section index. Kind regards, -- Yorick Hardy --- programs/winedbg/elf.c Sat Feb 14 19:55:30 2004 +++ programs/winedbg/elf.c Mon Feb 23 22:09:35 2004 @@ -110,7 +110,7 @@ * interest. */ if (ELF32_ST_TYPE(symp->st_info) == STT_SECTION || - symp->st_shndx == STN_UNDEF) + symp->st_shndx == SHN_UNDEF) { continue; }
Yorick Hardy a écrit :
Not to worry, I am now more confused than ever :-). By the way, what is STN_UNDEF for ? it's used as an index in the Elf32_Sym array to identify the undefined symbol, whereas SHN_UNDEF is a potential value of Elf32_Sym.st_shndx (which is the section in which the symbol is defined), and refers to the undefined section (for undefined symbols)
A+
participants (2)
-
Eric Pouech -
Yorick Hardy