Archive for February, 2008

Unions

I used to think that unions were bureaucratic organizations which mainly existed to get in people’s way. The closed shop seemed particularly dubious in that all employees were required to pay union dues, effectively imposing a tax on working.

My thinking has changed to some degree. While unions are deeply imperfect, they do have a role to play, or at least they could. In modern U.S. capitalism employers have an enormous ability to hire and fire people. Employees of large companies have essentially no control over this at all. In other words, there is a massive power disparity between the executive management of a large company and the employees, a disparity which is clearly reflected in salary.

One sometimes encounters the argument that a company will take appropriate care of its employees because that is good business. However, it is clear that this is not true in many cases. Different companies pursue different strategies, and strategies change over time. Many companies need people to do the work, but there are many people available and willing. Those companies have no incentive to treat their employees above a certain minimum level. This is obvious today in meat-packing plants, for example.

Given the power disparity, and given that some companies have no actual incentive to treat their employees well, what should employees do to improve their standing? The basic strategy is obvious: gain power by banding together and speaking with a single voice. Banding together is only effective if nearly everybody does it. Hence the union and the closed shop.

Unions are obviously subject to corruption, but actually no more so than companies themselves. It’s just more obvious when its the union, because the union is supposed to be on the side of the employees. The company is supposed to be on the side of itself, so few people seriously question the all-too-common self-dealing of executive management.

It’s true that employees in principle can always leave a bad job, but using that as an argument against a union cuts both ways: an employee who does not want to be part of a union is just as able to take a different job. The person who has no choice here is the company itself, but given the power disparity that seems reasonably fair.

This discussion is really only about unions in private enterprise. Government jobs seem different to me, in that the employer really is the people. I don’t have any firm conclusions about unions in government jobs.

It’s true that the most effective tactic that a union can employ is to stop working, and so the main visible effect of a union is a harmful one. But it’s also true that a company that treats its employees well will not have an obstreperous union. The right question to ask about a union is not “why are they stopping everything” but “what is management doing to push them to this position.”

It’s also true that a union in a failing industry can cause a company to collapse faster than it otherwise would, as union members struggle to hold on to their existing benefits. That is harsh, but frankly it’s no harsher than a company making massive layoffs to boost their stock price. Capitalism is sometimes brutal, and unions aren’t panaceas. Don’t blame the whole concept of the union for the fact that it sometimes leads to bad results.

Comments (3)

Voting

I vaguely recall that in one of Terry Pratchett’s books there is a quote along the lines of “he liked the idea of democracy until he considered the other people who would be voting.” No doubt other people have said similar things. Democracy always has the chance of devolving into mobocracy. The U.S. has a notoriously low percentage of people who actually vote; is that actually a good thing? Is it better when only interested people vote?

One natural fear about democracy is that it turns into a tyranny of the majority. The canonical example here would be the death of Socrates. Fortunately, in the U.S. this doesn’t seem to be the biggest problem, due at least in part to the Bill of Rights and the independent judiciary (in some places the first level of judges are elected, but there are higher levels which are appointed).

The problem in the U.S. seems to be more the capture by special interests. In a system like the U.S., the people who care a great deal about an issue can often get it passed because nobody exerts themselves to oppose it. I think this tends to lead to government by crisis. When there is some long-range problem, a relatively small group of people can delay action until the problem reaches crisis proportions. It’s difficult for a democracy to have a sensible long-term approach to problems. At least, that is true in a strong executive system like the U.S.; it is less true in a parliamentary system, in which parties must stake out clear positions.

Fewer people voting encourages capture by special interests and discourages tyranny of the majority. Capture by special interests discourages people from voting, as ti seems to have little effect. The special interests discourage people from voting, since it gives them a freer hand. Perhaps that is in part why the U.S. runs the way it does.

Of course, my forward-looking issue is your hobby-horse and their special interest. We all have our own.

Comments (6)

Kernel Linker Features

As I continue trying to build the kernel with gold, I’ve had to copy several features from the GNU linker to gold.

Historically, the GNU linker implemented the -R option to mean that it should only use the symbols found in the named object; the object should not actually be included in the output file. This feature is convenient for some types of embedded system work: you link a loadable module against an object or executable which represents the operating system. This gives you a simple-minded system call interface, in which you don’t have to specify an ABI, you just have to rebuild all your programs whenever the OS changes. This is also more or less how SVR3 shared libraries are used.

Historically, ELF linkers used -R to add a directory to the runtime search path. That is, the historic GNU linker -R was equivalent to –just-symbols, and the historic ELF linker -R was equivalent to -rpath. This caused a natural conflict when ELF support was added to the GNU linker. The compiler wanted to pass -R to the linker in some cases (in those days–I don’t think it does anymore), but -R was already implemented to mean something different.

Back in 1994 I resolved this issue in the GNU linker in a simple way: I made -R do different things based on whether the argument was a file or a directory. Given a file, it acts like –just-symbols; given a directory, it acts like -rpath. In retrospect, I should have decided that one of those choices was going to be the new default, and issued a warning whenever the other one was used. That would have encouraged people to change, and by now the ambiguity could have been removed. Admittedly at the time it was not so clear that ELF was going to become the dominant object file format.

In gold I originally simply made -R be equivalent to -rpath, as is appropriate for an ELF linker. Unfortunately, I’ve now discovered that the Linux build uses -R to mean –just-symbols. This is part of the vsyscall implementation. They build a shared library and a relocatable object in the same way using the same linker script. Then they refer to the relocatable object using -R. The effect is that they can make direct calls to the symbols defined in the shared library without having the linker introduce any of the usual PLT overhead. This of course assumes that the shared library will always be loaded at the specified address, which they ensure by other means.

