Re: [PATCH] cross-architecture ELF clean up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roman Zippel wrote:
This patch cleans up the ELF headers and their users.  It does several
related things:

1. split linux/elf.h into pieces

This splits linux/elf.h into several pieces:
	linux/elf.h		- still the common elf header,
				  functionally unchanged
	linux/elf-const.h	- ELF constants, includable by asm code

We have the __ASSEMBLY__ define for this, so just for asm code we don't need a separate header.

Hm. The number of __ASSEMBLY__s end up being pretty large, and it just seemed cleaner to put them in separate headers.

	linux/elf-decl.h	- ELF type declarations, without definitions
	linux/elf-defn.h	- ELF type definitions

What's the point in splitting these two?

Because there are other headers which just need some type forward-declarations, and don't need the whole set of ELF types defined. In particular, linux/module.h - which is included all over the place in the kernel - needs a couple of ELF types declared, and including it all over the place is just a waste. Also, there were some nasty cyclic header dependency problems around linux/elf.h, linux/module.h, linux/bug.h and asm/bug.h which ended up leading to some awkward hacks; I need to remind myself what the problems were and see if this elf cleanup helps (pretty sure it should).

After this patch <linux/elf.h> seems to be pretty much empty, I'd rather suggest to move the function declarations to elfcore.h and leave the basic elf definitions in elf.h. Many small header files have the disadvantage that it takes longer to find the needed information.
linux/elf.h ends up pulling in a really surprising amount of stuff, mostly because it ends up including asm/elf.h. asm/elf.h, in turn, depending on the architecture, pulls in a wide variety of other headers. When I cleaned this up, I found quite a few buggy .c files which ended up relying on implicit includes via this chain.

Given that there's been a general push to try and cut down on the number of header dependency entanglements, I thought I could contribute while solving my own immediate problems.

linux/elfcore.h is specifically related to ELF core files, so the two corefile notes-related headers could be moved there.

   J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux