* dynamic shared library . [not found] <AANLkTimck7ar6JPzSnNZo_baTz1usHLeUFxkL8GaqriV@mail.gmail.com> @ 2011-02-03 14:50 ` ratheesh k 2011-02-03 14:59 ` Michal Nazarewicz 0 siblings, 1 reply; 9+ messages in thread From: ratheesh k @ 2011-02-03 14:50 UTC (permalink / raw) To: linux-c-programming when dll is loaded . at the start of execution of elf ? OR when the reference is made into library function or data ? -Ratheesh -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: dynamic shared library . 2011-02-03 14:50 ` dynamic shared library ratheesh k @ 2011-02-03 14:59 ` Michal Nazarewicz 2011-02-10 3:41 ` UDP data Randi 2011-03-19 21:57 ` dynamic shared library Hendrik Visage 0 siblings, 2 replies; 9+ messages in thread From: Michal Nazarewicz @ 2011-02-03 14:59 UTC (permalink / raw) To: linux-c-programming, ratheesh k On Thu, 03 Feb 2011 15:50:27 +0100, ratheesh k <ratheesh.ksz@gmail.com> wrote: > when dll is loaded . > > at the start of execution of elf ? > > OR > > when the reference is made into library function or data ? Depends what you mean by "loaded". At start of execution, dynamic loader reads shared object's header files, maps the library to memory accordingly and probably does some more magic with symbol resolution, etc. (I'm not an expert and what dynamic loader does is not that trivial). However, the whole file is not read into memory and instead, needed portions are read as code references them. -- Best regards, _ _ .o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michal "mina86" Nazarewicz (o o) ooo +-<email/jid: mnazarewicz@google.com>--------ooO--(_)--Ooo-- ^ permalink raw reply [flat|nested] 9+ messages in thread
* UDP data 2011-02-03 14:59 ` Michal Nazarewicz @ 2011-02-10 3:41 ` Randi 2011-02-10 4:14 ` Chris Donovan 2011-03-19 21:57 ` dynamic shared library Hendrik Visage 1 sibling, 1 reply; 9+ messages in thread From: Randi @ 2011-02-10 3:41 UTC (permalink / raw) To: linux-c-programming Hi All, Since UDP socket is not reliable, what the common way in user level to check UDP communication's data for error (eg. malformed, corrupted, etc.)? is the checksum field in the UDP header (struct udphdr) intended to this problem? Randi ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UDP data 2011-02-10 3:41 ` UDP data Randi @ 2011-02-10 4:14 ` Chris Donovan 2011-02-10 5:14 ` Randi 0 siblings, 1 reply; 9+ messages in thread From: Chris Donovan @ 2011-02-10 4:14 UTC (permalink / raw) To: Randi; +Cc: linux-c-programming Yes the checksum is for the header and data. Keep in mind that the checksum value is optional in ipv4, but required in ipv6. Chris- On Thu, Feb 10, 2011 at 2:41 PM, Randi <nightdecoder@gmail.com> wrote: > Hi All, > > Since UDP socket is not reliable, what the common way in user level to > check UDP communication's data for error (eg. malformed, corrupted, > etc.)? is the checksum field in the UDP header (struct udphdr) intended > to this problem? > > Randi > > -- > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UDP data 2011-02-10 4:14 ` Chris Donovan @ 2011-02-10 5:14 ` Randi 2011-02-10 15:41 ` Glynn Clements 2011-02-10 20:49 ` Chris Donovan 0 siblings, 2 replies; 9+ messages in thread From: Randi @ 2011-02-10 5:14 UTC (permalink / raw) To: Chris Donovan; +Cc: linux-c-programming Chris, optional means it can be enable or not, how to enable it and get the header to verify the checksum. On Thu, 2011-02-10 at 15:14 +1100, Chris Donovan wrote: > Yes the checksum is for the header and data. > Keep in mind that the checksum value is optional in ipv4, but required in ipv6. > > Chris- > > On Thu, Feb 10, 2011 at 2:41 PM, Randi <nightdecoder@gmail.com> wrote: > > Hi All, > > > > Since UDP socket is not reliable, what the common way in user level to > > check UDP communication's data for error (eg. malformed, corrupted, > > etc.)? is the checksum field in the UDP header (struct udphdr) intended > > to this problem? > > > > Randi ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UDP data 2011-02-10 5:14 ` Randi @ 2011-02-10 15:41 ` Glynn Clements 2011-02-10 18:43 ` David Astua 2011-02-10 20:49 ` Chris Donovan 1 sibling, 1 reply; 9+ messages in thread From: Glynn Clements @ 2011-02-10 15:41 UTC (permalink / raw) To: Randi; +Cc: Chris Donovan, linux-c-programming Randi wrote: > > Yes the checksum is for the header and data. > > Keep in mind that the checksum value is optional in ipv4, but required in ipv6. > > Chris, optional means it can be enable or not, how to enable it and get > the header to verify the checksum. Checksums are enabled by default. You can disable checksums when sending using the SO_NO_CHECK option. On receipt, the kernel will verify the checksum if it's present, and discard the packet if there is an error. -- Glynn Clements <glynn@gclements.plus.com> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UDP data 2011-02-10 15:41 ` Glynn Clements @ 2011-02-10 18:43 ` David Astua 0 siblings, 0 replies; 9+ messages in thread From: David Astua @ 2011-02-10 18:43 UTC (permalink / raw) To: Randi; +Cc: linux-c-programming On Thu, Feb 10, 2011 at 9:41 AM, Glynn Clements <glynn@gclements.plus.com> wrote: > > Randi wrote: > >> > Yes the checksum is for the header and data. >> > Keep in mind that the checksum value is optional in ipv4, but required in ipv6. >> >> Chris, optional means it can be enable or not, how to enable it and get >> the headehttps://mail.google.com/mail/?shva=1#inbox/12e0da8d716c914er to verify the checksum. > > Checksums are enabled by default. You can disable checksums when > sending using the SO_NO_CHECK option. On receipt, the kernel will > verify the checksum if it's present, and discard the packet if there > is an error. > > -- > Glynn Clements <glynn@gclements.plus.com> > -- > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Also keep in mind that the check is for individual frames, even checking that there's no certainty that all frames will arrive. -- David A. -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UDP data 2011-02-10 5:14 ` Randi 2011-02-10 15:41 ` Glynn Clements @ 2011-02-10 20:49 ` Chris Donovan 1 sibling, 0 replies; 9+ messages in thread From: Chris Donovan @ 2011-02-10 20:49 UTC (permalink / raw) To: Randi; +Cc: linux-c-programming I don't know libc, so I don't know what functions libc has to compute (if any) the checksum. I did find this page, that has some sample code though... http://stackoverflow.com/questions/3737612/raw-socket-sendto-failed-using-c-on-linux Chris- On Thu, Feb 10, 2011 at 4:14 PM, Randi <nightdecoder@gmail.com> wrote: > Chris, optional means it can be enable or not, how to enable it and get > the header to verify the checksum. > > > On Thu, 2011-02-10 at 15:14 +1100, Chris Donovan wrote: >> Yes the checksum is for the header and data. >> Keep in mind that the checksum value is optional in ipv4, but required in ipv6. >> >> Chris- >> >> On Thu, Feb 10, 2011 at 2:41 PM, Randi <nightdecoder@gmail.com> wrote: >> > Hi All, >> > >> > Since UDP socket is not reliable, what the common way in user level to >> > check UDP communication's data for error (eg. malformed, corrupted, >> > etc.)? is the checksum field in the UDP header (struct udphdr) intended >> > to this problem? >> > >> > Randi > > -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: dynamic shared library . 2011-02-03 14:59 ` Michal Nazarewicz 2011-02-10 3:41 ` UDP data Randi @ 2011-03-19 21:57 ` Hendrik Visage 1 sibling, 0 replies; 9+ messages in thread From: Hendrik Visage @ 2011-03-19 21:57 UTC (permalink / raw) To: Michal Nazarewicz; +Cc: linux-c-programming, ratheesh k On Thu, Feb 3, 2011 at 4:59 PM, Michal Nazarewicz <mina86@mina86.com> wrote: > On Thu, 03 Feb 2011 15:50:27 +0100, ratheesh k <ratheesh.ksz@gmail.com> > wrote: > >> when dll is loaded . >> >> at the start of execution of elf ? >> >> OR >> >> when the reference is made into library function or data ? > > Depends what you mean by "loaded". At start of execution, dynamic loader > reads shared object's header files, maps the library to memory accordingly > and probably does some more magic with symbol resolution, etc. (I'm not > an expert and what dynamic loader does is not that trivial). That would be "normal" libraries that at compile time have been referenced as needed to be dynamically linked. Ie. those libraries that you have called/referenced in the compiled code and that the linker have resolved to be in that dynamoc library. You can find that list by using "ldd /path/to/<executable>" which would also show you where the run time linker found those libraries (based on the ld.so configured paths and the LD_LIBRARY_PATH setting) Then the "fun" part are those dynamic executables that is loadedby the program "on demand". An example systemwide is the name service stuff refered to by the /etc/nsswitch.conf file. Another example is Apache's loadable modules like the php, perl modules that is not refered to at startup time by the ELF run time loader, but rather loaded as the program executes and reads the config files that requests those modules to be loaded. > > However, the whole file is not read into memory and instead, needed > portions are read as code references them. Typically the library/dll/.so is mmap(2)ed into the executable address space, and only read as that part are referenced. > -- > Best regards, _ _ > .o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o > ..o | Computer Science, Michal "mina86" Nazarewicz (o o) > ooo +-<email/jid: mnazarewicz@google.com>--------ooO--(_)--Ooo-- > -- > To unsubscribe from this list: send the line "unsubscribe > linux-c-programming" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-03-19 21:57 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <AANLkTimck7ar6JPzSnNZo_baTz1usHLeUFxkL8GaqriV@mail.gmail.com>
2011-02-03 14:50 ` dynamic shared library ratheesh k
2011-02-03 14:59 ` Michal Nazarewicz
2011-02-10 3:41 ` UDP data Randi
2011-02-10 4:14 ` Chris Donovan
2011-02-10 5:14 ` Randi
2011-02-10 15:41 ` Glynn Clements
2011-02-10 18:43 ` David Astua
2011-02-10 20:49 ` Chris Donovan
2011-03-19 21:57 ` dynamic shared library Hendrik Visage
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).