Hi Satyam, On Mon, Sep 17, 2007 at 06:52:52AM +0530, Satyam Sharma wrote:Thanks! Hmm, perhaps I'll take that on when I learn kobjects better. :) That's true. I actually threw away an earlier version of this patch that made some extensive changes to the elf parser (due to the NOBITS thing I explain below), but instead opted for the smaller version that stayed out of there. Ah, yeah, that's much nicer. I think I must have still have my ELF parser hat on when I wrote that. ;) That's true, yeah. Yeah, that bugged me when I put that in too. :) Yes, "an empty" is better. In the ELF format, the .bss segment is initialized by the loader to all zeros, but it contains no in-file representation (since it's all zeros and would be a waste of space). Such segments are flags as "SHT_NOBITS" meaning that the loader must allocate cleared memory instead of loading the segment from the file. In the case of modules that have a totally empty *_device_id list (?!), the compiler optimizes this into the .bss segment, since there is no need to store an all-zero-contents object in a segment that would be loaded from the file itself. As a result, attempting to dereference such a symbol without noticing the SHT_NOBITS flag lands you somewhere in uninitialized memory. So, the above code basically side-steps the incorrect symbol location calculation and just aims it at a cleared part of memory. As I mentioned, there was a larger patch that attempted to sort this out in the elf parser, but I didn't like it; it was big, not 100% correct, and the above approach seemed like a much less invasive change. The cleanups you suggested, who should I send those to? Or will you (or Sam?) make them directly to the kbuild.git tree? (I've never poked at this part of the kernel source before... I'm unclear on the processes surrounding it maintainership.) Thanks! -Kees -- Kees Cook -
| Trent Piepho | [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| Stoyan Gaydarov | From 2.4 to 2.6 to 2.7? |
| Andi Kleen | [PATCH] [4/50] x86: add cpu codenames for Kconfig.cpu |
| Greg Kroah-Hartman | [PATCH 013/196] Documentation: Replace obsolete "driverfs" with "sysfs". |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: HTB accuracy for high speed |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | Re: [GIT]: Networking |
