Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: introduce symbol namespace for the symbols in Linux libos
in some case, a symbol defined in a userspace application conflicts with the one in Linux kernel. usually it won't cause any problems but with libos it will. an example would be a symbol (genlmsg_put) in libnl and linux kernel, which have different signatures each other. - at libnl-3.2.25/lib/genl/genl.c void *genlmsg_put(struct nl_msg *msg, uint32_t port, uint32_t seq, int family, int hdrlen, int flags, uint8_t cmd, uint8_t version) - at net-next-nuse/net/netlink/genetlink.c void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, struct genl_family *family, int flags, u8 cmd) so if the application calls genlmsg_put() then it will be puzzled. in fact, since liblinux.so is inserted by LD_PRELOAD in NUSE case, the libos symbol is used instead of libnl's one. by using the objcopy trick to redefine symbols with the prefix 'rumpns_', all the libos (kernel) symbols need to be called with rumpns_ABC, with some exceptions like tool-generated symbols. The whole idea is derived from rumpkernel. Signed-off-by: Hajime Tazaki <tazaki@sfc.wide.ad.jp>
- Loading branch information