Possible problem debug sections default addresses on powerpc-linux-gnu
Ian Lance Taylor
ian@zembu.com
Thu Apr 13 10:17:00 GMT 2000
Date: Thu, 13 Apr 2000 22:43:13 +1000 (EST)
From: Alan Modra <alan@linuxcare.com.au>
Try this patch, which implements Ian's suggestion about handling
SEC_DEBUGGING & ~ (SEC_LOAD | SEC_ALLOC) sections. Ian, why not do this
for all ~ (SEC_LOAD | SEC_ALLOC) sections?
You're right, we probably should do it that way. We don't need to
treat SEC_DEBUGGING specially.
ld/ChangeLog
* emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Process
~SEC_ALLOC sections too. Init start address of debug sections.
* emultempl/armelf.em (gld${EMULATION_NAME}_place_section): Ditto.
* emultempl/pe.em (gld${EMULATION_NAME}_place_section): Ditto.
Also set all relocateable section start addresses.
This patch is OK with me.
- if (place != NULL && place->os->bfd_section != NULL)
+ if (place && place->os->bfd_section)
I personally don't like this sort of shorthand. I think it is correct
to test boolean variables as `if (x)'. A pointer is not a boolean
variable. I think it is clearer to write an explicit test against
NULL, since that is after all what is being tested. You are not
testing whether place is true; you are testing whether it does not
have a particular special value. C permits a shorthand version of
that test, but C permits many shorthands which I think it is clearer
to avoid.
I don't feel strongly enough about it to insist on this sort of test
in new code. But I'd prefer it if you didn't change it in existing
code. Thanks.
Ian
More information about the Binutils
mailing list