So I’ve changed gold to make -R ambiguous in the same way as the GNU linker. I also had to implement –just-symbols. Maybe I should introduce that -R warning now, so that 14 years later the ambiguity can be removed.

Now, as it happens, that same linker script includes version specifications, and those version specifications force some symbols to be local. That is what the kernel wants for the shared library, but not for the relocatable object. The relocatable object needs to have a symbol be accessible although it is local in the shared library. This works with the GNU linker because the GNU linker simply ignores version specs when doing a relocatable link. Version specs do make sense for a relocatable link; in particular the ability to force symbols to be local. So gold used to honor them more or less as one would expect–actually this happened by default. Unfortunately I have now had to change that, and gold now ignores version scripts for relocatable links. Perhaps I will add a new option to enable them.

A minor feature used by the kernel build is to create an empty output file (not literally empty, but an ELF file with no symbols and no sections) when there are no input files. The GNU linker rejects being invoked with no input arguments. However, it is possible to pass it an empty archive, and it will proceed to generate an empty output file. Implementing this in gold was more complicated than one might expect, because up until now gold had no notion of the default target. gold always generated an output file in the same format as the input files. I had to introduce a default target based on the configuration options. I hope it will not be necessary to support the full power of the –oformat option, which essentially uses magic names to pick which type of ELF file to generate.

However, it did turn out to be necessary to support a special case of the –oformat option: –oformat binary. This directs the GNU linker to generate a binary file rather than a regular object file. It only makes sense for an executable whose load addresses are all at or near zero. The kernel build uses this feature to build a boot sector. It turned out to be fairly easy to implement in gold. gold uses mmap to build the output file, and already supported using an anonymous map and writing it to the output when complete. This was introduced to support -o /dev/null while still generating all linker warnings. It also permits writing the output file to standard output, which is slightly cool though useless. To implement binary output I just generated the regular ELF file to a memory buffer, and then copied the contents to the real output file using the load addresses.

The next feature I have to implement is –format binary, in which an input file is not an ELF file, but is treated as a binary blob. With luck that will be the last newlinker feature the kernel requires.

Comments (2)

Gold Feature Complete

I think that the new linker, gold, is now feature complete, and with a bit more testing it should be ready for an open release. I wanted to get it to the point where it could build the Linux kernel. I haven’t actually tested that yet, but it now has everything it needs.

The most painful part was that the Linux kernel build uses many features of GNU linker scripts. gold doesn’t use linker scripts internally, so they had to be bolted onto the side. gold lays out executables in memory in the logical way for ELF: it assigns sections to segments, lays out the segments in memory, and then sets the section offsets based on their position in the segment. Linker scripts, unfortunately, work backward. The linker script effectively lays out the sections in memory, and then the linker has to figure out how to fit the sections into segments. This fitting has been a long set of horrors in the GNU linker, and naive linker scripts often lead to the notorious “not enough room for program headers” error message. Fortunately in gold I could take learn from the current state of affairs in the GNU linker, which is much better than it used to be.

My goal has been to release gold in this quarter, so I should make it.

Comments (4)

Future Blogging

Blogging is still fairly new, and it will continue to evolve. Anything we say about it today has to be tentative. That aside, I think it’s quite interesting how many people start blogs. I would not have guessed that so many people felt that they wanted to say something to the world. Blogging makes it easy to talk to everybody, but that impulse must have existed before; how did it express itself?

For me the impulse expresses itself as a tendency to compose mini-essays in my head on whatever subject caught my attention. I often do it while walking. In the past I rarely told these to anybody and I rarely wrote them down. So what this blog is doing, at least in its current incarnation, is making it easy to write them down. In fact, my current goal of writing an entry every weekday is more or less forcing me to write them down. Does the popularity of blogging mean that everybody does this? My guess is no, that there are many different reasons for blogging.

Obviously some people blog to attract attention. In blogging today that more or less forces you to be increasingly outrageous, to shout louder. However, my impression is that that is a minority. Most people seem to write blogs because they have something they want to say. While I’m sure everybody would prefer to have readers than not, I think that for most people readers are not the point. The point is to speak.

Blogs aren’t going to change the world, at least not in the way some people think they will, by replacing journalism. The blog echo chamber and the speed at which information, true or false, travels is a consequence of the Internet, not of blogs. The same thing would happen if there were no blogs, it would just happen over e-mail instead.

Where blogs could change the world is by giving so many more people a chance to speak, and so many more people a chance to listen to what other people are saying. When lots of people have blogs, lots of people have a chance to find out what people are like. Perhaps this will help increase understanding of other people, help people see that we are all more or less the same. Or, you know, not. It could easily go the other way, and people could focus on blogs that will reinforce their preconceptions, and ignore the rest. In fact, of course, both will happen simultaneously, and we’ll be left in the same muddled mess that we are in now.

In the days before television, people had to entertain themselves much more than they do today. Perhaps blogs are a way of bringing us back to those days, when people could still be amateurs.

In any case, I think the simple fact that so many people want to speak is very interesting. I would not have guessed that. I have to believe that this is a good thing. It is better to be an author, a creator, than a consumer. The act of saying something forces you to consider just what it is you want to say. Even if you are just repeating the work of others, you are thinking about what you want to repeat. Thinking is good. We need more of it.

Comments

« Previous entries · Next entries »