Mark Mitchell <mark@xxxxxxxxxxxxxxxx> writes: > Richard Sandiford wrote: >> Daniel Jacobowitz <dan@xxxxxxxxxx> writes: >>> All comments welcome - Richard, especially from you. How would you >>> like to proceed? I think the first step should be to get your other >>> binutils/gcc patches merged, including MIPS16 PIC; I used those as a >>> base. But see a few of the notes for potential problems with those >>> patches. >> >> Yeah, Nick's approved most of the remaining binutils changes (thanks). >> I haven't applied them yet because of the doubt over whether st_size >> should be even or odd for ISA-encoded MIPS16 symbols. I don't really >> have an opinion, so I'll accept a maintainerly decision... > > [I'm not sure if this is a helpful suggestion or not, so feel free to > ignore it if it's not.] > > I would suggest that st_size be the actual size of the function, as it > lives in memory. A test of it's start/end location is "could I stick a > random data byte there and have it affect the function". For example, > for a Thumb function whose ISA address is "0x00000001", I would consider > for size purposes that it starts at "0x00000000", since altering that > byte at run-time would change the meaning of the function. For the record, my reasoning when picking the odd st_size was similar, but with the opposite outcome. The point of using an ISA-encoded st_value is that that's what most users want. Most of them won't even have code to say "is this a MIPS16 symbol?". So if users are going to get into the habit of using MIPS st_values without checking the "ISA bit", I thought it was more conservative to base the end address on the unmodified st_value rather than the modified one. In other words, I thought it was more conservative to have "st_value + st_size" be the end point of the function, rather than "(st_value & ~1) + st_size". This ensures that "st_value" and "st_value + st_size - 1" are bytes in the function, rather than making "st_value + st_size" be two bytes past the end of the function (and thus making "st_value + st_size - 1" refer to something outside the function). But like I say, I can see there are pros and cons both ways, so I don't really have an opinion. I'm happy to (and do) accpet Dan's decision. And I guess the ARM experience shows that my concern isn't really an issue in practice anyway. Richard