[9fans] a question on style
  Home FAQ Contact Sign in
comp.os.plan9 only
 
Advanced search
POPULAR GROUPS

more...

comp.os.plan9 Profile…
 Up
[9fans] a question on style         


Author: ron minnich
Date: Jul 31, 2008 15:04

For some time now, over 10 years anyway, the GNU world has been using
the linker to create initialized structs, viz:
static const struct cpu_driver driver __cpu_driver = {
.ops = &cpu_dev_ops,
.id_table = cpu_table,
};

(this from linuxbios)

The __cpu_driver is passed to the linker and you end up with an array
of all structs tagged with that name.

These are called linker sets. I first heard of them in 1995 or so when
freebsd moved away from generating arrays of structs from the BSD
config tool and used gld to create those same arrays.

Plan 9 takes the older style approach: a script parses a config file
and creates C code which initializes the struct arrays.

Now, I betray my age, I guess, but I prefer the plan 9 style. I am
curious: am I just out of touch with this modern world?
Show full article (1.62Kb)
5 Comments
Re: [9fans] a question on style         


Author: erik quanstrom
Date: Jul 31, 2008 15:12

> OK, am I just out of date or is there a real reason for linker
> sets?This question just came up in linuxbios v3 and I am wondering if
> I am a stubborn old coot (likely) or if there really is merit to my
> dislike of linker sets.

why can't both be true?

- erik
1 Comment
Re: [9fans] a question on style         


Author: ron minnich
Date: Jul 31, 2008 15:17

On Thu, Jul 31, 2008 at 3:04 PM, erik quanstrom quanstro.net> wrote:
>> OK, am I just out of date or is there a real reason for linker
>> sets?This question just came up in linuxbios v3 and I am wondering if
>> I am a stubborn old coot (likely) or if there really is merit to my
>> dislike of linker sets.
>
> why can't both be true?
>

I suspect both are true ...

ron
no comments
Re: [9fans] a question on style         


Author: Roman V. Shaposhnik
Date: Aug 1, 2008 02:29

On Thu, 2008-07-31 at 15:02 -0700, ron minnich wrote:
> OK, am I just out of date or is there a real reason for linker
> sets?This question just came up in linuxbios v3 and I am wondering if
> I am a stubborn old coot (likely) or if there really is merit to my
> dislike of linker sets.

I tend to dislike any kind of linker magic in user-space quite
profoundly. The most I can tolerate is PLT, I guess. But even
that is something I don't appreciate all that much when I need
to debug low level code. So I agree with you there 100%%.

Now, on the other hand, I guess kernel is different though.
Isn't it supposed to be one huge piece of magic to begin with? ;-)

Thanks,
Roman.
2 Comments
Re: [9fans] a question on style         


Author: erik quanstrom
Date: Aug 1, 2008 03:22

> Now, on the other hand, I guess kernel is different though.
> Isn't it supposed to be one huge piece of magic to begin with? ;-)

it's supposed to be neither.

- erik
1 Comment
Re: [9fans] a question on style         


Author: Roman V. Shaposhnik
Date: Aug 1, 2008 04:12

On Fri, 2008-08-01 at 06:06 -0400, erik quanstrom wrote:
>> Now, on the other hand, I guess kernel is different though.
>> Isn't it supposed to be one huge piece of magic to begin with? ;-)
>
> it's supposed to be neither.

Yeah, but Ron was talking 'bout that kernel from Scandinavia,
right?

Thanks,
Roman.
no comments